diff --git a/.php_cs b/.php_cs index 4fbe53e..6b8e23c 100644 --- a/.php_cs +++ b/.php_cs @@ -1,23 +1,18 @@ level(Symfony\CS\FixerInterface::PSR2_LEVEL) ->setUsingCache(true) - ->setRules([ - '@PSR2' => true, - 'ordered_imports' => 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, - ]) - ->setFinder( - PhpCsFixer\Finder::create() - ->exclude('test') - ->exclude('tests') - ->in(__DIR__) + ->fixers( + [ + 'ordered_use', + 'phpdoc_order', + 'short_array_syntax', + 'strict', + 'strict_param' + ] + ) + ->finder( + Symfony\CS\Finder\DefaultFinder::create() + ->in(__DIR__) ); diff --git a/README.md b/README.md index 8ec72dd..96f13f2 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ The MyYoast server NestJS Api This PHP package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: - API version: 1.0.0 -- Build package: io.swagger.codegen.languages.PhpClientCodegen +- Build package: io.swagger.codegen.v3.generators.php.PhpClientCodegen ## Requirements @@ -56,153 +56,241 @@ Please follow the [installation procedure](#installation--usage) and then run th admissionControllerChangeStudent($body, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AdmissionApi->admissionControllerChangeStudent: ', $e->getMessage(), PHP_EOL; +} + + +$apiInstance = new Yoast\MyYoastApiClient\Api\AdmissionApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$filter = new \stdClass; // object | Used for filtering/joining the results. + +try { + $result = $apiInstance->admissionControllerGetMany($filter); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AdmissionApi->admissionControllerGetMany: ', $e->getMessage(), PHP_EOL; +} + + +$apiInstance = new Yoast\MyYoastApiClient\Api\AdmissionApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$filter = new \stdClass; // object | Used for filtering/joining the results. + +try { + $apiInstance->admissionControllerGetManyPaged($filter); +} catch (Exception $e) { + echo 'Exception when calling AdmissionApi->admissionControllerGetManyPaged: ', $e->getMessage(), PHP_EOL; +} + + +$apiInstance = new Yoast\MyYoastApiClient\Api\AdmissionApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client() + new GuzzleHttp\Client(), + $config ); -$loginDto = new \Yoast\MyYoastApiClient\Model\LoginDto(); // \Yoast\MyYoastApiClient\Model\LoginDto | +$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | try { - $result = $apiInstance->apiCustomersLoginPost($loginDto); + $result = $apiInstance->admissionControllerGetOne($id); print_r($result); } catch (Exception $e) { - echo 'Exception when calling AuthApi->apiCustomersLoginPost: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling AdmissionApi->admissionControllerGetOne: ', $e->getMessage(), PHP_EOL; } + +$apiInstance = new Yoast\MyYoastApiClient\Api\AdmissionApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$body = new \Yoast\MyYoastApiClient\Model\CreateDto(); // \Yoast\MyYoastApiClient\Model\CreateDto | + +try { + $result = $apiInstance->admissionControllerInvite($body); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AdmissionApi->admissionControllerInvite: ', $e->getMessage(), PHP_EOL; +} ?> ``` ## Documentation for API Endpoints -All URIs are relative to *http://my.yoast.test:3000* +All URIs are relative to */* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*AuthApi* | [**apiCustomersLoginPost**](docs/Api/AuthApi.md#apicustomersloginpost) | **POST** /api/Customers/login | Log in a user on MyYoast. -*AuthApi* | [**apiCustomersLoginUserPost**](docs/Api/AuthApi.md#apicustomersloginuserpost) | **POST** /api/Customers/login-user | -*AuthApi* | [**apiCustomersLogoutUserPost**](docs/Api/AuthApi.md#apicustomerslogoutuserpost) | **POST** /api/Customers/logout-user | Logout the user on Yoast.com. -*AuthApi* | [**authYoastCallbackGet**](docs/Api/AuthApi.md#authyoastcallbackget) | **GET** /auth/yoast/callback | -*AuthApi* | [**authYoastGet**](docs/Api/AuthApi.md#authyoastget) | **GET** /auth/yoast | -*AuthApi* | [**logoutGet**](docs/Api/AuthApi.md#logoutget) | **GET** /logout | -*BlacklistApi* | [**apiBlacklistGet**](docs/Api/BlacklistApi.md#apiblacklistget) | **GET** /api/Blacklist | Gets blacklisted sites -*BlacklistApi* | [**apiBlacklistIdDelete**](docs/Api/BlacklistApi.md#apiblacklistiddelete) | **DELETE** /api/Blacklist/{id} | Remove a site from the blacklist -*BlacklistApi* | [**apiBlacklistPost**](docs/Api/BlacklistApi.md#apiblacklistpost) | **POST** /api/Blacklist | Creates a blacklisted site -*CloudflareApi* | [**apiCloudflareKvRegisteredDomainsPurgePost**](docs/Api/CloudflareApi.md#apicloudflarekvregistereddomainspurgepost) | **POST** /api/cloudflare/kv/registered-domains/purge | Purge kv pairs from the registered domains key value store in Cloudflare -*CloudflareApi* | [**apiCloudflareKvRegisteredDomainsUpdateAllPost**](docs/Api/CloudflareApi.md#apicloudflarekvregistereddomainsupdateallpost) | **POST** /api/cloudflare/kv/registered-domains/update-all | Update sites in the registered domains key value store in Cloudflare -*ComposerTokenApi* | [**apiComposerTokensGeneratePost**](docs/Api/ComposerTokenApi.md#apicomposertokensgeneratepost) | **POST** /api/ComposerTokens/generate | Generates a Composer token -*ComposerTokenApi* | [**apiComposerTokensIdDeletePost**](docs/Api/ComposerTokenApi.md#apicomposertokensiddeletepost) | **POST** /api/ComposerTokens/{id}/delete | Disable a composer token -*ComposerTokenApi* | [**apiComposerTokensIdRenamePost**](docs/Api/ComposerTokenApi.md#apicomposertokensidrenamepost) | **POST** /api/ComposerTokens/{id}/rename | Renames a Composer token -*CourseApi* | [**apiCoursesFromAcademyPut**](docs/Api/CourseApi.md#apicoursesfromacademyput) | **PUT** /api/Courses/fromAcademy | Upserts a course -*CourseApi* | [**apiCoursesGet**](docs/Api/CourseApi.md#apicoursesget) | **GET** /api/Courses | Get courses -*CourseApi* | [**apiCoursesIdGet**](docs/Api/CourseApi.md#apicoursesidget) | **GET** /api/Courses/{id} | -*CourseEnrollmentApi* | [**apiCourseEnrollmentsBulkInvitePost**](docs/Api/CourseEnrollmentApi.md#apicourseenrollmentsbulkinvitepost) | **POST** /api/CourseEnrollments/bulkInvite | Bulk invite for Course Enrollment. -*CourseEnrollmentApi* | [**apiCourseEnrollmentsFromAcademyPut**](docs/Api/CourseEnrollmentApi.md#apicourseenrollmentsfromacademyput) | **PUT** /api/CourseEnrollments/fromAcademy | Update a CourseEnrollment -*CourseEnrollmentApi* | [**apiCourseEnrollmentsGet**](docs/Api/CourseEnrollmentApi.md#apicourseenrollmentsget) | **GET** /api/CourseEnrollments | Get course enrollments -*CourseEnrollmentApi* | [**apiCourseEnrollmentsGetLegacyExpiringGet**](docs/Api/CourseEnrollmentApi.md#apicourseenrollmentsgetlegacyexpiringget) | **GET** /api/CourseEnrollments/getLegacyExpiring | Get legacy course enrollments that expire between two given dates -*CourseEnrollmentApi* | [**apiCourseEnrollmentsIdGet**](docs/Api/CourseEnrollmentApi.md#apicourseenrollmentsidget) | **GET** /api/CourseEnrollments/{id} | Get a course enrollment -*CourseEnrollmentApi* | [**apiCourseEnrollmentsIdInvitePost**](docs/Api/CourseEnrollmentApi.md#apicourseenrollmentsidinvitepost) | **POST** /api/CourseEnrollments/{id}/invite | Invite a customer -*CourseEnrollmentApi* | [**apiCourseEnrollmentsTransferPost**](docs/Api/CourseEnrollmentApi.md#apicourseenrollmentstransferpost) | **POST** /api/CourseEnrollments/transfer | Transfer course enrollments -*CustomerApi* | [**apiCustomersActivatePost**](docs/Api/CustomerApi.md#apicustomersactivatepost) | **POST** /api/Customers/activate | Activate the account of a user -*CustomerApi* | [**apiCustomersAllrolesGet**](docs/Api/CustomerApi.md#apicustomersallrolesget) | **GET** /api/Customers/allroles | Get all existing roles with their ID. -*CustomerApi* | [**apiCustomersCurrentGet**](docs/Api/CustomerApi.md#apicustomerscurrentget) | **GET** /api/Customers/current | Get the current customer -*CustomerApi* | [**apiCustomersCustomerIdBuyerCourseEnrollmentsGet**](docs/Api/CustomerApi.md#apicustomerscustomeridbuyercourseenrollmentsget) | **GET** /api/Customers/{customerId}/buyerCourseEnrollments | Find Course Enrollments that a customer is buyer of -*CustomerApi* | [**apiCustomersCustomerIdComposerTokensGet**](docs/Api/CustomerApi.md#apicustomerscustomeridcomposertokensget) | **GET** /api/Customers/{customerId}/composerTokens | Get composer tokens -*CustomerApi* | [**apiCustomersCustomerIdComposerTokensIdGet**](docs/Api/CustomerApi.md#apicustomerscustomeridcomposertokensidget) | **GET** /api/Customers/{customerId}/composerTokens/{id} | Get a composer token -*CustomerApi* | [**apiCustomersCustomerIdCourseEnrollmentsGet**](docs/Api/CustomerApi.md#apicustomerscustomeridcourseenrollmentsget) | **GET** /api/Customers/{customerId}/courseEnrollments | Find Course Enrollments -*CustomerApi* | [**apiCustomersCustomerIdIdentitiesGet**](docs/Api/CustomerApi.md#apicustomerscustomerididentitiesget) | **GET** /api/Customers/{customerId}/identities | Get user identities -*CustomerApi* | [**apiCustomersCustomerIdNewsletterDelete**](docs/Api/CustomerApi.md#apicustomerscustomeridnewsletterdelete) | **DELETE** /api/Customers/{customerId}/newsletter | Unsubscribe from the newsletter -*CustomerApi* | [**apiCustomersCustomerIdNewsletterGet**](docs/Api/CustomerApi.md#apicustomerscustomeridnewsletterget) | **GET** /api/Customers/{customerId}/newsletter | Newsletter subscription status -*CustomerApi* | [**apiCustomersCustomerIdNewsletterPost**](docs/Api/CustomerApi.md#apicustomerscustomeridnewsletterpost) | **POST** /api/Customers/{customerId}/newsletter | Subscribe to the newsletter -*CustomerApi* | [**apiCustomersCustomerIdOrdersGet**](docs/Api/CustomerApi.md#apicustomerscustomeridordersget) | **GET** /api/Customers/{customerId}/orders | Get orders -*CustomerApi* | [**apiCustomersCustomerIdOrdersIdGet**](docs/Api/CustomerApi.md#apicustomerscustomeridordersidget) | **GET** /api/Customers/{customerId}/orders/{id} | Get a order -*CustomerApi* | [**apiCustomersCustomerIdSitesGet**](docs/Api/CustomerApi.md#apicustomerscustomeridsitesget) | **GET** /api/Customers/{customerId}/sites | Get sites -*CustomerApi* | [**apiCustomersCustomerIdSitesIdGet**](docs/Api/CustomerApi.md#apicustomerscustomeridsitesidget) | **GET** /api/Customers/{customerId}/sites/{id} | Get a site -*CustomerApi* | [**apiCustomersCustomerIdSitesPost**](docs/Api/CustomerApi.md#apicustomerscustomeridsitespost) | **POST** /api/Customers/{customerId}/sites | Create a site for a user -*CustomerApi* | [**apiCustomersCustomerIdStudentCourseEnrollmentsGet**](docs/Api/CustomerApi.md#apicustomerscustomeridstudentcourseenrollmentsget) | **GET** /api/Customers/{customerId}/studentCourseEnrollments | Find Course Enrollments that a customer is student in -*CustomerApi* | [**apiCustomersCustomerIdSubscriptionsGet**](docs/Api/CustomerApi.md#apicustomerscustomeridsubscriptionsget) | **GET** /api/Customers/{customerId}/subscriptions | Get subscriptions -*CustomerApi* | [**apiCustomersCustomerIdSubscriptionsIdCancelPost**](docs/Api/CustomerApi.md#apicustomerscustomeridsubscriptionsidcancelpost) | **POST** /api/Customers/{customerId}/subscriptions/{id}/cancel | Cancel (part of) a subscription. -*CustomerApi* | [**apiCustomersCustomerIdSubscriptionsIdGet**](docs/Api/CustomerApi.md#apicustomerscustomeridsubscriptionsidget) | **GET** /api/Customers/{customerId}/subscriptions/{id} | Get a subscriptions -*CustomerApi* | [**apiCustomersGet**](docs/Api/CustomerApi.md#apicustomersget) | **GET** /api/Customers | Get customers -*CustomerApi* | [**apiCustomersIdAccessTokensPost**](docs/Api/CustomerApi.md#apicustomersidaccesstokenspost) | **POST** /api/Customers/{id}/accessTokens | Create an access token for a user -*CustomerApi* | [**apiCustomersIdAvatarPost**](docs/Api/CustomerApi.md#apicustomersidavatarpost) | **POST** /api/Customers/{id}/avatar | Upload a new UserAvatar to WordPress -*CustomerApi* | [**apiCustomersIdDownloadGet**](docs/Api/CustomerApi.md#apicustomersiddownloadget) | **GET** /api/Customers/{id}/download | Download profile. -*CustomerApi* | [**apiCustomersIdEnablePost**](docs/Api/CustomerApi.md#apicustomersidenablepost) | **POST** /api/Customers/{id}/enable | Enables the customer with the given ID -*CustomerApi* | [**apiCustomersIdFindRefundsGet**](docs/Api/CustomerApi.md#apicustomersidfindrefundsget) | **GET** /api/Customers/{id}/findRefunds | Find refunds for user -*CustomerApi* | [**apiCustomersIdGet**](docs/Api/CustomerApi.md#apicustomersidget) | **GET** /api/Customers/{id} | Get a customer -*CustomerApi* | [**apiCustomersIdPasswordPatch**](docs/Api/CustomerApi.md#apicustomersidpasswordpatch) | **PATCH** /api/Customers/{id}/password | Update a customer's password in WordPress -*CustomerApi* | [**apiCustomersIdPatch**](docs/Api/CustomerApi.md#apicustomersidpatch) | **PATCH** /api/Customers/{id} | -*CustomerApi* | [**apiCustomersIdProfileGet**](docs/Api/CustomerApi.md#apicustomersidprofileget) | **GET** /api/Customers/{id}/profile | -*CustomerApi* | [**apiCustomersIdProfilePatch**](docs/Api/CustomerApi.md#apicustomersidprofilepatch) | **PATCH** /api/Customers/{id}/profile | Update a customer to WordPress -*CustomerApi* | [**apiCustomersIdRoleMappingDelete**](docs/Api/CustomerApi.md#apicustomersidrolemappingdelete) | **DELETE** /api/Customers/{id}/roleMapping | -*CustomerApi* | [**apiCustomersIdRoleMappingPost**](docs/Api/CustomerApi.md#apicustomersidrolemappingpost) | **POST** /api/Customers/{id}/roleMapping | -*CustomerApi* | [**apiCustomersIdRolesGet**](docs/Api/CustomerApi.md#apicustomersidrolesget) | **GET** /api/Customers/{id}/roles | -*CustomerApi* | [**apiCustomersNewsletterListSubscribePost**](docs/Api/CustomerApi.md#apicustomersnewsletterlistsubscribepost) | **POST** /api/Customers/newsletter/{list}/subscribe | Subscribes a user to a newsletter -*CustomerApi* | [**apiCustomersNonceGet**](docs/Api/CustomerApi.md#apicustomersnonceget) | **GET** /api/Customers/nonce | Get a nonce from Yoast.com -*CustomerApi* | [**apiCustomersResetPasswordPatch**](docs/Api/CustomerApi.md#apicustomersresetpasswordpatch) | **PATCH** /api/Customers/resetPassword | Reset the user's password. -*CustomerApi* | [**apiCustomersRolemappingIdsGet**](docs/Api/CustomerApi.md#apicustomersrolemappingidsget) | **GET** /api/Customers/rolemapping-ids | Get the ids of all customers with at least one role. -*CustomerApi* | [**apiCustomersSendResetPasswordEmailPost**](docs/Api/CustomerApi.md#apicustomerssendresetpasswordemailpost) | **POST** /api/Customers/sendResetPasswordEmail | Send a reset password email to the user. -*CustomerApi* | [**apiCustomersSignupPost**](docs/Api/CustomerApi.md#apicustomerssignuppost) | **POST** /api/Customers/signup | Signup a customer on yoast.com. -*CustomerNoteApi* | [**apiCustomerNotesGet**](docs/Api/CustomerNoteApi.md#apicustomernotesget) | **GET** /api/CustomerNotes | Get customer notes -*CustomerNoteApi* | [**apiCustomerNotesIdDelete**](docs/Api/CustomerNoteApi.md#apicustomernotesiddelete) | **DELETE** /api/CustomerNotes/{id} | -*CustomerNoteApi* | [**apiCustomerNotesIdGet**](docs/Api/CustomerNoteApi.md#apicustomernotesidget) | **GET** /api/CustomerNotes/{id} | Get a customer note -*CustomerNoteApi* | [**apiCustomerNotesPost**](docs/Api/CustomerNoteApi.md#apicustomernotespost) | **POST** /api/CustomerNotes | -*DownloadApi* | [**apiDownloadsFileNameGet**](docs/Api/DownloadApi.md#apidownloadsfilenameget) | **GET** /api/downloads/file/{name} | Route to download a file -*DownloadApi* | [**apiDownloadsFileNamePost**](docs/Api/DownloadApi.md#apidownloadsfilenamepost) | **POST** /api/downloads/file/{name} | Route to update a file. -*EDDApi* | [**eddSlApiGet**](docs/Api/EDDApi.md#eddslapiget) | **GET** /edd-sl-api | Activate or deactivate a site license -*EDDApi* | [**eddSlApiPost**](docs/Api/EDDApi.md#eddslapipost) | **POST** /edd-sl-api | -*ExportOrdersApi* | [**exportOrdersV2FromToTypeGet**](docs/Api/ExportOrdersApi.md#exportordersv2fromtotypeget) | **GET** /export-orders/v2/{from}/{to}/{type} | Creates an export for orders -*ExportOrdersApi* | [**exportOrdersYearMonthTypeGet**](docs/Api/ExportOrdersApi.md#exportordersyearmonthtypeget) | **GET** /export-orders/{year}/{month}/{type} | Creates an export for orders -*FromWooCommerceApi* | [**apiCustomersFromWooCommercePut**](docs/Api/FromWooCommerceApi.md#apicustomersfromwoocommerceput) | **PUT** /api/Customers/fromWooCommerce | Update or create a customer -*FromWooCommerceApi* | [**apiOrdersFromWooCommercePut**](docs/Api/FromWooCommerceApi.md#apiordersfromwoocommerceput) | **PUT** /api/Orders/fromWooCommerce | Sync orders to MyYoast. -*FromWooCommerceApi* | [**apiProductGroupsFromWooCommercePut**](docs/Api/FromWooCommerceApi.md#apiproductgroupsfromwoocommerceput) | **PUT** /api/ProductGroups/fromWooCommerce | Sync products to MyYoast. -*FromWooCommerceApi* | [**apiProductsFromWooCommercePut**](docs/Api/FromWooCommerceApi.md#apiproductsfromwoocommerceput) | **PUT** /api/Products/fromWooCommerce | Sync products to MyYoast. -*HelpscoutApi* | [**helpscoutPost**](docs/Api/HelpscoutApi.md#helpscoutpost) | **POST** /helpscout | Get information about a customer -*OrderApi* | [**apiOrdersAutoRenewalCountGet**](docs/Api/OrderApi.md#apiordersautorenewalcountget) | **GET** /api/Orders/auto-renewal-count | -*OrderApi* | [**apiOrdersExportGet**](docs/Api/OrderApi.md#apiordersexportget) | **GET** /api/Orders/export | Get orders -*OrderApi* | [**apiOrdersGet**](docs/Api/OrderApi.md#apiordersget) | **GET** /api/Orders | Get orders -*OrderApi* | [**apiOrdersIdGet**](docs/Api/OrderApi.md#apiordersidget) | **GET** /api/Orders/{id} | Get a order -*OrderApi* | [**apiOrdersIdInvoiceGet**](docs/Api/OrderApi.md#apiordersidinvoiceget) | **GET** /api/Orders/{id}/invoice | Create invoice -*OrderApi* | [**apiOrdersIdRefundsRefundIdInvoiceGet**](docs/Api/OrderApi.md#apiordersidrefundsrefundidinvoiceget) | **GET** /api/Orders/{id}/refunds/{refundId}/invoice | Creates a credit note -*PackagesApi* | [**packagesDistOrgNameArchiveZipGet**](docs/Api/PackagesApi.md#packagesdistorgnamearchivezipget) | **GET** /packages/dist/{org}/{name}/{archive}.zip | Serves an .zip of the plugin. -*PackagesApi* | [**packagesPOrgNameAndHashJsonGet**](docs/Api/PackagesApi.md#packagesporgnameandhashjsonget) | **GET** /packages/p/{org}/{nameAndHash}.json | Serves the requested provider.json -*PackagesApi* | [**packagesPackagesJsonGet**](docs/Api/PackagesApi.md#packagespackagesjsonget) | **GET** /packages/packages.json | Serves the general packages.json file. -*ProductApi* | [**apiProductsGet**](docs/Api/ProductApi.md#apiproductsget) | **GET** /api/Products | Get products -*ProductApi* | [**apiProductsIdGet**](docs/Api/ProductApi.md#apiproductsidget) | **GET** /api/Products/{id} | Get a product -*ProductApi* | [**apiProductsProductIdDelete**](docs/Api/ProductApi.md#apiproductsproductiddelete) | **DELETE** /api/Products/{productId} | -*ProductApi* | [**apiProductsWordpressPluginVersionDetailsGet**](docs/Api/ProductApi.md#apiproductswordpresspluginversiondetailsget) | **GET** /api/Products/wordpressPluginVersionDetails | -*ProductGroupApi* | [**apiProductGroupsGet**](docs/Api/ProductGroupApi.md#apiproductgroupsget) | **GET** /api/ProductGroups | Get productgroups -*RefundApi* | [**apiRefundsExportGet**](docs/Api/RefundApi.md#apirefundsexportget) | **GET** /api/Refunds/export | Get refunds -*RefundApi* | [**apiRefundsGet**](docs/Api/RefundApi.md#apirefundsget) | **GET** /api/Refunds | Get refunds -*RefundApi* | [**apiRefundsIdGet**](docs/Api/RefundApi.md#apirefundsidget) | **GET** /api/Refunds/{id} | Get a refund -*RobotsApi* | [**robotsTxtGet**](docs/Api/RobotsApi.md#robotstxtget) | **GET** /robots.txt | -*ServerCheckApi* | [**serverCheckGet**](docs/Api/ServerCheckApi.md#servercheckget) | **GET** /server-check | Server health check -*SiteApi* | [**apiSitesCurrentGet**](docs/Api/SiteApi.md#apisitescurrentget) | **GET** /api/Sites/current | Get the current connected site for an access token. -*SiteApi* | [**apiSitesGet**](docs/Api/SiteApi.md#apisitesget) | **GET** /api/Sites | Get sites -*SiteApi* | [**apiSitesIdDelete**](docs/Api/SiteApi.md#apisitesiddelete) | **DELETE** /api/Sites/{id} | -*SiteApi* | [**apiSitesIdGet**](docs/Api/SiteApi.md#apisitesidget) | **GET** /api/Sites/{id} | Get a site -*SiteApi* | [**apiSitesIdPatch**](docs/Api/SiteApi.md#apisitesidpatch) | **PATCH** /api/Sites/{id} | -*SiteApi* | [**apiSitesIdSubscriptionsPut**](docs/Api/SiteApi.md#apisitesidsubscriptionsput) | **PUT** /api/Sites/{id}/subscriptions | Adds a subscription to a site -*SiteApi* | [**apiSitesIdSubscriptionsSubscriptionIdDelete**](docs/Api/SiteApi.md#apisitesidsubscriptionssubscriptioniddelete) | **DELETE** /api/Sites/{id}/subscriptions/{subscriptionId} | Removes a subscription from a site -*SiteApi* | [**apiSitesIndexPost**](docs/Api/SiteApi.md#apisitesindexpost) | **POST** /api/Sites/index | -*SiteApi* | [**apiSitesInfoGet**](docs/Api/SiteApi.md#apisitesinfoget) | **GET** /api/Sites/info | Get the current connected site for an access token. -*SiteApi* | [**apiSitesSwitchSubscriptionNumberOfTimesPost**](docs/Api/SiteApi.md#apisitesswitchsubscriptionnumberoftimespost) | **POST** /api/Sites/switchSubscriptionNumberOfTimes | Switches the subscription for a number of times. -*SiteApi* | [**apiSitesSwitchSubscriptionPost**](docs/Api/SiteApi.md#apisitesswitchsubscriptionpost) | **POST** /api/Sites/switchSubscription | Switches the subscription for a number of times. -*SiteApi* | [**apiSitesTransferPost**](docs/Api/SiteApi.md#apisitestransferpost) | **POST** /api/Sites/transfer | Transfer sites. -*SubscriptionApi* | [**apiSubscriptionsExpiringGet**](docs/Api/SubscriptionApi.md#apisubscriptionsexpiringget) | **GET** /api/Subscriptions/expiring | -*SubscriptionApi* | [**apiSubscriptionsGet**](docs/Api/SubscriptionApi.md#apisubscriptionsget) | **GET** /api/Subscriptions | Get subscriptions -*SubscriptionApi* | [**apiSubscriptionsIdDelete**](docs/Api/SubscriptionApi.md#apisubscriptionsiddelete) | **DELETE** /api/Subscriptions/{id} | Delete a subscription -*SubscriptionApi* | [**apiSubscriptionsIdGet**](docs/Api/SubscriptionApi.md#apisubscriptionsidget) | **GET** /api/Subscriptions/{id} | Get a subscription -*SubscriptionApi* | [**apiSubscriptionsIdRecalculateSubscriptionCountPost**](docs/Api/SubscriptionApi.md#apisubscriptionsidrecalculatesubscriptioncountpost) | **POST** /api/Subscriptions/{id}/recalculateSubscriptionCount | Recalculate SubscriptionCount. -*SubscriptionApi* | [**apiSubscriptionsRenewSubscriptionNumberSecretKeyGet**](docs/Api/SubscriptionApi.md#apisubscriptionsrenewsubscriptionnumbersecretkeyget) | **GET** /api/Subscriptions/renew/{subscriptionNumber}/{secretKey} | Renew subscriptions -*SubscriptionApi* | [**apiSubscriptionsSetExpiryDatePost**](docs/Api/SubscriptionApi.md#apisubscriptionssetexpirydatepost) | **POST** /api/Subscriptions/setExpiryDate | Set Date. -*SubscriptionApi* | [**apiSubscriptionsTransferPost**](docs/Api/SubscriptionApi.md#apisubscriptionstransferpost) | **POST** /api/Subscriptions/transfer | Transfer subscription ownership -*WorkerApi* | [**apiWorkerGetRecurringJobsInfoNameGet**](docs/Api/WorkerApi.md#apiworkergetrecurringjobsinfonameget) | **GET** /api/Worker/getRecurringJobsInfo/{name} | -*WorkerApi* | [**apiWorkerGetScheduledJobsNameGet**](docs/Api/WorkerApi.md#apiworkergetscheduledjobsnameget) | **GET** /api/Worker/getScheduledJobs/{name} | -*WorkerApi* | [**apiWorkerIdDelete**](docs/Api/WorkerApi.md#apiworkeriddelete) | **DELETE** /api/Worker/{id} | -*WorkerApi* | [**apiWorkerIdGet**](docs/Api/WorkerApi.md#apiworkeridget) | **GET** /api/Worker/{id} | -*WorkerApi* | [**apiWorkerPost**](docs/Api/WorkerApi.md#apiworkerpost) | **POST** /api/Worker | - +*AdmissionApi* | [**admissionControllerChangeStudent**](docs/Api/AdmissionApi.md#admissioncontrollerchangestudent) | **PUT** /api/Admissions/{id} | Update an admission +*AdmissionApi* | [**admissionControllerGetMany**](docs/Api/AdmissionApi.md#admissioncontrollergetmany) | **GET** /api/Admissions | Get admissions +*AdmissionApi* | [**admissionControllerGetManyPaged**](docs/Api/AdmissionApi.md#admissioncontrollergetmanypaged) | **GET** /api/Admissions/paged | Get admissions +*AdmissionApi* | [**admissionControllerGetOne**](docs/Api/AdmissionApi.md#admissioncontrollergetone) | **GET** /api/Admissions/{id} | Get an admission +*AdmissionApi* | [**admissionControllerInvite**](docs/Api/AdmissionApi.md#admissioncontrollerinvite) | **POST** /api/Admissions | Invite a customer +*AuthApi* | [**loginControllerGenerateAccessToken**](docs/Api/AuthApi.md#logincontrollergenerateaccesstoken) | **POST** /api/Customers/login | Log in a user on MyYoast. +*AuthApi* | [**loginControllerLoginUser**](docs/Api/AuthApi.md#logincontrollerloginuser) | **POST** /api/Customers/login-user | +*AuthApi* | [**loginControllerLogoutUser**](docs/Api/AuthApi.md#logincontrollerlogoutuser) | **POST** /api/Customers/logout-user | Logout the user on Yoast.com. +*AuthApi* | [**loginControllerRemoveAccessToken**](docs/Api/AuthApi.md#logincontrollerremoveaccesstoken) | **GET** /logout | +*AuthApi* | [**yoastComOpenIdControllerYoastComCallback**](docs/Api/AuthApi.md#yoastcomopenidcontrolleryoastcomcallback) | **GET** /auth/yoast/callback | +*AuthApi* | [**yoastComOpenIdControllerYoastComLogin**](docs/Api/AuthApi.md#yoastcomopenidcontrolleryoastcomlogin) | **GET** /auth/yoast | +*BlacklistApi* | [**blacklistControllerCreateOne**](docs/Api/BlacklistApi.md#blacklistcontrollercreateone) | **POST** /api/Blacklist | Creates a blacklisted site +*BlacklistApi* | [**blacklistControllerDeleteOne**](docs/Api/BlacklistApi.md#blacklistcontrollerdeleteone) | **DELETE** /api/Blacklist/{id} | Remove a site from the blacklist +*BlacklistApi* | [**blacklistControllerGetMany**](docs/Api/BlacklistApi.md#blacklistcontrollergetmany) | **GET** /api/Blacklist | Gets blacklisted sites +*BlacklistApi* | [**blacklistControllerGetManyPaged**](docs/Api/BlacklistApi.md#blacklistcontrollergetmanypaged) | **GET** /api/Blacklist/paged | Gets blacklisted sites +*CloudflareApi* | [**cloudflareControllerPurgeKVStore**](docs/Api/CloudflareApi.md#cloudflarecontrollerpurgekvstore) | **POST** /api/cloudflare/kv/registered-domains/purge | Purge kv pairs from the registered domains key value store in Cloudflare +*CloudflareApi* | [**cloudflareControllerUpdateAll**](docs/Api/CloudflareApi.md#cloudflarecontrollerupdateall) | **POST** /api/cloudflare/kv/registered-domains/update-all | Update sites in the registered domains key value store in Cloudflare +*ComposerTokenApi* | [**composerTokenControllerDisable**](docs/Api/ComposerTokenApi.md#composertokencontrollerdisable) | **POST** /api/ComposerTokens/{id}/delete | Disable a composer token +*ComposerTokenApi* | [**composerTokenControllerGenerate**](docs/Api/ComposerTokenApi.md#composertokencontrollergenerate) | **POST** /api/ComposerTokens/generate | Generates a Composer token +*ComposerTokenApi* | [**composerTokenControllerRename**](docs/Api/ComposerTokenApi.md#composertokencontrollerrename) | **POST** /api/ComposerTokens/{id}/rename | Renames a Composer token +*CourseApi* | [**courseControllerFromAcademy**](docs/Api/CourseApi.md#coursecontrollerfromacademy) | **PUT** /api/Courses/fromAcademy | Upserts a course +*CourseApi* | [**courseControllerGetMany**](docs/Api/CourseApi.md#coursecontrollergetmany) | **GET** /api/Courses | Get courses +*CourseApi* | [**courseControllerGetOne**](docs/Api/CourseApi.md#coursecontrollergetone) | **GET** /api/Courses/{id} | +*CourseEnrollmentApi* | [**courseEnrollmentControllerBulkInvite**](docs/Api/CourseEnrollmentApi.md#courseenrollmentcontrollerbulkinvite) | **POST** /api/CourseEnrollments/bulkInvite | Bulk invite for Course Enrollment. +*CourseEnrollmentApi* | [**courseEnrollmentControllerFromAcademy**](docs/Api/CourseEnrollmentApi.md#courseenrollmentcontrollerfromacademy) | **PUT** /api/CourseEnrollments/fromAcademy | Update a CourseEnrollment +*CourseEnrollmentApi* | [**courseEnrollmentControllerGetLegacyExpiring**](docs/Api/CourseEnrollmentApi.md#courseenrollmentcontrollergetlegacyexpiring) | **GET** /api/CourseEnrollments/getLegacyExpiring | Get legacy course enrollments that expire between two given dates +*CourseEnrollmentApi* | [**courseEnrollmentControllerGetMany**](docs/Api/CourseEnrollmentApi.md#courseenrollmentcontrollergetmany) | **GET** /api/CourseEnrollments | Get course enrollments +*CourseEnrollmentApi* | [**courseEnrollmentControllerGetManyPaged**](docs/Api/CourseEnrollmentApi.md#courseenrollmentcontrollergetmanypaged) | **GET** /api/CourseEnrollments/paged | Get customers +*CourseEnrollmentApi* | [**courseEnrollmentControllerGetOne**](docs/Api/CourseEnrollmentApi.md#courseenrollmentcontrollergetone) | **GET** /api/CourseEnrollments/{id} | Get a course enrollment +*CourseEnrollmentApi* | [**courseEnrollmentControllerInvite**](docs/Api/CourseEnrollmentApi.md#courseenrollmentcontrollerinvite) | **POST** /api/CourseEnrollments/{id}/invite | Invite a customer +*CourseEnrollmentApi* | [**courseEnrollmentControllerTransfer**](docs/Api/CourseEnrollmentApi.md#courseenrollmentcontrollertransfer) | **POST** /api/CourseEnrollments/transfer | Transfer course enrollments +*CustomerApi* | [**customerAccessTokenControllerCreateAccessToken**](docs/Api/CustomerApi.md#customeraccesstokencontrollercreateaccesstoken) | **POST** /api/Customers/{id}/accessTokens | Create an access token for a user +*CustomerApi* | [**customerAuthControllerActivate**](docs/Api/CustomerApi.md#customerauthcontrolleractivate) | **POST** /api/Customers/activate | Activate the account of a user +*CustomerApi* | [**customerAuthControllerChangePassword**](docs/Api/CustomerApi.md#customerauthcontrollerchangepassword) | **PATCH** /api/Customers/{id}/password | Update a customer's password in WordPress +*CustomerApi* | [**customerAuthControllerGetNonce**](docs/Api/CustomerApi.md#customerauthcontrollergetnonce) | **GET** /api/Customers/nonce | Get a nonce from Yoast.com +*CustomerApi* | [**customerAuthControllerResetPassword**](docs/Api/CustomerApi.md#customerauthcontrollerresetpassword) | **PATCH** /api/Customers/resetPassword | Reset the user's password. +*CustomerApi* | [**customerAuthControllerSendResetPasswordEmail**](docs/Api/CustomerApi.md#customerauthcontrollersendresetpasswordemail) | **POST** /api/Customers/sendResetPasswordEmail | Send a reset password email to the user. +*CustomerApi* | [**customerAuthControllerSignup**](docs/Api/CustomerApi.md#customerauthcontrollersignup) | **POST** /api/Customers/signup | Signup a customer on yoast.com. +*CustomerApi* | [**customerComposerTokenControllerGetMany**](docs/Api/CustomerApi.md#customercomposertokencontrollergetmany) | **GET** /api/Customers/{customerId}/composerTokens | Get composer tokens +*CustomerApi* | [**customerComposerTokenControllerGetOne**](docs/Api/CustomerApi.md#customercomposertokencontrollergetone) | **GET** /api/Customers/{customerId}/composerTokens/{id} | Get a composer token +*CustomerApi* | [**customerControllerCurrent**](docs/Api/CustomerApi.md#customercontrollercurrent) | **GET** /api/Customers/current | Get the current customer +*CustomerApi* | [**customerControllerDownloadProfile**](docs/Api/CustomerApi.md#customercontrollerdownloadprofile) | **GET** /api/Customers/{id}/download | Download profile. +*CustomerApi* | [**customerControllerEnable**](docs/Api/CustomerApi.md#customercontrollerenable) | **POST** /api/Customers/{id}/enable | Enables the customer with the given ID +*CustomerApi* | [**customerControllerGetAllRoles**](docs/Api/CustomerApi.md#customercontrollergetallroles) | **GET** /api/Customers/allroles | Get all existing roles with their ID. +*CustomerApi* | [**customerControllerGetCustomersWithRole**](docs/Api/CustomerApi.md#customercontrollergetcustomerswithrole) | **GET** /api/Customers/rolemapping-ids | Get the ids of all customers with at least one role. +*CustomerApi* | [**customerControllerGetMany**](docs/Api/CustomerApi.md#customercontrollergetmany) | **GET** /api/Customers | Get customers +*CustomerApi* | [**customerControllerGetManyPaged**](docs/Api/CustomerApi.md#customercontrollergetmanypaged) | **GET** /api/Customers/paged | Get customers +*CustomerApi* | [**customerControllerGetOne**](docs/Api/CustomerApi.md#customercontrollergetone) | **GET** /api/Customers/{id} | Get a customer +*CustomerApi* | [**customerControllerPatchProfile**](docs/Api/CustomerApi.md#customercontrollerpatchprofile) | **PATCH** /api/Customers/{id}/profile | Update a customer to WordPress +*CustomerApi* | [**customerControllerProfile**](docs/Api/CustomerApi.md#customercontrollerprofile) | **GET** /api/Customers/{id}/profile | +*CustomerApi* | [**customerControllerUpdateOne**](docs/Api/CustomerApi.md#customercontrollerupdateone) | **PATCH** /api/Customers/{id} | +*CustomerApi* | [**customerControllerUploadAvatar**](docs/Api/CustomerApi.md#customercontrolleruploadavatar) | **POST** /api/Customers/{id}/avatar | Upload a new UserAvatar to WordPress +*CustomerApi* | [**customerCourseEnrollmentControllerGetBuyerCourseEnrollments**](docs/Api/CustomerApi.md#customercourseenrollmentcontrollergetbuyercourseenrollments) | **GET** /api/Customers/{customerId}/buyerCourseEnrollments | Find Course Enrollments that a customer is buyer of +*CustomerApi* | [**customerCourseEnrollmentControllerGetCourseEnrollments**](docs/Api/CustomerApi.md#customercourseenrollmentcontrollergetcourseenrollments) | **GET** /api/Customers/{customerId}/courseEnrollments | Find Course Enrollments +*CustomerApi* | [**customerCourseEnrollmentControllerGetStudentCourseEnrollments**](docs/Api/CustomerApi.md#customercourseenrollmentcontrollergetstudentcourseenrollments) | **GET** /api/Customers/{customerId}/studentCourseEnrollments | Find Course Enrollments that a customer is student in +*CustomerApi* | [**customerGDPRControllerDeleteCustomer**](docs/Api/CustomerApi.md#customergdprcontrollerdeletecustomer) | **DELETE** /api/Customers/{id}/gdpr-delete | Performs a \"GDPR forget me\" request. +*CustomerApi* | [**customerIdentityControllerGetMany**](docs/Api/CustomerApi.md#customeridentitycontrollergetmany) | **GET** /api/Customers/{customerId}/identities | Get user identities +*CustomerApi* | [**customerNewsletterControllerStatus**](docs/Api/CustomerApi.md#customernewslettercontrollerstatus) | **GET** /api/Customers/{customerId}/newsletter | Newsletter subscription status +*CustomerApi* | [**customerNewsletterControllerSubscribe**](docs/Api/CustomerApi.md#customernewslettercontrollersubscribe) | **POST** /api/Customers/{customerId}/newsletter | Subscribe to the newsletter +*CustomerApi* | [**customerNewsletterControllerSubscribeByEmail**](docs/Api/CustomerApi.md#customernewslettercontrollersubscribebyemail) | **POST** /api/Customers/newsletter/{list}/subscribe | Subscribes a user to a newsletter +*CustomerApi* | [**customerNewsletterControllerUnsubscribe**](docs/Api/CustomerApi.md#customernewslettercontrollerunsubscribe) | **DELETE** /api/Customers/{customerId}/newsletter | Unsubscribe from the newsletter +*CustomerApi* | [**customerOrderControllerGetMany**](docs/Api/CustomerApi.md#customerordercontrollergetmany) | **GET** /api/Customers/{customerId}/orders | Get orders +*CustomerApi* | [**customerOrderControllerGetOne**](docs/Api/CustomerApi.md#customerordercontrollergetone) | **GET** /api/Customers/{customerId}/orders/{id} | Get a order +*CustomerApi* | [**customerRefundControllerFindRefunds**](docs/Api/CustomerApi.md#customerrefundcontrollerfindrefunds) | **GET** /api/Customers/{id}/findRefunds | Find refunds for user +*CustomerApi* | [**customerRolesControllerAddRole**](docs/Api/CustomerApi.md#customerrolescontrolleraddrole) | **POST** /api/Customers/{id}/roleMapping | +*CustomerApi* | [**customerRolesControllerDeleteRole**](docs/Api/CustomerApi.md#customerrolescontrollerdeleterole) | **DELETE** /api/Customers/{id}/roleMapping | +*CustomerApi* | [**customerRolesControllerGetMany**](docs/Api/CustomerApi.md#customerrolescontrollergetmany) | **GET** /api/Customers/{id}/roles | +*CustomerApi* | [**customerSiteControllerCreateSite**](docs/Api/CustomerApi.md#customersitecontrollercreatesite) | **POST** /api/Customers/{customerId}/sites | Create a site for a user +*CustomerApi* | [**customerSiteControllerGetMany**](docs/Api/CustomerApi.md#customersitecontrollergetmany) | **GET** /api/Customers/{customerId}/sites | Get sites +*CustomerApi* | [**customerSiteControllerGetOne**](docs/Api/CustomerApi.md#customersitecontrollergetone) | **GET** /api/Customers/{customerId}/sites/{id} | Get a site +*CustomerApi* | [**customerSubscriptionControllerCancelSubscription**](docs/Api/CustomerApi.md#customersubscriptioncontrollercancelsubscription) | **POST** /api/Customers/{customerId}/subscriptions/{id}/cancel | Cancel (part of) a subscription. +*CustomerApi* | [**customerSubscriptionControllerGetMany**](docs/Api/CustomerApi.md#customersubscriptioncontrollergetmany) | **GET** /api/Customers/{customerId}/subscriptions | Get subscriptions +*CustomerApi* | [**customerSubscriptionControllerGetOne**](docs/Api/CustomerApi.md#customersubscriptioncontrollergetone) | **GET** /api/Customers/{customerId}/subscriptions/{id} | Get a subscriptions +*CustomerNoteApi* | [**customerNoteControllerCreateOne**](docs/Api/CustomerNoteApi.md#customernotecontrollercreateone) | **POST** /api/CustomerNotes | +*CustomerNoteApi* | [**customerNoteControllerDeleteOne**](docs/Api/CustomerNoteApi.md#customernotecontrollerdeleteone) | **DELETE** /api/CustomerNotes/{id} | +*CustomerNoteApi* | [**customerNoteControllerGetMany**](docs/Api/CustomerNoteApi.md#customernotecontrollergetmany) | **GET** /api/CustomerNotes | Get customer notes +*CustomerNoteApi* | [**customerNoteControllerGetOne**](docs/Api/CustomerNoteApi.md#customernotecontrollergetone) | **GET** /api/CustomerNotes/{id} | Get a customer note +*DownloadApi* | [**downloadControllerDownloadFile**](docs/Api/DownloadApi.md#downloadcontrollerdownloadfile) | **GET** /api/downloads/file/{name} | Route to download a file +*DownloadApi* | [**downloadControllerUploadFile**](docs/Api/DownloadApi.md#downloadcontrolleruploadfile) | **POST** /api/downloads/file/{name} | Route to update a file. +*EDDApi* | [**eddControllerHandleGetRequest**](docs/Api/EDDApi.md#eddcontrollerhandlegetrequest) | **GET** /edd-sl-api | Activate or deactivate a site license +*EDDApi* | [**eddControllerHandlePostRequest**](docs/Api/EDDApi.md#eddcontrollerhandlepostrequest) | **POST** /edd-sl-api | +*EmailApi* | [**emailControllerSendEmails**](docs/Api/EmailApi.md#emailcontrollersendemails) | **POST** /api/Emails/bulk-send | +*ExportOrdersApi* | [**exportOrdersControllerExportOrders**](docs/Api/ExportOrdersApi.md#exportorderscontrollerexportorders) | **GET** /export-orders/{year}/{month}/{type} | Creates an export for orders +*ExportOrdersApi* | [**exportOrdersControllerExportOrdersV2**](docs/Api/ExportOrdersApi.md#exportorderscontrollerexportordersv2) | **GET** /export-orders/v2/{from}/{to}/{type} | Creates an export for orders +*FromWooCommerceApi* | [**fromWooCommerceControllerCustomerFromWooCommerce**](docs/Api/FromWooCommerceApi.md#fromwoocommercecontrollercustomerfromwoocommerce) | **PUT** /api/Customers/fromWooCommerce | Update or create a customer +*FromWooCommerceApi* | [**fromWooCommerceControllerOrderFromWooCommerce**](docs/Api/FromWooCommerceApi.md#fromwoocommercecontrollerorderfromwoocommerce) | **PUT** /api/Orders/fromWooCommerce | Sync orders to MyYoast. +*FromWooCommerceApi* | [**fromWooCommerceControllerProductFromWooCommerce**](docs/Api/FromWooCommerceApi.md#fromwoocommercecontrollerproductfromwoocommerce) | **PUT** /api/Products/fromWooCommerce | Sync products to MyYoast. +*FromWooCommerceApi* | [**fromWooCommerceControllerProductGroupFromWooCommerce**](docs/Api/FromWooCommerceApi.md#fromwoocommercecontrollerproductgroupfromwoocommerce) | **PUT** /api/ProductGroups/fromWooCommerce | Sync products to MyYoast. +*GDPRApi* | [**customerGDPRControllerDeleteCustomer**](docs/Api/GDPRApi.md#customergdprcontrollerdeletecustomer) | **DELETE** /api/Customers/{id}/gdpr-delete | Performs a \"GDPR forget me\" request. +*HelpscoutApi* | [**helpScoutControllerHelpscout**](docs/Api/HelpscoutApi.md#helpscoutcontrollerhelpscout) | **POST** /helpscout | Get information about a customer +*OrderApi* | [**orderControllerExport**](docs/Api/OrderApi.md#ordercontrollerexport) | **GET** /api/Orders/export | Get orders +*OrderApi* | [**orderControllerGetAutoRenewalCount**](docs/Api/OrderApi.md#ordercontrollergetautorenewalcount) | **GET** /api/Orders/auto-renewal-count | +*OrderApi* | [**orderControllerGetMany**](docs/Api/OrderApi.md#ordercontrollergetmany) | **GET** /api/Orders | Get orders +*OrderApi* | [**orderControllerGetManyPaged**](docs/Api/OrderApi.md#ordercontrollergetmanypaged) | **GET** /api/Orders/paged | Get orders +*OrderApi* | [**orderControllerGetOne**](docs/Api/OrderApi.md#ordercontrollergetone) | **GET** /api/Orders/{id} | Get a order +*OrderApi* | [**orderControllerInvoice**](docs/Api/OrderApi.md#ordercontrollerinvoice) | **GET** /api/Orders/{id}/invoice | Create invoice +*OrderApi* | [**orderControllerRefundInvoice**](docs/Api/OrderApi.md#ordercontrollerrefundinvoice) | **GET** /api/Orders/{id}/refunds/{refundId}/invoice | Creates a credit note +*PackagesApi* | [**packagesControllerServeArchiveZIP**](docs/Api/PackagesApi.md#packagescontrollerservearchivezip) | **GET** /packages/dist/{org}/{name}/{archive}.zip | Serves an .zip of the plugin. +*PackagesApi* | [**packagesControllerServePackagesJSON**](docs/Api/PackagesApi.md#packagescontrollerservepackagesjson) | **GET** /packages/packages.json | Serves the general packages.json file. +*PackagesApi* | [**packagesControllerServeProvider2JSON**](docs/Api/PackagesApi.md#packagescontrollerserveprovider2json) | **GET** /packages/p2/{org}/{name}.json | Serves the requested provider.json +*PackagesApi* | [**packagesControllerServeProviderJSON**](docs/Api/PackagesApi.md#packagescontrollerserveproviderjson) | **GET** /packages/p/{org}/{nameAndHash}.json | Serves the requested provider.json +*ProductApi* | [**productControllerDeleteOne**](docs/Api/ProductApi.md#productcontrollerdeleteone) | **DELETE** /api/Products/{productId} | +*ProductApi* | [**productControllerGetMany**](docs/Api/ProductApi.md#productcontrollergetmany) | **GET** /api/Products | Get products +*ProductApi* | [**productControllerGetOne**](docs/Api/ProductApi.md#productcontrollergetone) | **GET** /api/Products/{id} | Get a product +*ProductApi* | [**productControllerPluginVersionDetails**](docs/Api/ProductApi.md#productcontrollerpluginversiondetails) | **GET** /api/Products/wordpressPluginVersionDetails | +*ProductGroupApi* | [**productGroupControllerGetMany**](docs/Api/ProductGroupApi.md#productgroupcontrollergetmany) | **GET** /api/ProductGroups | Get productgroups +*ProvisionerApi* | [**provisionerDataControllerGetMany**](docs/Api/ProvisionerApi.md#provisionerdatacontrollergetmany) | **GET** /api/ProvisionerData | Get provisioner data +*ProvisionerApi* | [**provisionerDataControllerGetOne**](docs/Api/ProvisionerApi.md#provisionerdatacontrollergetone) | **GET** /api/ProvisionerData/{id} | Get provisioner data +*RefundApi* | [**refundControllerExport**](docs/Api/RefundApi.md#refundcontrollerexport) | **GET** /api/Refunds/export | Get refunds +*RefundApi* | [**refundControllerGetMany**](docs/Api/RefundApi.md#refundcontrollergetmany) | **GET** /api/Refunds | Get refunds +*RefundApi* | [**refundControllerGetOne**](docs/Api/RefundApi.md#refundcontrollergetone) | **GET** /api/Refunds/{id} | Get a refund +*RobotsApi* | [**robotsControllerServeRobots**](docs/Api/RobotsApi.md#robotscontrollerserverobots) | **GET** /robots.txt | +*ServerCheckApi* | [**serverHealthControllerCheckHealth**](docs/Api/ServerCheckApi.md#serverhealthcontrollercheckhealth) | **GET** /server-check | Server health check +*SiteApi* | [**siteControllerCurrent**](docs/Api/SiteApi.md#sitecontrollercurrent) | **GET** /api/Sites/current | Get the current connected site for an access token. +*SiteApi* | [**siteControllerCurrentClone**](docs/Api/SiteApi.md#sitecontrollercurrentclone) | **GET** /api/Sites/info | Get the current connected site for an access token. +*SiteApi* | [**siteControllerDeleteOne**](docs/Api/SiteApi.md#sitecontrollerdeleteone) | **DELETE** /api/Sites/{id} | +*SiteApi* | [**siteControllerGetMany**](docs/Api/SiteApi.md#sitecontrollergetmany) | **GET** /api/Sites | Get sites +*SiteApi* | [**siteControllerGetManyPaged**](docs/Api/SiteApi.md#sitecontrollergetmanypaged) | **GET** /api/Sites/paged | Get sites +*SiteApi* | [**siteControllerGetOne**](docs/Api/SiteApi.md#sitecontrollergetone) | **GET** /api/Sites/{id} | Get a site +*SiteApi* | [**siteControllerIndex**](docs/Api/SiteApi.md#sitecontrollerindex) | **POST** /api/Sites/index | +*SiteApi* | [**siteControllerSwitchSubscription**](docs/Api/SiteApi.md#sitecontrollerswitchsubscription) | **POST** /api/Sites/switchSubscription | Switches the subscription for a number of times. +*SiteApi* | [**siteControllerSwitchSubscriptionNumberOfTimes**](docs/Api/SiteApi.md#sitecontrollerswitchsubscriptionnumberoftimes) | **POST** /api/Sites/switchSubscriptionNumberOfTimes | Switches the subscription for a number of times. +*SiteApi* | [**siteControllerTransfer**](docs/Api/SiteApi.md#sitecontrollertransfer) | **POST** /api/Sites/transfer | Transfer sites. +*SiteApi* | [**siteControllerUpdateOne**](docs/Api/SiteApi.md#sitecontrollerupdateone) | **PATCH** /api/Sites/{id} | +*SiteApi* | [**siteSubscriptionControllerAddSubscription**](docs/Api/SiteApi.md#sitesubscriptioncontrolleraddsubscription) | **PUT** /api/Sites/{id}/subscriptions | Adds a subscription to a site +*SiteApi* | [**siteSubscriptionControllerRemoveSubscription**](docs/Api/SiteApi.md#sitesubscriptioncontrollerremovesubscription) | **DELETE** /api/Sites/{id}/subscriptions/{subscriptionId} | Removes a subscription from a site +*SubscriptionApi* | [**subscriptionControllerDeleteOne**](docs/Api/SubscriptionApi.md#subscriptioncontrollerdeleteone) | **DELETE** /api/Subscriptions/{id} | Delete a subscription +*SubscriptionApi* | [**subscriptionControllerForceCancel**](docs/Api/SubscriptionApi.md#subscriptioncontrollerforcecancel) | **POST** /api/Subscriptions/{id}/force-cancel | Forcefully cancel a subscription +*SubscriptionApi* | [**subscriptionControllerGetExpiringSubscriptions**](docs/Api/SubscriptionApi.md#subscriptioncontrollergetexpiringsubscriptions) | **GET** /api/Subscriptions/expiring | +*SubscriptionApi* | [**subscriptionControllerGetMany**](docs/Api/SubscriptionApi.md#subscriptioncontrollergetmany) | **GET** /api/Subscriptions | Get subscriptions +*SubscriptionApi* | [**subscriptionControllerGetManyPaged**](docs/Api/SubscriptionApi.md#subscriptioncontrollergetmanypaged) | **GET** /api/Subscriptions/paged | Get subscriptions +*SubscriptionApi* | [**subscriptionControllerGetOne**](docs/Api/SubscriptionApi.md#subscriptioncontrollergetone) | **GET** /api/Subscriptions/{id} | Get a subscription +*SubscriptionApi* | [**subscriptionControllerRecalculateSubscriptionCount**](docs/Api/SubscriptionApi.md#subscriptioncontrollerrecalculatesubscriptioncount) | **POST** /api/Subscriptions/{id}/recalculateSubscriptionCount | Recalculate SubscriptionCount. +*SubscriptionApi* | [**subscriptionControllerRenew**](docs/Api/SubscriptionApi.md#subscriptioncontrollerrenew) | **GET** /api/Subscriptions/renew/{subscriptionNumber}/{secretKey} | Renew subscriptions +*SubscriptionApi* | [**subscriptionControllerSetExpiryDate**](docs/Api/SubscriptionApi.md#subscriptioncontrollersetexpirydate) | **POST** /api/Subscriptions/setExpiryDate | Set Date. +*SubscriptionApi* | [**subscriptionControllerTransferOwnership**](docs/Api/SubscriptionApi.md#subscriptioncontrollertransferownership) | **POST** /api/Subscriptions/transfer | Transfer subscription ownership +*SubscriptionProvisioningApi* | [**subscriptionProvisioningControllerCancelSubscription**](docs/Api/SubscriptionProvisioningApi.md#subscriptionprovisioningcontrollercancelsubscription) | **POST** /api/provisioning/subscriptions/{id}/cancel | Cancel a single subscription +*SubscriptionProvisioningApi* | [**subscriptionProvisioningControllerCreate**](docs/Api/SubscriptionProvisioningApi.md#subscriptionprovisioningcontrollercreate) | **POST** /api/provisioning/subscriptions/create | Create a subscription +*SubscriptionProvisioningApi* | [**subscriptionProvisioningControllerGetOne**](docs/Api/SubscriptionProvisioningApi.md#subscriptionprovisioningcontrollergetone) | **GET** /api/provisioning/subscriptions/{id} | Get a subscription +*SubscriptionProvisioningApi* | [**subscriptionProvisioningControllerRenewSubscription**](docs/Api/SubscriptionProvisioningApi.md#subscriptionprovisioningcontrollerrenewsubscription) | **POST** /api/provisioning/subscriptions/{id}/renew | Renew a subscription +*SubscriptionProvisioningApi* | [**subscriptionProvisioningControllerSetSiteForSubscription**](docs/Api/SubscriptionProvisioningApi.md#subscriptionprovisioningcontrollersetsiteforsubscription) | **POST** /api/provisioning/subscriptions/{id}/set-site | Link a subscription to a site +*WorkerApi* | [**queueControllerAddJob**](docs/Api/WorkerApi.md#queuecontrolleraddjob) | **POST** /api/Worker/job | +*WorkerApi* | [**queueControllerGetJob**](docs/Api/WorkerApi.md#queuecontrollergetjob) | **GET** /api/Worker/job/{id} | +*WorkerApi* | [**queueControllerGetRecurringJobs**](docs/Api/WorkerApi.md#queuecontrollergetrecurringjobs) | **GET** /api/Worker/getRecurringJobs | +*WorkerApi* | [**queueControllerGetRecurringJobsInfo**](docs/Api/WorkerApi.md#queuecontrollergetrecurringjobsinfo) | **GET** /api/Worker/getRecurringJobs/{name} | +*WorkerApi* | [**queueControllerGetScheduledJobs**](docs/Api/WorkerApi.md#queuecontrollergetscheduledjobs) | **GET** /api/Worker/getScheduledJobs/{name} | +*WorkerApi* | [**queueControllerRemoveJob**](docs/Api/WorkerApi.md#queuecontrollerremovejob) | **DELETE** /api/Worker/job/{id} | ## Documentation For Models @@ -210,10 +298,13 @@ Class | Method | HTTP request | Description - [ActivateAccountDto](docs/Model/ActivateAccountDto.md) - [AddJobDto](docs/Model/AddJobDto.md) - [AddSubscriptionDto](docs/Model/AddSubscriptionDto.md) + - [Admission](docs/Model/Admission.md) - [AutoRenewalCountResponseDto](docs/Model/AutoRenewalCountResponseDto.md) - [BillingDto](docs/Model/BillingDto.md) - [Blacklist](docs/Model/Blacklist.md) - [BulkInviteDto](docs/Model/BulkInviteDto.md) + - [BulkSendEmailDto](docs/Model/BulkSendEmailDto.md) + - [CancelProvisionedSubscriptionDto](docs/Model/CancelProvisionedSubscriptionDto.md) - [CancelSubscriptionBodyDto](docs/Model/CancelSubscriptionBodyDto.md) - [ChangePasswordDto](docs/Model/ChangePasswordDto.md) - [ComposerToken](docs/Model/ComposerToken.md) @@ -224,16 +315,20 @@ Class | Method | HTTP request | Description - [CourseEnrollmentFromAcademyDto](docs/Model/CourseEnrollmentFromAcademyDto.md) - [CreateBlacklistSiteDto](docs/Model/CreateBlacklistSiteDto.md) - [CreateCustomerNoteDto](docs/Model/CreateCustomerNoteDto.md) + - [CreateDto](docs/Model/CreateDto.md) + - [CreateProvisionedSubscriptionDto](docs/Model/CreateProvisionedSubscriptionDto.md) - [CreateSiteBodyDto](docs/Model/CreateSiteBodyDto.md) - [Customer](docs/Model/Customer.md) - [CustomerData](docs/Model/CustomerData.md) - [CustomerDto](docs/Model/CustomerDto.md) - [CustomerFromWooDto](docs/Model/CustomerFromWooDto.md) - [CustomerNote](docs/Model/CustomerNote.md) + - [DeleteResult](docs/Model/DeleteResult.md) - [EddDTO](docs/Model/EddDTO.md) - [ExtraCourseDataDto](docs/Model/ExtraCourseDataDto.md) - [ExtraOrderData](docs/Model/ExtraOrderData.md) - [ExtraProductData](docs/Model/ExtraProductData.md) + - [FeeLineDto](docs/Model/FeeLineDto.md) - [FromAcademyDto](docs/Model/FromAcademyDto.md) - [GenerateDto](docs/Model/GenerateDto.md) - [HelpScoutDto](docs/Model/HelpScoutDto.md) @@ -262,28 +357,33 @@ Class | Method | HTTP request | Description - [ProductGroupTerm](docs/Model/ProductGroupTerm.md) - [ProductImage](docs/Model/ProductImage.md) - [ProgressData](docs/Model/ProgressData.md) + - [ProvisionerData](docs/Model/ProvisionerData.md) - [PurgeKVRequestDto](docs/Model/PurgeKVRequestDto.md) - [Refund](docs/Model/Refund.md) - [RefundDataDto](docs/Model/RefundDataDto.md) - [RenameBodyDto](docs/Model/RenameBodyDto.md) - [ResetPasswordDto](docs/Model/ResetPasswordDto.md) + - [Role](docs/Model/Role.md) - [RoleIDDto](docs/Model/RoleIDDto.md) - [SendResetPasswordEmailDto](docs/Model/SendResetPasswordEmailDto.md) - [SetExpiryDateDto](docs/Model/SetExpiryDateDto.md) + - [SetProvisionedSiteDto](docs/Model/SetProvisionedSiteDto.md) - [ShippingDto](docs/Model/ShippingDto.md) - [SignupAccountDto](docs/Model/SignupAccountDto.md) - [Site](docs/Model/Site.md) - [SubscribeByEmailBodyDto](docs/Model/SubscribeByEmailBodyDto.md) - [Subscription](docs/Model/Subscription.md) + - [SubscriptionProvisioningResponseDto](docs/Model/SubscriptionProvisioningResponseDto.md) - [SwitchSubscriptionNumberOfTimesDto](docs/Model/SwitchSubscriptionNumberOfTimesDto.md) - [TaxLineItem](docs/Model/TaxLineItem.md) - - [TicketDTO](docs/Model/TicketDTO.md) + - [TicketDto](docs/Model/TicketDto.md) - [Transaction](docs/Model/Transaction.md) - [TransactionDataDto](docs/Model/TransactionDataDto.md) - [TransferDto](docs/Model/TransferDto.md) - [TransferOwnershipDto](docs/Model/TransferOwnershipDto.md) - [TransferSiteDto](docs/Model/TransferSiteDto.md) - [UpdateAllKVRequestDto](docs/Model/UpdateAllKVRequestDto.md) + - [UpdateDto](docs/Model/UpdateDto.md) - [UpdateFileDto](docs/Model/UpdateFileDto.md) - [UpdateSiteDto](docs/Model/UpdateSiteDto.md) - [UpdateUserDto](docs/Model/UpdateUserDto.md) @@ -291,19 +391,19 @@ Class | Method | HTTP request | Description - [UserDto](docs/Model/UserDto.md) - [UserIdentity](docs/Model/UserIdentity.md) - ## Documentation For Authorization +## basic + +- **Type**: HTTP basic authentication + ## bearer -- **Type**: API key -- **API key parameter name**: access_token -- **Location**: URL query string +- **Type**: HTTP bearer authentication ## Author - diff --git a/composer.json b/composer.json index 973c64f..3157452 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ "require-dev": { "phpunit/phpunit": "^4.8", "squizlabs/php_codesniffer": "~2.6", - "friendsofphp/php-cs-fixer": "~2.12" + "friendsofphp/php-cs-fixer": "~1.12" }, "autoload": { "psr-4": { "Yoast\\MyYoastApiClient\\" : "src/" } diff --git a/docs/Api/AdmissionApi.md b/docs/Api/AdmissionApi.md new file mode 100644 index 0000000..53e82bd --- /dev/null +++ b/docs/Api/AdmissionApi.md @@ -0,0 +1,283 @@ +# Yoast\MyYoastApiClient\AdmissionApi + +All URIs are relative to */* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**admissionControllerChangeStudent**](AdmissionApi.md#admissioncontrollerchangestudent) | **PUT** /api/Admissions/{id} | Update an admission +[**admissionControllerGetMany**](AdmissionApi.md#admissioncontrollergetmany) | **GET** /api/Admissions | Get admissions +[**admissionControllerGetManyPaged**](AdmissionApi.md#admissioncontrollergetmanypaged) | **GET** /api/Admissions/paged | Get admissions +[**admissionControllerGetOne**](AdmissionApi.md#admissioncontrollergetone) | **GET** /api/Admissions/{id} | Get an admission +[**admissionControllerInvite**](AdmissionApi.md#admissioncontrollerinvite) | **POST** /api/Admissions | Invite a customer + +# **admissionControllerChangeStudent** +> \Yoast\MyYoastApiClient\Model\Admission admissionControllerChangeStudent($body, $id) + +Update an admission + +Changes the student for a certain admission + +### Example +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Yoast\MyYoastApiClient\Api\AdmissionApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$body = new \Yoast\MyYoastApiClient\Model\UpdateDto(); // \Yoast\MyYoastApiClient\Model\UpdateDto | +$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | + +try { + $result = $apiInstance->admissionControllerChangeStudent($body, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AdmissionApi->admissionControllerChangeStudent: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**\Yoast\MyYoastApiClient\Model\UpdateDto**](../Model/UpdateDto.md)| | + **id** | [**string**](../Model/.md)| | + +### Return type + +[**\Yoast\MyYoastApiClient\Model\Admission**](../Model/Admission.md) + +### Authorization + +[bearer](../../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **admissionControllerGetMany** +> \Yoast\MyYoastApiClient\Model\Admission[] admissionControllerGetMany($filter) + +Get admissions + +Get and filter admissions + +### Example +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Yoast\MyYoastApiClient\Api\AdmissionApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$filter = new \stdClass; // object | Used for filtering/joining the results. + +try { + $result = $apiInstance->admissionControllerGetMany($filter); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AdmissionApi->admissionControllerGetMany: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **filter** | [**object**](../Model/.md)| Used for filtering/joining the results. | [optional] + +### Return type + +[**\Yoast\MyYoastApiClient\Model\Admission[]**](../Model/Admission.md) + +### Authorization + +[bearer](../../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **admissionControllerGetManyPaged** +> admissionControllerGetManyPaged($filter) + +Get admissions + +Get and filter admissions + +### Example +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Yoast\MyYoastApiClient\Api\AdmissionApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$filter = new \stdClass; // object | Used for filtering/joining the results. + +try { + $apiInstance->admissionControllerGetManyPaged($filter); +} catch (Exception $e) { + echo 'Exception when calling AdmissionApi->admissionControllerGetManyPaged: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **filter** | [**object**](../Model/.md)| Used for filtering/joining the results. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[bearer](../../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **admissionControllerGetOne** +> \Yoast\MyYoastApiClient\Model\Admission admissionControllerGetOne($id) + +Get an admission + +Get a single admission + +### Example +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Yoast\MyYoastApiClient\Api\AdmissionApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | + +try { + $result = $apiInstance->admissionControllerGetOne($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AdmissionApi->admissionControllerGetOne: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | [**string**](../Model/.md)| | + +### Return type + +[**\Yoast\MyYoastApiClient\Model\Admission**](../Model/Admission.md) + +### Authorization + +[bearer](../../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **admissionControllerInvite** +> \Yoast\MyYoastApiClient\Model\Admission admissionControllerInvite($body) + +Invite a customer + +Invites another customer by email to use this admission + +### Example +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Yoast\MyYoastApiClient\Api\AdmissionApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$body = new \Yoast\MyYoastApiClient\Model\CreateDto(); // \Yoast\MyYoastApiClient\Model\CreateDto | + +try { + $result = $apiInstance->admissionControllerInvite($body); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AdmissionApi->admissionControllerInvite: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**\Yoast\MyYoastApiClient\Model\CreateDto**](../Model/CreateDto.md)| | + +### Return type + +[**\Yoast\MyYoastApiClient\Model\Admission**](../Model/Admission.md) + +### Authorization + +[bearer](../../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/docs/Api/AuthApi.md b/docs/Api/AuthApi.md index d6e9e6a..fd26e2d 100644 --- a/docs/Api/AuthApi.md +++ b/docs/Api/AuthApi.md @@ -1,19 +1,18 @@ # Yoast\MyYoastApiClient\AuthApi -All URIs are relative to *http://my.yoast.test:3000* +All URIs are relative to */* Method | HTTP request | Description ------------- | ------------- | ------------- -[**apiCustomersLoginPost**](AuthApi.md#apiCustomersLoginPost) | **POST** /api/Customers/login | Log in a user on MyYoast. -[**apiCustomersLoginUserPost**](AuthApi.md#apiCustomersLoginUserPost) | **POST** /api/Customers/login-user | -[**apiCustomersLogoutUserPost**](AuthApi.md#apiCustomersLogoutUserPost) | **POST** /api/Customers/logout-user | Logout the user on Yoast.com. -[**authYoastCallbackGet**](AuthApi.md#authYoastCallbackGet) | **GET** /auth/yoast/callback | -[**authYoastGet**](AuthApi.md#authYoastGet) | **GET** /auth/yoast | -[**logoutGet**](AuthApi.md#logoutGet) | **GET** /logout | +[**loginControllerGenerateAccessToken**](AuthApi.md#logincontrollergenerateaccesstoken) | **POST** /api/Customers/login | Log in a user on MyYoast. +[**loginControllerLoginUser**](AuthApi.md#logincontrollerloginuser) | **POST** /api/Customers/login-user | +[**loginControllerLogoutUser**](AuthApi.md#logincontrollerlogoutuser) | **POST** /api/Customers/logout-user | Logout the user on Yoast.com. +[**loginControllerRemoveAccessToken**](AuthApi.md#logincontrollerremoveaccesstoken) | **GET** /logout | +[**yoastComOpenIdControllerYoastComCallback**](AuthApi.md#yoastcomopenidcontrolleryoastcomcallback) | **GET** /auth/yoast/callback | +[**yoastComOpenIdControllerYoastComLogin**](AuthApi.md#yoastcomopenidcontrolleryoastcomlogin) | **GET** /auth/yoast | - -# **apiCustomersLoginPost** -> \Yoast\MyYoastApiClient\Model\AccessToken apiCustomersLoginPost($loginDto) +# **loginControllerGenerateAccessToken** +> \Yoast\MyYoastApiClient\Model\AccessToken loginControllerGenerateAccessToken($body) Log in a user on MyYoast. @@ -29,13 +28,13 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\AuthApi( // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); -$loginDto = new \Yoast\MyYoastApiClient\Model\LoginDto(); // \Yoast\MyYoastApiClient\Model\LoginDto | +$body = new \Yoast\MyYoastApiClient\Model\LoginDto(); // \Yoast\MyYoastApiClient\Model\LoginDto | try { - $result = $apiInstance->apiCustomersLoginPost($loginDto); + $result = $apiInstance->loginControllerGenerateAccessToken($body); print_r($result); } catch (Exception $e) { - echo 'Exception when calling AuthApi->apiCustomersLoginPost: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling AuthApi->loginControllerGenerateAccessToken: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -44,7 +43,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **loginDto** | [**\Yoast\MyYoastApiClient\Model\LoginDto**](../Model/LoginDto.md)| | + **body** | [**\Yoast\MyYoastApiClient\Model\LoginDto**](../Model/LoginDto.md)| | ### Return type @@ -61,8 +60,8 @@ No authorization required [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCustomersLoginUserPost** -> object apiCustomersLoginUserPost($loginUserDto) +# **loginControllerLoginUser** +> object loginControllerLoginUser($body) @@ -76,13 +75,13 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\AuthApi( // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); -$loginUserDto = new \Yoast\MyYoastApiClient\Model\LoginUserDto(); // \Yoast\MyYoastApiClient\Model\LoginUserDto | +$body = new \Yoast\MyYoastApiClient\Model\LoginUserDto(); // \Yoast\MyYoastApiClient\Model\LoginUserDto | try { - $result = $apiInstance->apiCustomersLoginUserPost($loginUserDto); + $result = $apiInstance->loginControllerLoginUser($body); print_r($result); } catch (Exception $e) { - echo 'Exception when calling AuthApi->apiCustomersLoginUserPost: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling AuthApi->loginControllerLoginUser: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -91,7 +90,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **loginUserDto** | [**\Yoast\MyYoastApiClient\Model\LoginUserDto**](../Model/LoginUserDto.md)| | + **body** | [**\Yoast\MyYoastApiClient\Model\LoginUserDto**](../Model/LoginUserDto.md)| | ### Return type @@ -108,8 +107,8 @@ No authorization required [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCustomersLogoutUserPost** -> object apiCustomersLogoutUserPost($logoutUserBodyDto) +# **loginControllerLogoutUser** +> object loginControllerLogoutUser($body) Logout the user on Yoast.com. @@ -123,13 +122,13 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\AuthApi( // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); -$logoutUserBodyDto = new \Yoast\MyYoastApiClient\Model\LogoutUserBodyDto(); // \Yoast\MyYoastApiClient\Model\LogoutUserBodyDto | +$body = new \Yoast\MyYoastApiClient\Model\LogoutUserBodyDto(); // \Yoast\MyYoastApiClient\Model\LogoutUserBodyDto | try { - $result = $apiInstance->apiCustomersLogoutUserPost($logoutUserBodyDto); + $result = $apiInstance->loginControllerLogoutUser($body); print_r($result); } catch (Exception $e) { - echo 'Exception when calling AuthApi->apiCustomersLogoutUserPost: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling AuthApi->loginControllerLogoutUser: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -138,7 +137,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **logoutUserBodyDto** | [**\Yoast\MyYoastApiClient\Model\LogoutUserBodyDto**](../Model/LogoutUserBodyDto.md)| | + **body** | [**\Yoast\MyYoastApiClient\Model\LogoutUserBodyDto**](../Model/LogoutUserBodyDto.md)| | ### Return type @@ -155,8 +154,8 @@ No authorization required [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **authYoastCallbackGet** -> authYoastCallbackGet() +# **loginControllerRemoveAccessToken** +> object loginControllerRemoveAccessToken() @@ -164,17 +163,23 @@ No authorization required ```php setAccessToken('YOUR_ACCESS_TOKEN'); + $apiInstance = new Yoast\MyYoastApiClient\Api\AuthApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client() + new GuzzleHttp\Client(), + $config ); try { - $apiInstance->authYoastCallbackGet(); + $result = $apiInstance->loginControllerRemoveAccessToken(); + print_r($result); } catch (Exception $e) { - echo 'Exception when calling AuthApi->authYoastCallbackGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling AuthApi->loginControllerRemoveAccessToken: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -184,21 +189,21 @@ This endpoint does not need any parameter. ### Return type -void (empty response body) +**object** ### Authorization -No authorization required +[bearer](../../README.md#bearer) ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **authYoastGet** -> authYoastGet() +# **yoastComOpenIdControllerYoastComCallback** +> yoastComOpenIdControllerYoastComCallback() @@ -214,9 +219,9 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\AuthApi( ); try { - $apiInstance->authYoastGet(); + $apiInstance->yoastComOpenIdControllerYoastComCallback(); } catch (Exception $e) { - echo 'Exception when calling AuthApi->authYoastGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling AuthApi->yoastComOpenIdControllerYoastComCallback: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -234,13 +239,13 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json + - **Content-Type**: Not defined + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **logoutGet** -> logoutGet() +# **yoastComOpenIdControllerYoastComLogin** +> yoastComOpenIdControllerYoastComLogin() @@ -249,22 +254,16 @@ No authorization required setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); - $apiInstance = new Yoast\MyYoastApiClient\Api\AuthApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config + new GuzzleHttp\Client() ); try { - $apiInstance->logoutGet(); + $apiInstance->yoastComOpenIdControllerYoastComLogin(); } catch (Exception $e) { - echo 'Exception when calling AuthApi->logoutGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling AuthApi->yoastComOpenIdControllerYoastComLogin: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -278,12 +277,12 @@ void (empty response body) ### Authorization -[bearer](../../README.md#bearer) +No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json + - **Content-Type**: Not defined + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) diff --git a/docs/Api/BlacklistApi.md b/docs/Api/BlacklistApi.md index a34d117..3990f22 100644 --- a/docs/Api/BlacklistApi.md +++ b/docs/Api/BlacklistApi.md @@ -1,30 +1,29 @@ # Yoast\MyYoastApiClient\BlacklistApi -All URIs are relative to *http://my.yoast.test:3000* +All URIs are relative to */* Method | HTTP request | Description ------------- | ------------- | ------------- -[**apiBlacklistGet**](BlacklistApi.md#apiBlacklistGet) | **GET** /api/Blacklist | Gets blacklisted sites -[**apiBlacklistIdDelete**](BlacklistApi.md#apiBlacklistIdDelete) | **DELETE** /api/Blacklist/{id} | Remove a site from the blacklist -[**apiBlacklistPost**](BlacklistApi.md#apiBlacklistPost) | **POST** /api/Blacklist | Creates a blacklisted site +[**blacklistControllerCreateOne**](BlacklistApi.md#blacklistcontrollercreateone) | **POST** /api/Blacklist | Creates a blacklisted site +[**blacklistControllerDeleteOne**](BlacklistApi.md#blacklistcontrollerdeleteone) | **DELETE** /api/Blacklist/{id} | Remove a site from the blacklist +[**blacklistControllerGetMany**](BlacklistApi.md#blacklistcontrollergetmany) | **GET** /api/Blacklist | Gets blacklisted sites +[**blacklistControllerGetManyPaged**](BlacklistApi.md#blacklistcontrollergetmanypaged) | **GET** /api/Blacklist/paged | Gets blacklisted sites +# **blacklistControllerCreateOne** +> \Yoast\MyYoastApiClient\Model\Blacklist blacklistControllerCreateOne($body) -# **apiBlacklistGet** -> \Yoast\MyYoastApiClient\Model\Blacklist[] apiBlacklistGet($filter) - -Gets blacklisted sites +Creates a blacklisted site -Get and filter blacklisted sites +Creates a single site ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\BlacklistApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -32,13 +31,13 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\BlacklistApi( new GuzzleHttp\Client(), $config ); -$filter = array('key' => "filter_example"); // map[string,string] | Used for filtering/joining the results. +$body = new \Yoast\MyYoastApiClient\Model\CreateBlacklistSiteDto(); // \Yoast\MyYoastApiClient\Model\CreateBlacklistSiteDto | try { - $result = $apiInstance->apiBlacklistGet($filter); + $result = $apiInstance->blacklistControllerCreateOne($body); print_r($result); } catch (Exception $e) { - echo 'Exception when calling BlacklistApi->apiBlacklistGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling BlacklistApi->blacklistControllerCreateOne: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -47,11 +46,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **filter** | [**map[string,string]**](../Model/string.md)| Used for filtering/joining the results. | [optional] + **body** | [**\Yoast\MyYoastApiClient\Model\CreateBlacklistSiteDto**](../Model/CreateBlacklistSiteDto.md)| | ### Return type -[**\Yoast\MyYoastApiClient\Model\Blacklist[]**](../Model/Blacklist.md) +[**\Yoast\MyYoastApiClient\Model\Blacklist**](../Model/Blacklist.md) ### Authorization @@ -64,8 +63,8 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiBlacklistIdDelete** -> string apiBlacklistIdDelete($id) +# **blacklistControllerDeleteOne** +> \Yoast\MyYoastApiClient\Model\DeleteResult blacklistControllerDeleteOne($id) Remove a site from the blacklist @@ -75,11 +74,10 @@ Deletes a single blacklisted site ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\BlacklistApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -87,13 +85,13 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\BlacklistApi( new GuzzleHttp\Client(), $config ); -$id = "id_example"; // string | +$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | try { - $result = $apiInstance->apiBlacklistIdDelete($id); + $result = $apiInstance->blacklistControllerDeleteOne($id); print_r($result); } catch (Exception $e) { - echo 'Exception when calling BlacklistApi->apiBlacklistIdDelete: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling BlacklistApi->blacklistControllerDeleteOne: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -106,7 +104,7 @@ Name | Type | Description | Notes ### Return type -**string** +[**\Yoast\MyYoastApiClient\Model\DeleteResult**](../Model/DeleteResult.md) ### Authorization @@ -114,27 +112,26 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiBlacklistPost** -> string apiBlacklistPost($createBlacklistSiteDto) +# **blacklistControllerGetMany** +> \Yoast\MyYoastApiClient\Model\Blacklist[] blacklistControllerGetMany($filter) -Creates a blacklisted site +Gets blacklisted sites -Creates a single site +Get and filter blacklisted sites ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\BlacklistApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -142,13 +139,13 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\BlacklistApi( new GuzzleHttp\Client(), $config ); -$createBlacklistSiteDto = new \Yoast\MyYoastApiClient\Model\CreateBlacklistSiteDto(); // \Yoast\MyYoastApiClient\Model\CreateBlacklistSiteDto | +$filter = new \stdClass; // object | Used for filtering/joining the results. try { - $result = $apiInstance->apiBlacklistPost($createBlacklistSiteDto); + $result = $apiInstance->blacklistControllerGetMany($filter); print_r($result); } catch (Exception $e) { - echo 'Exception when calling BlacklistApi->apiBlacklistPost: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling BlacklistApi->blacklistControllerGetMany: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -157,11 +154,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **createBlacklistSiteDto** | [**\Yoast\MyYoastApiClient\Model\CreateBlacklistSiteDto**](../Model/CreateBlacklistSiteDto.md)| | + **filter** | [**object**](../Model/.md)| Used for filtering/joining the results. | [optional] ### Return type -**string** +[**\Yoast\MyYoastApiClient\Model\Blacklist[]**](../Model/Blacklist.md) ### Authorization @@ -169,7 +166,61 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **blacklistControllerGetManyPaged** +> \Yoast\MyYoastApiClient\Model\Blacklist[] blacklistControllerGetManyPaged($filter) + +Gets blacklisted sites + +Get and filter blacklisted sites + +### Example +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Yoast\MyYoastApiClient\Api\BlacklistApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$filter = new \stdClass; // object | Used for filtering/joining the results. + +try { + $result = $apiInstance->blacklistControllerGetManyPaged($filter); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling BlacklistApi->blacklistControllerGetManyPaged: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **filter** | [**object**](../Model/.md)| Used for filtering/joining the results. | [optional] + +### Return type + +[**\Yoast\MyYoastApiClient\Model\Blacklist[]**](../Model/Blacklist.md) + +### Authorization + +[bearer](../../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) diff --git a/docs/Api/CloudflareApi.md b/docs/Api/CloudflareApi.md index a47a7e3..f08e4df 100644 --- a/docs/Api/CloudflareApi.md +++ b/docs/Api/CloudflareApi.md @@ -1,15 +1,14 @@ # Yoast\MyYoastApiClient\CloudflareApi -All URIs are relative to *http://my.yoast.test:3000* +All URIs are relative to */* Method | HTTP request | Description ------------- | ------------- | ------------- -[**apiCloudflareKvRegisteredDomainsPurgePost**](CloudflareApi.md#apiCloudflareKvRegisteredDomainsPurgePost) | **POST** /api/cloudflare/kv/registered-domains/purge | Purge kv pairs from the registered domains key value store in Cloudflare -[**apiCloudflareKvRegisteredDomainsUpdateAllPost**](CloudflareApi.md#apiCloudflareKvRegisteredDomainsUpdateAllPost) | **POST** /api/cloudflare/kv/registered-domains/update-all | Update sites in the registered domains key value store in Cloudflare +[**cloudflareControllerPurgeKVStore**](CloudflareApi.md#cloudflarecontrollerpurgekvstore) | **POST** /api/cloudflare/kv/registered-domains/purge | Purge kv pairs from the registered domains key value store in Cloudflare +[**cloudflareControllerUpdateAll**](CloudflareApi.md#cloudflarecontrollerupdateall) | **POST** /api/cloudflare/kv/registered-domains/update-all | Update sites in the registered domains key value store in Cloudflare - -# **apiCloudflareKvRegisteredDomainsPurgePost** -> object[] apiCloudflareKvRegisteredDomainsPurgePost($purgeKVRequestDto) +# **cloudflareControllerPurgeKVStore** +> object[] cloudflareControllerPurgeKVStore($body) Purge kv pairs from the registered domains key value store in Cloudflare @@ -17,11 +16,10 @@ Purge kv pairs from the registered domains key value store in Cloudflare ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\CloudflareApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -29,13 +27,13 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\CloudflareApi( new GuzzleHttp\Client(), $config ); -$purgeKVRequestDto = new \Yoast\MyYoastApiClient\Model\PurgeKVRequestDto(); // \Yoast\MyYoastApiClient\Model\PurgeKVRequestDto | +$body = new \Yoast\MyYoastApiClient\Model\PurgeKVRequestDto(); // \Yoast\MyYoastApiClient\Model\PurgeKVRequestDto | try { - $result = $apiInstance->apiCloudflareKvRegisteredDomainsPurgePost($purgeKVRequestDto); + $result = $apiInstance->cloudflareControllerPurgeKVStore($body); print_r($result); } catch (Exception $e) { - echo 'Exception when calling CloudflareApi->apiCloudflareKvRegisteredDomainsPurgePost: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CloudflareApi->cloudflareControllerPurgeKVStore: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -44,7 +42,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **purgeKVRequestDto** | [**\Yoast\MyYoastApiClient\Model\PurgeKVRequestDto**](../Model/PurgeKVRequestDto.md)| | + **body** | [**\Yoast\MyYoastApiClient\Model\PurgeKVRequestDto**](../Model/PurgeKVRequestDto.md)| | ### Return type @@ -61,8 +59,8 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCloudflareKvRegisteredDomainsUpdateAllPost** -> object apiCloudflareKvRegisteredDomainsUpdateAllPost($updateAllKVRequestDto) +# **cloudflareControllerUpdateAll** +> object cloudflareControllerUpdateAll($body) Update sites in the registered domains key value store in Cloudflare @@ -70,11 +68,10 @@ Update sites in the registered domains key value store in Cloudflare ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\CloudflareApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -82,13 +79,13 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\CloudflareApi( new GuzzleHttp\Client(), $config ); -$updateAllKVRequestDto = new \Yoast\MyYoastApiClient\Model\UpdateAllKVRequestDto(); // \Yoast\MyYoastApiClient\Model\UpdateAllKVRequestDto | +$body = new \Yoast\MyYoastApiClient\Model\UpdateAllKVRequestDto(); // \Yoast\MyYoastApiClient\Model\UpdateAllKVRequestDto | try { - $result = $apiInstance->apiCloudflareKvRegisteredDomainsUpdateAllPost($updateAllKVRequestDto); + $result = $apiInstance->cloudflareControllerUpdateAll($body); print_r($result); } catch (Exception $e) { - echo 'Exception when calling CloudflareApi->apiCloudflareKvRegisteredDomainsUpdateAllPost: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CloudflareApi->cloudflareControllerUpdateAll: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -97,7 +94,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **updateAllKVRequestDto** | [**\Yoast\MyYoastApiClient\Model\UpdateAllKVRequestDto**](../Model/UpdateAllKVRequestDto.md)| | + **body** | [**\Yoast\MyYoastApiClient\Model\UpdateAllKVRequestDto**](../Model/UpdateAllKVRequestDto.md)| | ### Return type diff --git a/docs/Api/ComposerTokenApi.md b/docs/Api/ComposerTokenApi.md index b50de26..5fd5cf7 100644 --- a/docs/Api/ComposerTokenApi.md +++ b/docs/Api/ComposerTokenApi.md @@ -1,30 +1,28 @@ # Yoast\MyYoastApiClient\ComposerTokenApi -All URIs are relative to *http://my.yoast.test:3000* +All URIs are relative to */* Method | HTTP request | Description ------------- | ------------- | ------------- -[**apiComposerTokensGeneratePost**](ComposerTokenApi.md#apiComposerTokensGeneratePost) | **POST** /api/ComposerTokens/generate | Generates a Composer token -[**apiComposerTokensIdDeletePost**](ComposerTokenApi.md#apiComposerTokensIdDeletePost) | **POST** /api/ComposerTokens/{id}/delete | Disable a composer token -[**apiComposerTokensIdRenamePost**](ComposerTokenApi.md#apiComposerTokensIdRenamePost) | **POST** /api/ComposerTokens/{id}/rename | Renames a Composer token +[**composerTokenControllerDisable**](ComposerTokenApi.md#composertokencontrollerdisable) | **POST** /api/ComposerTokens/{id}/delete | Disable a composer token +[**composerTokenControllerGenerate**](ComposerTokenApi.md#composertokencontrollergenerate) | **POST** /api/ComposerTokens/generate | Generates a Composer token +[**composerTokenControllerRename**](ComposerTokenApi.md#composertokencontrollerrename) | **POST** /api/ComposerTokens/{id}/rename | Renames a Composer token +# **composerTokenControllerDisable** +> \Yoast\MyYoastApiClient\Model\ComposerToken composerTokenControllerDisable($id) -# **apiComposerTokensGeneratePost** -> \Yoast\MyYoastApiClient\Model\ComposerToken apiComposerTokensGeneratePost($generateDto) - -Generates a Composer token +Disable a composer token -Generates a personal token for the logged in customer that can be used to download our plugins with Composer. +Renders a single composer token unusable ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\ComposerTokenApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -32,13 +30,13 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\ComposerTokenApi( new GuzzleHttp\Client(), $config ); -$generateDto = new \Yoast\MyYoastApiClient\Model\GenerateDto(); // \Yoast\MyYoastApiClient\Model\GenerateDto | +$id = "id_example"; // string | try { - $result = $apiInstance->apiComposerTokensGeneratePost($generateDto); + $result = $apiInstance->composerTokenControllerDisable($id); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ComposerTokenApi->apiComposerTokensGeneratePost: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ComposerTokenApi->composerTokenControllerDisable: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -47,7 +45,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **generateDto** | [**\Yoast\MyYoastApiClient\Model\GenerateDto**](../Model/GenerateDto.md)| | + **id** | **string**| | ### Return type @@ -59,27 +57,26 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiComposerTokensIdDeletePost** -> \Yoast\MyYoastApiClient\Model\ComposerToken apiComposerTokensIdDeletePost($id) +# **composerTokenControllerGenerate** +> \Yoast\MyYoastApiClient\Model\ComposerToken composerTokenControllerGenerate($body) -Disable a composer token +Generates a Composer token -Renders a single composer token unusable +Generates a personal token for the logged in customer that can be used to download our plugins with Composer. ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\ComposerTokenApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -87,13 +84,13 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\ComposerTokenApi( new GuzzleHttp\Client(), $config ); -$id = "id_example"; // string | +$body = new \Yoast\MyYoastApiClient\Model\GenerateDto(); // \Yoast\MyYoastApiClient\Model\GenerateDto | try { - $result = $apiInstance->apiComposerTokensIdDeletePost($id); + $result = $apiInstance->composerTokenControllerGenerate($body); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ComposerTokenApi->apiComposerTokensIdDeletePost: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ComposerTokenApi->composerTokenControllerGenerate: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -102,7 +99,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **string**| | + **body** | [**\Yoast\MyYoastApiClient\Model\GenerateDto**](../Model/GenerateDto.md)| | ### Return type @@ -119,8 +116,8 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiComposerTokensIdRenamePost** -> \Yoast\MyYoastApiClient\Model\ComposerToken apiComposerTokensIdRenamePost($renameBodyDto, $id) +# **composerTokenControllerRename** +> \Yoast\MyYoastApiClient\Model\ComposerToken composerTokenControllerRename($body, $id) Renames a Composer token @@ -130,11 +127,10 @@ Changes the name of a Composer token ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\ComposerTokenApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -142,14 +138,14 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\ComposerTokenApi( new GuzzleHttp\Client(), $config ); -$renameBodyDto = new \Yoast\MyYoastApiClient\Model\RenameBodyDto(); // \Yoast\MyYoastApiClient\Model\RenameBodyDto | +$body = new \Yoast\MyYoastApiClient\Model\RenameBodyDto(); // \Yoast\MyYoastApiClient\Model\RenameBodyDto | $id = "id_example"; // string | try { - $result = $apiInstance->apiComposerTokensIdRenamePost($renameBodyDto, $id); + $result = $apiInstance->composerTokenControllerRename($body, $id); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ComposerTokenApi->apiComposerTokensIdRenamePost: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ComposerTokenApi->composerTokenControllerRename: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -158,7 +154,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **renameBodyDto** | [**\Yoast\MyYoastApiClient\Model\RenameBodyDto**](../Model/RenameBodyDto.md)| | + **body** | [**\Yoast\MyYoastApiClient\Model\RenameBodyDto**](../Model/RenameBodyDto.md)| | **id** | **string**| | ### Return type diff --git a/docs/Api/CourseApi.md b/docs/Api/CourseApi.md index eee040f..ab479a1 100644 --- a/docs/Api/CourseApi.md +++ b/docs/Api/CourseApi.md @@ -1,16 +1,15 @@ # Yoast\MyYoastApiClient\CourseApi -All URIs are relative to *http://my.yoast.test:3000* +All URIs are relative to */* Method | HTTP request | Description ------------- | ------------- | ------------- -[**apiCoursesFromAcademyPut**](CourseApi.md#apiCoursesFromAcademyPut) | **PUT** /api/Courses/fromAcademy | Upserts a course -[**apiCoursesGet**](CourseApi.md#apiCoursesGet) | **GET** /api/Courses | Get courses -[**apiCoursesIdGet**](CourseApi.md#apiCoursesIdGet) | **GET** /api/Courses/{id} | +[**courseControllerFromAcademy**](CourseApi.md#coursecontrollerfromacademy) | **PUT** /api/Courses/fromAcademy | Upserts a course +[**courseControllerGetMany**](CourseApi.md#coursecontrollergetmany) | **GET** /api/Courses | Get courses +[**courseControllerGetOne**](CourseApi.md#coursecontrollergetone) | **GET** /api/Courses/{id} | - -# **apiCoursesFromAcademyPut** -> \Yoast\MyYoastApiClient\Model\Course apiCoursesFromAcademyPut($fromAcademyDto) +# **courseControllerFromAcademy** +> \Yoast\MyYoastApiClient\Model\Course courseControllerFromAcademy($body) Upserts a course @@ -20,11 +19,10 @@ Updates a course, or creates it if it doesn't exist ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\CourseApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -32,13 +30,13 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\CourseApi( new GuzzleHttp\Client(), $config ); -$fromAcademyDto = new \Yoast\MyYoastApiClient\Model\FromAcademyDto(); // \Yoast\MyYoastApiClient\Model\FromAcademyDto | +$body = new \Yoast\MyYoastApiClient\Model\FromAcademyDto(); // \Yoast\MyYoastApiClient\Model\FromAcademyDto | try { - $result = $apiInstance->apiCoursesFromAcademyPut($fromAcademyDto); + $result = $apiInstance->courseControllerFromAcademy($body); print_r($result); } catch (Exception $e) { - echo 'Exception when calling CourseApi->apiCoursesFromAcademyPut: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CourseApi->courseControllerFromAcademy: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -47,7 +45,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **fromAcademyDto** | [**\Yoast\MyYoastApiClient\Model\FromAcademyDto**](../Model/FromAcademyDto.md)| | + **body** | [**\Yoast\MyYoastApiClient\Model\FromAcademyDto**](../Model/FromAcademyDto.md)| | ### Return type @@ -64,8 +62,8 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCoursesGet** -> \Yoast\MyYoastApiClient\Model\Course[] apiCoursesGet($filter) +# **courseControllerGetMany** +> \Yoast\MyYoastApiClient\Model\Course[] courseControllerGetMany($filter) Get courses @@ -75,11 +73,10 @@ Get and filter courses ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\CourseApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -87,13 +84,13 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\CourseApi( new GuzzleHttp\Client(), $config ); -$filter = array('key' => "filter_example"); // map[string,string] | Used for filtering/joining the results. +$filter = new \stdClass; // object | Used for filtering/joining the results. try { - $result = $apiInstance->apiCoursesGet($filter); + $result = $apiInstance->courseControllerGetMany($filter); print_r($result); } catch (Exception $e) { - echo 'Exception when calling CourseApi->apiCoursesGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CourseApi->courseControllerGetMany: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -102,7 +99,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **filter** | [**map[string,string]**](../Model/string.md)| Used for filtering/joining the results. | [optional] + **filter** | [**object**](../Model/.md)| Used for filtering/joining the results. | [optional] ### Return type @@ -114,13 +111,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCoursesIdGet** -> apiCoursesIdGet($id) +# **courseControllerGetOne** +> courseControllerGetOne($id) @@ -128,11 +125,10 @@ Name | Type | Description | Notes ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\CourseApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -140,12 +136,12 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\CourseApi( new GuzzleHttp\Client(), $config ); -$id = "id_example"; // string | +$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | try { - $apiInstance->apiCoursesIdGet($id); + $apiInstance->courseControllerGetOne($id); } catch (Exception $e) { - echo 'Exception when calling CourseApi->apiCoursesIdGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CourseApi->courseControllerGetOne: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -166,8 +162,8 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json + - **Content-Type**: Not defined + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) diff --git a/docs/Api/CourseEnrollmentApi.md b/docs/Api/CourseEnrollmentApi.md index f6e5ed5..d520bf9 100644 --- a/docs/Api/CourseEnrollmentApi.md +++ b/docs/Api/CourseEnrollmentApi.md @@ -1,20 +1,20 @@ # Yoast\MyYoastApiClient\CourseEnrollmentApi -All URIs are relative to *http://my.yoast.test:3000* +All URIs are relative to */* Method | HTTP request | Description ------------- | ------------- | ------------- -[**apiCourseEnrollmentsBulkInvitePost**](CourseEnrollmentApi.md#apiCourseEnrollmentsBulkInvitePost) | **POST** /api/CourseEnrollments/bulkInvite | Bulk invite for Course Enrollment. -[**apiCourseEnrollmentsFromAcademyPut**](CourseEnrollmentApi.md#apiCourseEnrollmentsFromAcademyPut) | **PUT** /api/CourseEnrollments/fromAcademy | Update a CourseEnrollment -[**apiCourseEnrollmentsGet**](CourseEnrollmentApi.md#apiCourseEnrollmentsGet) | **GET** /api/CourseEnrollments | Get course enrollments -[**apiCourseEnrollmentsGetLegacyExpiringGet**](CourseEnrollmentApi.md#apiCourseEnrollmentsGetLegacyExpiringGet) | **GET** /api/CourseEnrollments/getLegacyExpiring | Get legacy course enrollments that expire between two given dates -[**apiCourseEnrollmentsIdGet**](CourseEnrollmentApi.md#apiCourseEnrollmentsIdGet) | **GET** /api/CourseEnrollments/{id} | Get a course enrollment -[**apiCourseEnrollmentsIdInvitePost**](CourseEnrollmentApi.md#apiCourseEnrollmentsIdInvitePost) | **POST** /api/CourseEnrollments/{id}/invite | Invite a customer -[**apiCourseEnrollmentsTransferPost**](CourseEnrollmentApi.md#apiCourseEnrollmentsTransferPost) | **POST** /api/CourseEnrollments/transfer | Transfer course enrollments - - -# **apiCourseEnrollmentsBulkInvitePost** -> \Yoast\MyYoastApiClient\Model\CourseEnrollment[] apiCourseEnrollmentsBulkInvitePost($bulkInviteDto) +[**courseEnrollmentControllerBulkInvite**](CourseEnrollmentApi.md#courseenrollmentcontrollerbulkinvite) | **POST** /api/CourseEnrollments/bulkInvite | Bulk invite for Course Enrollment. +[**courseEnrollmentControllerFromAcademy**](CourseEnrollmentApi.md#courseenrollmentcontrollerfromacademy) | **PUT** /api/CourseEnrollments/fromAcademy | Update a CourseEnrollment +[**courseEnrollmentControllerGetLegacyExpiring**](CourseEnrollmentApi.md#courseenrollmentcontrollergetlegacyexpiring) | **GET** /api/CourseEnrollments/getLegacyExpiring | Get legacy course enrollments that expire between two given dates +[**courseEnrollmentControllerGetMany**](CourseEnrollmentApi.md#courseenrollmentcontrollergetmany) | **GET** /api/CourseEnrollments | Get course enrollments +[**courseEnrollmentControllerGetManyPaged**](CourseEnrollmentApi.md#courseenrollmentcontrollergetmanypaged) | **GET** /api/CourseEnrollments/paged | Get customers +[**courseEnrollmentControllerGetOne**](CourseEnrollmentApi.md#courseenrollmentcontrollergetone) | **GET** /api/CourseEnrollments/{id} | Get a course enrollment +[**courseEnrollmentControllerInvite**](CourseEnrollmentApi.md#courseenrollmentcontrollerinvite) | **POST** /api/CourseEnrollments/{id}/invite | Invite a customer +[**courseEnrollmentControllerTransfer**](CourseEnrollmentApi.md#courseenrollmentcontrollertransfer) | **POST** /api/CourseEnrollments/transfer | Transfer course enrollments + +# **courseEnrollmentControllerBulkInvite** +> \Yoast\MyYoastApiClient\Model\CourseEnrollment[] courseEnrollmentControllerBulkInvite($body) Bulk invite for Course Enrollment. @@ -24,11 +24,10 @@ Bulk invites another Customer by email to use this Course Enrollment. ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\CourseEnrollmentApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -36,13 +35,13 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\CourseEnrollmentApi( new GuzzleHttp\Client(), $config ); -$bulkInviteDto = new \Yoast\MyYoastApiClient\Model\BulkInviteDto(); // \Yoast\MyYoastApiClient\Model\BulkInviteDto | +$body = new \Yoast\MyYoastApiClient\Model\BulkInviteDto(); // \Yoast\MyYoastApiClient\Model\BulkInviteDto | try { - $result = $apiInstance->apiCourseEnrollmentsBulkInvitePost($bulkInviteDto); + $result = $apiInstance->courseEnrollmentControllerBulkInvite($body); print_r($result); } catch (Exception $e) { - echo 'Exception when calling CourseEnrollmentApi->apiCourseEnrollmentsBulkInvitePost: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CourseEnrollmentApi->courseEnrollmentControllerBulkInvite: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -51,7 +50,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **bulkInviteDto** | [**\Yoast\MyYoastApiClient\Model\BulkInviteDto**](../Model/BulkInviteDto.md)| | + **body** | [**\Yoast\MyYoastApiClient\Model\BulkInviteDto**](../Model/BulkInviteDto.md)| | ### Return type @@ -68,8 +67,8 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCourseEnrollmentsFromAcademyPut** -> apiCourseEnrollmentsFromAcademyPut($courseEnrollmentFromAcademyDto) +# **courseEnrollmentControllerFromAcademy** +> courseEnrollmentControllerFromAcademy($body) Update a CourseEnrollment @@ -79,11 +78,10 @@ Updates the progress for a certain course and student with data from academy.yoa ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\CourseEnrollmentApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -91,12 +89,12 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\CourseEnrollmentApi( new GuzzleHttp\Client(), $config ); -$courseEnrollmentFromAcademyDto = new \Yoast\MyYoastApiClient\Model\CourseEnrollmentFromAcademyDto(); // \Yoast\MyYoastApiClient\Model\CourseEnrollmentFromAcademyDto | +$body = new \Yoast\MyYoastApiClient\Model\CourseEnrollmentFromAcademyDto(); // \Yoast\MyYoastApiClient\Model\CourseEnrollmentFromAcademyDto | try { - $apiInstance->apiCourseEnrollmentsFromAcademyPut($courseEnrollmentFromAcademyDto); + $apiInstance->courseEnrollmentControllerFromAcademy($body); } catch (Exception $e) { - echo 'Exception when calling CourseEnrollmentApi->apiCourseEnrollmentsFromAcademyPut: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CourseEnrollmentApi->courseEnrollmentControllerFromAcademy: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -105,7 +103,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **courseEnrollmentFromAcademyDto** | [**\Yoast\MyYoastApiClient\Model\CourseEnrollmentFromAcademyDto**](../Model/CourseEnrollmentFromAcademyDto.md)| | + **body** | [**\Yoast\MyYoastApiClient\Model\CourseEnrollmentFromAcademyDto**](../Model/CourseEnrollmentFromAcademyDto.md)| | ### Return type @@ -118,26 +116,25 @@ void (empty response body) ### HTTP request headers - **Content-Type**: application/json - - **Accept**: application/json + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCourseEnrollmentsGet** -> \Yoast\MyYoastApiClient\Model\CourseEnrollment[] apiCourseEnrollmentsGet($filter) +# **courseEnrollmentControllerGetLegacyExpiring** +> \Yoast\MyYoastApiClient\Model\CourseEnrollment[] courseEnrollmentControllerGetLegacyExpiring($from, $until) -Get course enrollments +Get legacy course enrollments that expire between two given dates -Get and filter course enrollments +Gets a list of legacy course enrollments that expire between two dates. A legacy enrollment is a course enrollment that does not belong to a subscription, but is instead created as a direct result of placing an order. ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\CourseEnrollmentApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -145,13 +142,14 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\CourseEnrollmentApi( new GuzzleHttp\Client(), $config ); -$filter = array('key' => "filter_example"); // map[string,string] | Used for filtering/joining the results. +$from = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | +$until = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | try { - $result = $apiInstance->apiCourseEnrollmentsGet($filter); + $result = $apiInstance->courseEnrollmentControllerGetLegacyExpiring($from, $until); print_r($result); } catch (Exception $e) { - echo 'Exception when calling CourseEnrollmentApi->apiCourseEnrollmentsGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CourseEnrollmentApi->courseEnrollmentControllerGetLegacyExpiring: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -160,7 +158,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **filter** | [**map[string,string]**](../Model/string.md)| Used for filtering/joining the results. | [optional] + **from** | **\DateTime**| | + **until** | **\DateTime**| | ### Return type @@ -172,27 +171,26 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCourseEnrollmentsGetLegacyExpiringGet** -> \Yoast\MyYoastApiClient\Model\CourseEnrollment[] apiCourseEnrollmentsGetLegacyExpiringGet($from, $until) +# **courseEnrollmentControllerGetMany** +> \Yoast\MyYoastApiClient\Model\CourseEnrollment[] courseEnrollmentControllerGetMany($filter) -Get legacy course enrollments that expire between two given dates +Get course enrollments -Gets a list of legacy course enrollments that expire between two dates. A legacy enrollment is a course enrollment that does not belong to a subscription, but is instead created as a direct result of placing an order. +Get and filter course enrollments ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\CourseEnrollmentApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -200,14 +198,13 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\CourseEnrollmentApi( new GuzzleHttp\Client(), $config ); -$from = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | -$until = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | +$filter = new \stdClass; // object | Used for filtering/joining the results. try { - $result = $apiInstance->apiCourseEnrollmentsGetLegacyExpiringGet($from, $until); + $result = $apiInstance->courseEnrollmentControllerGetMany($filter); print_r($result); } catch (Exception $e) { - echo 'Exception when calling CourseEnrollmentApi->apiCourseEnrollmentsGetLegacyExpiringGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CourseEnrollmentApi->courseEnrollmentControllerGetMany: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -216,8 +213,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **from** | **\DateTime**| | - **until** | **\DateTime**| | + **filter** | [**object**](../Model/.md)| Used for filtering/joining the results. | [optional] ### Return type @@ -229,13 +225,66 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCourseEnrollmentsIdGet** -> \Yoast\MyYoastApiClient\Model\CourseEnrollment apiCourseEnrollmentsIdGet($id, $filter) +# **courseEnrollmentControllerGetManyPaged** +> courseEnrollmentControllerGetManyPaged($filter) + +Get customers + +Get and filter customer + +### Example +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Yoast\MyYoastApiClient\Api\CourseEnrollmentApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$filter = new \stdClass; // object | Used for filtering/joining the results. + +try { + $apiInstance->courseEnrollmentControllerGetManyPaged($filter); +} catch (Exception $e) { + echo 'Exception when calling CourseEnrollmentApi->courseEnrollmentControllerGetManyPaged: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **filter** | [**object**](../Model/.md)| Used for filtering/joining the results. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[bearer](../../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **courseEnrollmentControllerGetOne** +> \Yoast\MyYoastApiClient\Model\CourseEnrollment courseEnrollmentControllerGetOne($id, $filter) Get a course enrollment @@ -245,11 +294,10 @@ Get a single course enrollment ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\CourseEnrollmentApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -257,14 +305,14 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\CourseEnrollmentApi( new GuzzleHttp\Client(), $config ); -$id = "id_example"; // string | -$filter = array('key' => "filter_example"); // map[string,string] | Used for filtering/joining the results. +$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | +$filter = new \stdClass; // object | Used for filtering/joining the results. try { - $result = $apiInstance->apiCourseEnrollmentsIdGet($id, $filter); + $result = $apiInstance->courseEnrollmentControllerGetOne($id, $filter); print_r($result); } catch (Exception $e) { - echo 'Exception when calling CourseEnrollmentApi->apiCourseEnrollmentsIdGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CourseEnrollmentApi->courseEnrollmentControllerGetOne: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -274,7 +322,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | [**string**](../Model/.md)| | - **filter** | [**map[string,string]**](../Model/string.md)| Used for filtering/joining the results. | [optional] + **filter** | [**object**](../Model/.md)| Used for filtering/joining the results. | [optional] ### Return type @@ -286,13 +334,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCourseEnrollmentsIdInvitePost** -> \Yoast\MyYoastApiClient\Model\CourseEnrollment apiCourseEnrollmentsIdInvitePost($inviteDto, $id) +# **courseEnrollmentControllerInvite** +> \Yoast\MyYoastApiClient\Model\CourseEnrollment courseEnrollmentControllerInvite($body, $id) Invite a customer @@ -302,11 +350,10 @@ Invites another Customer by email to use this Course Enrollment ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\CourseEnrollmentApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -314,14 +361,14 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\CourseEnrollmentApi( new GuzzleHttp\Client(), $config ); -$inviteDto = new \Yoast\MyYoastApiClient\Model\InviteDto(); // \Yoast\MyYoastApiClient\Model\InviteDto | -$id = "id_example"; // string | +$body = new \Yoast\MyYoastApiClient\Model\InviteDto(); // \Yoast\MyYoastApiClient\Model\InviteDto | +$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | try { - $result = $apiInstance->apiCourseEnrollmentsIdInvitePost($inviteDto, $id); + $result = $apiInstance->courseEnrollmentControllerInvite($body, $id); print_r($result); } catch (Exception $e) { - echo 'Exception when calling CourseEnrollmentApi->apiCourseEnrollmentsIdInvitePost: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CourseEnrollmentApi->courseEnrollmentControllerInvite: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -330,7 +377,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **inviteDto** | [**\Yoast\MyYoastApiClient\Model\InviteDto**](../Model/InviteDto.md)| | + **body** | [**\Yoast\MyYoastApiClient\Model\InviteDto**](../Model/InviteDto.md)| | **id** | [**string**](../Model/.md)| | ### Return type @@ -348,8 +395,8 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCourseEnrollmentsTransferPost** -> \Yoast\MyYoastApiClient\Model\CourseEnrollment[] apiCourseEnrollmentsTransferPost($transferDto) +# **courseEnrollmentControllerTransfer** +> \Yoast\MyYoastApiClient\Model\CourseEnrollment[] courseEnrollmentControllerTransfer($body) Transfer course enrollments @@ -359,11 +406,10 @@ Transfers all Course Enrollments from one Customer to another. ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\CourseEnrollmentApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -371,13 +417,13 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\CourseEnrollmentApi( new GuzzleHttp\Client(), $config ); -$transferDto = new \Yoast\MyYoastApiClient\Model\TransferDto(); // \Yoast\MyYoastApiClient\Model\TransferDto | +$body = new \Yoast\MyYoastApiClient\Model\TransferDto(); // \Yoast\MyYoastApiClient\Model\TransferDto | try { - $result = $apiInstance->apiCourseEnrollmentsTransferPost($transferDto); + $result = $apiInstance->courseEnrollmentControllerTransfer($body); print_r($result); } catch (Exception $e) { - echo 'Exception when calling CourseEnrollmentApi->apiCourseEnrollmentsTransferPost: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CourseEnrollmentApi->courseEnrollmentControllerTransfer: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -386,7 +432,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **transferDto** | [**\Yoast\MyYoastApiClient\Model\TransferDto**](../Model/TransferDto.md)| | + **body** | [**\Yoast\MyYoastApiClient\Model\TransferDto**](../Model/TransferDto.md)| | ### Return type diff --git a/docs/Api/CustomerApi.md b/docs/Api/CustomerApi.md index 6e08075..de8a462 100644 --- a/docs/Api/CustomerApi.md +++ b/docs/Api/CustomerApi.md @@ -1,53 +1,101 @@ # Yoast\MyYoastApiClient\CustomerApi -All URIs are relative to *http://my.yoast.test:3000* +All URIs are relative to */* Method | HTTP request | Description ------------- | ------------- | ------------- -[**apiCustomersActivatePost**](CustomerApi.md#apiCustomersActivatePost) | **POST** /api/Customers/activate | Activate the account of a user -[**apiCustomersAllrolesGet**](CustomerApi.md#apiCustomersAllrolesGet) | **GET** /api/Customers/allroles | Get all existing roles with their ID. -[**apiCustomersCurrentGet**](CustomerApi.md#apiCustomersCurrentGet) | **GET** /api/Customers/current | Get the current customer -[**apiCustomersCustomerIdBuyerCourseEnrollmentsGet**](CustomerApi.md#apiCustomersCustomerIdBuyerCourseEnrollmentsGet) | **GET** /api/Customers/{customerId}/buyerCourseEnrollments | Find Course Enrollments that a customer is buyer of -[**apiCustomersCustomerIdComposerTokensGet**](CustomerApi.md#apiCustomersCustomerIdComposerTokensGet) | **GET** /api/Customers/{customerId}/composerTokens | Get composer tokens -[**apiCustomersCustomerIdComposerTokensIdGet**](CustomerApi.md#apiCustomersCustomerIdComposerTokensIdGet) | **GET** /api/Customers/{customerId}/composerTokens/{id} | Get a composer token -[**apiCustomersCustomerIdCourseEnrollmentsGet**](CustomerApi.md#apiCustomersCustomerIdCourseEnrollmentsGet) | **GET** /api/Customers/{customerId}/courseEnrollments | Find Course Enrollments -[**apiCustomersCustomerIdIdentitiesGet**](CustomerApi.md#apiCustomersCustomerIdIdentitiesGet) | **GET** /api/Customers/{customerId}/identities | Get user identities -[**apiCustomersCustomerIdNewsletterDelete**](CustomerApi.md#apiCustomersCustomerIdNewsletterDelete) | **DELETE** /api/Customers/{customerId}/newsletter | Unsubscribe from the newsletter -[**apiCustomersCustomerIdNewsletterGet**](CustomerApi.md#apiCustomersCustomerIdNewsletterGet) | **GET** /api/Customers/{customerId}/newsletter | Newsletter subscription status -[**apiCustomersCustomerIdNewsletterPost**](CustomerApi.md#apiCustomersCustomerIdNewsletterPost) | **POST** /api/Customers/{customerId}/newsletter | Subscribe to the newsletter -[**apiCustomersCustomerIdOrdersGet**](CustomerApi.md#apiCustomersCustomerIdOrdersGet) | **GET** /api/Customers/{customerId}/orders | Get orders -[**apiCustomersCustomerIdOrdersIdGet**](CustomerApi.md#apiCustomersCustomerIdOrdersIdGet) | **GET** /api/Customers/{customerId}/orders/{id} | Get a order -[**apiCustomersCustomerIdSitesGet**](CustomerApi.md#apiCustomersCustomerIdSitesGet) | **GET** /api/Customers/{customerId}/sites | Get sites -[**apiCustomersCustomerIdSitesIdGet**](CustomerApi.md#apiCustomersCustomerIdSitesIdGet) | **GET** /api/Customers/{customerId}/sites/{id} | Get a site -[**apiCustomersCustomerIdSitesPost**](CustomerApi.md#apiCustomersCustomerIdSitesPost) | **POST** /api/Customers/{customerId}/sites | Create a site for a user -[**apiCustomersCustomerIdStudentCourseEnrollmentsGet**](CustomerApi.md#apiCustomersCustomerIdStudentCourseEnrollmentsGet) | **GET** /api/Customers/{customerId}/studentCourseEnrollments | Find Course Enrollments that a customer is student in -[**apiCustomersCustomerIdSubscriptionsGet**](CustomerApi.md#apiCustomersCustomerIdSubscriptionsGet) | **GET** /api/Customers/{customerId}/subscriptions | Get subscriptions -[**apiCustomersCustomerIdSubscriptionsIdCancelPost**](CustomerApi.md#apiCustomersCustomerIdSubscriptionsIdCancelPost) | **POST** /api/Customers/{customerId}/subscriptions/{id}/cancel | Cancel (part of) a subscription. -[**apiCustomersCustomerIdSubscriptionsIdGet**](CustomerApi.md#apiCustomersCustomerIdSubscriptionsIdGet) | **GET** /api/Customers/{customerId}/subscriptions/{id} | Get a subscriptions -[**apiCustomersGet**](CustomerApi.md#apiCustomersGet) | **GET** /api/Customers | Get customers -[**apiCustomersIdAccessTokensPost**](CustomerApi.md#apiCustomersIdAccessTokensPost) | **POST** /api/Customers/{id}/accessTokens | Create an access token for a user -[**apiCustomersIdAvatarPost**](CustomerApi.md#apiCustomersIdAvatarPost) | **POST** /api/Customers/{id}/avatar | Upload a new UserAvatar to WordPress -[**apiCustomersIdDownloadGet**](CustomerApi.md#apiCustomersIdDownloadGet) | **GET** /api/Customers/{id}/download | Download profile. -[**apiCustomersIdEnablePost**](CustomerApi.md#apiCustomersIdEnablePost) | **POST** /api/Customers/{id}/enable | Enables the customer with the given ID -[**apiCustomersIdFindRefundsGet**](CustomerApi.md#apiCustomersIdFindRefundsGet) | **GET** /api/Customers/{id}/findRefunds | Find refunds for user -[**apiCustomersIdGet**](CustomerApi.md#apiCustomersIdGet) | **GET** /api/Customers/{id} | Get a customer -[**apiCustomersIdPasswordPatch**](CustomerApi.md#apiCustomersIdPasswordPatch) | **PATCH** /api/Customers/{id}/password | Update a customer's password in WordPress -[**apiCustomersIdPatch**](CustomerApi.md#apiCustomersIdPatch) | **PATCH** /api/Customers/{id} | -[**apiCustomersIdProfileGet**](CustomerApi.md#apiCustomersIdProfileGet) | **GET** /api/Customers/{id}/profile | -[**apiCustomersIdProfilePatch**](CustomerApi.md#apiCustomersIdProfilePatch) | **PATCH** /api/Customers/{id}/profile | Update a customer to WordPress -[**apiCustomersIdRoleMappingDelete**](CustomerApi.md#apiCustomersIdRoleMappingDelete) | **DELETE** /api/Customers/{id}/roleMapping | -[**apiCustomersIdRoleMappingPost**](CustomerApi.md#apiCustomersIdRoleMappingPost) | **POST** /api/Customers/{id}/roleMapping | -[**apiCustomersIdRolesGet**](CustomerApi.md#apiCustomersIdRolesGet) | **GET** /api/Customers/{id}/roles | -[**apiCustomersNewsletterListSubscribePost**](CustomerApi.md#apiCustomersNewsletterListSubscribePost) | **POST** /api/Customers/newsletter/{list}/subscribe | Subscribes a user to a newsletter -[**apiCustomersNonceGet**](CustomerApi.md#apiCustomersNonceGet) | **GET** /api/Customers/nonce | Get a nonce from Yoast.com -[**apiCustomersResetPasswordPatch**](CustomerApi.md#apiCustomersResetPasswordPatch) | **PATCH** /api/Customers/resetPassword | Reset the user's password. -[**apiCustomersRolemappingIdsGet**](CustomerApi.md#apiCustomersRolemappingIdsGet) | **GET** /api/Customers/rolemapping-ids | Get the ids of all customers with at least one role. -[**apiCustomersSendResetPasswordEmailPost**](CustomerApi.md#apiCustomersSendResetPasswordEmailPost) | **POST** /api/Customers/sendResetPasswordEmail | Send a reset password email to the user. -[**apiCustomersSignupPost**](CustomerApi.md#apiCustomersSignupPost) | **POST** /api/Customers/signup | Signup a customer on yoast.com. - - -# **apiCustomersActivatePost** -> object apiCustomersActivatePost($activateAccountDto) +[**customerAccessTokenControllerCreateAccessToken**](CustomerApi.md#customeraccesstokencontrollercreateaccesstoken) | **POST** /api/Customers/{id}/accessTokens | Create an access token for a user +[**customerAuthControllerActivate**](CustomerApi.md#customerauthcontrolleractivate) | **POST** /api/Customers/activate | Activate the account of a user +[**customerAuthControllerChangePassword**](CustomerApi.md#customerauthcontrollerchangepassword) | **PATCH** /api/Customers/{id}/password | Update a customer's password in WordPress +[**customerAuthControllerGetNonce**](CustomerApi.md#customerauthcontrollergetnonce) | **GET** /api/Customers/nonce | Get a nonce from Yoast.com +[**customerAuthControllerResetPassword**](CustomerApi.md#customerauthcontrollerresetpassword) | **PATCH** /api/Customers/resetPassword | Reset the user's password. +[**customerAuthControllerSendResetPasswordEmail**](CustomerApi.md#customerauthcontrollersendresetpasswordemail) | **POST** /api/Customers/sendResetPasswordEmail | Send a reset password email to the user. +[**customerAuthControllerSignup**](CustomerApi.md#customerauthcontrollersignup) | **POST** /api/Customers/signup | Signup a customer on yoast.com. +[**customerComposerTokenControllerGetMany**](CustomerApi.md#customercomposertokencontrollergetmany) | **GET** /api/Customers/{customerId}/composerTokens | Get composer tokens +[**customerComposerTokenControllerGetOne**](CustomerApi.md#customercomposertokencontrollergetone) | **GET** /api/Customers/{customerId}/composerTokens/{id} | Get a composer token +[**customerControllerCurrent**](CustomerApi.md#customercontrollercurrent) | **GET** /api/Customers/current | Get the current customer +[**customerControllerDownloadProfile**](CustomerApi.md#customercontrollerdownloadprofile) | **GET** /api/Customers/{id}/download | Download profile. +[**customerControllerEnable**](CustomerApi.md#customercontrollerenable) | **POST** /api/Customers/{id}/enable | Enables the customer with the given ID +[**customerControllerGetAllRoles**](CustomerApi.md#customercontrollergetallroles) | **GET** /api/Customers/allroles | Get all existing roles with their ID. +[**customerControllerGetCustomersWithRole**](CustomerApi.md#customercontrollergetcustomerswithrole) | **GET** /api/Customers/rolemapping-ids | Get the ids of all customers with at least one role. +[**customerControllerGetMany**](CustomerApi.md#customercontrollergetmany) | **GET** /api/Customers | Get customers +[**customerControllerGetManyPaged**](CustomerApi.md#customercontrollergetmanypaged) | **GET** /api/Customers/paged | Get customers +[**customerControllerGetOne**](CustomerApi.md#customercontrollergetone) | **GET** /api/Customers/{id} | Get a customer +[**customerControllerPatchProfile**](CustomerApi.md#customercontrollerpatchprofile) | **PATCH** /api/Customers/{id}/profile | Update a customer to WordPress +[**customerControllerProfile**](CustomerApi.md#customercontrollerprofile) | **GET** /api/Customers/{id}/profile | +[**customerControllerUpdateOne**](CustomerApi.md#customercontrollerupdateone) | **PATCH** /api/Customers/{id} | +[**customerControllerUploadAvatar**](CustomerApi.md#customercontrolleruploadavatar) | **POST** /api/Customers/{id}/avatar | Upload a new UserAvatar to WordPress +[**customerCourseEnrollmentControllerGetBuyerCourseEnrollments**](CustomerApi.md#customercourseenrollmentcontrollergetbuyercourseenrollments) | **GET** /api/Customers/{customerId}/buyerCourseEnrollments | Find Course Enrollments that a customer is buyer of +[**customerCourseEnrollmentControllerGetCourseEnrollments**](CustomerApi.md#customercourseenrollmentcontrollergetcourseenrollments) | **GET** /api/Customers/{customerId}/courseEnrollments | Find Course Enrollments +[**customerCourseEnrollmentControllerGetStudentCourseEnrollments**](CustomerApi.md#customercourseenrollmentcontrollergetstudentcourseenrollments) | **GET** /api/Customers/{customerId}/studentCourseEnrollments | Find Course Enrollments that a customer is student in +[**customerGDPRControllerDeleteCustomer**](CustomerApi.md#customergdprcontrollerdeletecustomer) | **DELETE** /api/Customers/{id}/gdpr-delete | Performs a \"GDPR forget me\" request. +[**customerIdentityControllerGetMany**](CustomerApi.md#customeridentitycontrollergetmany) | **GET** /api/Customers/{customerId}/identities | Get user identities +[**customerNewsletterControllerStatus**](CustomerApi.md#customernewslettercontrollerstatus) | **GET** /api/Customers/{customerId}/newsletter | Newsletter subscription status +[**customerNewsletterControllerSubscribe**](CustomerApi.md#customernewslettercontrollersubscribe) | **POST** /api/Customers/{customerId}/newsletter | Subscribe to the newsletter +[**customerNewsletterControllerSubscribeByEmail**](CustomerApi.md#customernewslettercontrollersubscribebyemail) | **POST** /api/Customers/newsletter/{list}/subscribe | Subscribes a user to a newsletter +[**customerNewsletterControllerUnsubscribe**](CustomerApi.md#customernewslettercontrollerunsubscribe) | **DELETE** /api/Customers/{customerId}/newsletter | Unsubscribe from the newsletter +[**customerOrderControllerGetMany**](CustomerApi.md#customerordercontrollergetmany) | **GET** /api/Customers/{customerId}/orders | Get orders +[**customerOrderControllerGetOne**](CustomerApi.md#customerordercontrollergetone) | **GET** /api/Customers/{customerId}/orders/{id} | Get a order +[**customerRefundControllerFindRefunds**](CustomerApi.md#customerrefundcontrollerfindrefunds) | **GET** /api/Customers/{id}/findRefunds | Find refunds for user +[**customerRolesControllerAddRole**](CustomerApi.md#customerrolescontrolleraddrole) | **POST** /api/Customers/{id}/roleMapping | +[**customerRolesControllerDeleteRole**](CustomerApi.md#customerrolescontrollerdeleterole) | **DELETE** /api/Customers/{id}/roleMapping | +[**customerRolesControllerGetMany**](CustomerApi.md#customerrolescontrollergetmany) | **GET** /api/Customers/{id}/roles | +[**customerSiteControllerCreateSite**](CustomerApi.md#customersitecontrollercreatesite) | **POST** /api/Customers/{customerId}/sites | Create a site for a user +[**customerSiteControllerGetMany**](CustomerApi.md#customersitecontrollergetmany) | **GET** /api/Customers/{customerId}/sites | Get sites +[**customerSiteControllerGetOne**](CustomerApi.md#customersitecontrollergetone) | **GET** /api/Customers/{customerId}/sites/{id} | Get a site +[**customerSubscriptionControllerCancelSubscription**](CustomerApi.md#customersubscriptioncontrollercancelsubscription) | **POST** /api/Customers/{customerId}/subscriptions/{id}/cancel | Cancel (part of) a subscription. +[**customerSubscriptionControllerGetMany**](CustomerApi.md#customersubscriptioncontrollergetmany) | **GET** /api/Customers/{customerId}/subscriptions | Get subscriptions +[**customerSubscriptionControllerGetOne**](CustomerApi.md#customersubscriptioncontrollergetone) | **GET** /api/Customers/{customerId}/subscriptions/{id} | Get a subscriptions + +# **customerAccessTokenControllerCreateAccessToken** +> \Yoast\MyYoastApiClient\Model\AccessToken customerAccessTokenControllerCreateAccessToken($id) + +Create an access token for a user + +### Example +```php +customerAccessTokenControllerCreateAccessToken($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling CustomerApi->customerAccessTokenControllerCreateAccessToken: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | [**string**](../Model/.md)| | + +### Return type + +[**\Yoast\MyYoastApiClient\Model\AccessToken**](../Model/AccessToken.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **customerAuthControllerActivate** +> object customerAuthControllerActivate($body) Activate the account of a user @@ -63,13 +111,13 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); -$activateAccountDto = new \Yoast\MyYoastApiClient\Model\ActivateAccountDto(); // \Yoast\MyYoastApiClient\Model\ActivateAccountDto | +$body = new \Yoast\MyYoastApiClient\Model\ActivateAccountDto(); // \Yoast\MyYoastApiClient\Model\ActivateAccountDto | try { - $result = $apiInstance->apiCustomersActivatePost($activateAccountDto); + $result = $apiInstance->customerAuthControllerActivate($body); print_r($result); } catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersActivatePost: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CustomerApi->customerAuthControllerActivate: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -78,7 +126,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **activateAccountDto** | [**\Yoast\MyYoastApiClient\Model\ActivateAccountDto**](../Model/ActivateAccountDto.md)| | + **body** | [**\Yoast\MyYoastApiClient\Model\ActivateAccountDto**](../Model/ActivateAccountDto.md)| | ### Return type @@ -95,20 +143,21 @@ No authorization required [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCustomersAllrolesGet** -> object apiCustomersAllrolesGet() +# **customerAuthControllerChangePassword** +> \Yoast\MyYoastApiClient\Model\Customer customerAuthControllerChangePassword($body, $id) -Get all existing roles with their ID. +Update a customer's password in WordPress + +This route allows a customer to updates their password on WordPress. ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -116,22 +165,28 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( new GuzzleHttp\Client(), $config ); +$body = new \Yoast\MyYoastApiClient\Model\ChangePasswordDto(); // \Yoast\MyYoastApiClient\Model\ChangePasswordDto | +$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | try { - $result = $apiInstance->apiCustomersAllrolesGet(); + $result = $apiInstance->customerAuthControllerChangePassword($body, $id); print_r($result); } catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersAllrolesGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CustomerApi->customerAuthControllerChangePassword: ', $e->getMessage(), PHP_EOL; } ?> ``` ### Parameters -This endpoint does not need any parameter. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**\Yoast\MyYoastApiClient\Model\ChangePasswordDto**](../Model/ChangePasswordDto.md)| | + **id** | [**string**](../Model/.md)| | ### Return type -**object** +[**\Yoast\MyYoastApiClient\Model\Customer**](../Model/Customer.md) ### Authorization @@ -144,33 +199,29 @@ This endpoint does not need any parameter. [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCustomersCurrentGet** -> \Yoast\MyYoastApiClient\Model\Customer apiCustomersCurrentGet() +# **customerAuthControllerGetNonce** +> object customerAuthControllerGetNonce() -Get the current customer +Get a nonce from Yoast.com + +Get a nonce from Yoast.com for usage with further requests to Yoast.com ### Example ```php setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); - $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config + new GuzzleHttp\Client() ); try { - $result = $apiInstance->apiCustomersCurrentGet(); + $result = $apiInstance->customerAuthControllerGetNonce(); print_r($result); } catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersCurrentGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CustomerApi->customerAuthControllerGetNonce: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -180,11 +231,60 @@ This endpoint does not need any parameter. ### Return type +**object** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **customerAuthControllerResetPassword** +> \Yoast\MyYoastApiClient\Model\Customer customerAuthControllerResetPassword($body) + +Reset the user's password. + +This route allows a user to reset its password. + +### Example +```php +customerAuthControllerResetPassword($body); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling CustomerApi->customerAuthControllerResetPassword: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**\Yoast\MyYoastApiClient\Model\ResetPasswordDto**](../Model/ResetPasswordDto.md)| | + +### Return type + [**\Yoast\MyYoastApiClient\Model\Customer**](../Model/Customer.md) ### Authorization -[bearer](../../README.md#bearer) +No authorization required ### HTTP request headers @@ -193,34 +293,30 @@ This endpoint does not need any parameter. [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCustomersCustomerIdBuyerCourseEnrollmentsGet** -> \Yoast\MyYoastApiClient\Model\CourseEnrollment[] apiCustomersCustomerIdBuyerCourseEnrollmentsGet($customerId) +# **customerAuthControllerSendResetPasswordEmail** +> object customerAuthControllerSendResetPasswordEmail($body) -Find Course Enrollments that a customer is buyer of +Send a reset password email to the user. + +Use yoast.com to send a password reset email to the user email specified in the request body. ### Example ```php setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); - $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config + new GuzzleHttp\Client() ); -$customerId = "customerId_example"; // string | +$body = new \Yoast\MyYoastApiClient\Model\SendResetPasswordEmailDto(); // \Yoast\MyYoastApiClient\Model\SendResetPasswordEmailDto | try { - $result = $apiInstance->apiCustomersCustomerIdBuyerCourseEnrollmentsGet($customerId); + $result = $apiInstance->customerAuthControllerSendResetPasswordEmail($body); print_r($result); } catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersCustomerIdBuyerCourseEnrollmentsGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CustomerApi->customerAuthControllerSendResetPasswordEmail: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -229,15 +325,15 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **customerId** | [**string**](../Model/.md)| | + **body** | [**\Yoast\MyYoastApiClient\Model\SendResetPasswordEmailDto**](../Model/SendResetPasswordEmailDto.md)| | ### Return type -[**\Yoast\MyYoastApiClient\Model\CourseEnrollment[]**](../Model/CourseEnrollment.md) +**object** ### Authorization -[bearer](../../README.md#bearer) +No authorization required ### HTTP request headers @@ -246,37 +342,30 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCustomersCustomerIdComposerTokensGet** -> \Yoast\MyYoastApiClient\Model\ComposerToken[] apiCustomersCustomerIdComposerTokensGet($customerId, $filter) +# **customerAuthControllerSignup** +> object customerAuthControllerSignup($body) -Get composer tokens +Signup a customer on yoast.com. -Get and filter composer tokens of a customer +Using this route, a new account can be created on yoast.com ### Example ```php setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); - $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config + new GuzzleHttp\Client() ); -$customerId = "customerId_example"; // string | -$filter = array('key' => "filter_example"); // map[string,string] | Used for filtering/joining the results. +$body = new \Yoast\MyYoastApiClient\Model\SignupAccountDto(); // \Yoast\MyYoastApiClient\Model\SignupAccountDto | try { - $result = $apiInstance->apiCustomersCustomerIdComposerTokensGet($customerId, $filter); + $result = $apiInstance->customerAuthControllerSignup($body); print_r($result); } catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersCustomerIdComposerTokensGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CustomerApi->customerAuthControllerSignup: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -285,16 +374,15 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **customerId** | [**string**](../Model/.md)| | - **filter** | [**map[string,string]**](../Model/string.md)| Used for filtering/joining the results. | [optional] + **body** | [**\Yoast\MyYoastApiClient\Model\SignupAccountDto**](../Model/SignupAccountDto.md)| | ### Return type -[**\Yoast\MyYoastApiClient\Model\ComposerToken[]**](../Model/ComposerToken.md) +**object** ### Authorization -[bearer](../../README.md#bearer) +No authorization required ### HTTP request headers @@ -303,22 +391,21 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCustomersCustomerIdComposerTokensIdGet** -> \Yoast\MyYoastApiClient\Model\ComposerToken apiCustomersCustomerIdComposerTokensIdGet($customerId, $id, $filter) +# **customerComposerTokenControllerGetMany** +> \Yoast\MyYoastApiClient\Model\ComposerToken[] customerComposerTokenControllerGetMany($customerId, $filter) -Get a composer token +Get composer tokens -Get a single composer token of a customer +Get and filter composer tokens of a customer ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -326,15 +413,14 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( new GuzzleHttp\Client(), $config ); -$customerId = "customerId_example"; // string | -$id = "id_example"; // string | -$filter = array('key' => "filter_example"); // map[string,string] | Used for filtering/joining the results. +$customerId = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | +$filter = new \stdClass; // object | Used for filtering/joining the results. try { - $result = $apiInstance->apiCustomersCustomerIdComposerTokensIdGet($customerId, $id, $filter); + $result = $apiInstance->customerComposerTokenControllerGetMany($customerId, $filter); print_r($result); } catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersCustomerIdComposerTokensIdGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CustomerApi->customerComposerTokenControllerGetMany: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -344,12 +430,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **customerId** | [**string**](../Model/.md)| | - **id** | [**string**](../Model/.md)| | - **filter** | [**map[string,string]**](../Model/string.md)| Used for filtering/joining the results. | [optional] + **filter** | [**object**](../Model/.md)| Used for filtering/joining the results. | [optional] ### Return type -[**\Yoast\MyYoastApiClient\Model\ComposerToken**](../Model/ComposerToken.md) +[**\Yoast\MyYoastApiClient\Model\ComposerToken[]**](../Model/ComposerToken.md) ### Authorization @@ -357,27 +442,26 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCustomersCustomerIdCourseEnrollmentsGet** -> \Yoast\MyYoastApiClient\Model\CourseEnrollment[] apiCustomersCustomerIdCourseEnrollmentsGet($ownershipRelation, $customerId, $courseId) +# **customerComposerTokenControllerGetOne** +> \Yoast\MyYoastApiClient\Model\ComposerToken customerComposerTokenControllerGetOne($customerId, $id, $filter) -Find Course Enrollments +Get a composer token -Find Course Enrollments and filter by course or ownership relation. +Get a single composer token of a customer ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -385,15 +469,15 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( new GuzzleHttp\Client(), $config ); -$ownershipRelation = "ownershipRelation_example"; // string | -$customerId = "customerId_example"; // string | -$courseId = "courseId_example"; // string | +$customerId = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | +$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | +$filter = new \stdClass; // object | Used for filtering/joining the results. try { - $result = $apiInstance->apiCustomersCustomerIdCourseEnrollmentsGet($ownershipRelation, $customerId, $courseId); + $result = $apiInstance->customerComposerTokenControllerGetOne($customerId, $id, $filter); print_r($result); } catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersCustomerIdCourseEnrollmentsGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CustomerApi->customerComposerTokenControllerGetOne: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -402,13 +486,13 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **ownershipRelation** | [**string**](../Model/.md)| | **customerId** | [**string**](../Model/.md)| | - **courseId** | [**string**](../Model/.md)| | [optional] + **id** | [**string**](../Model/.md)| | + **filter** | [**object**](../Model/.md)| Used for filtering/joining the results. | [optional] ### Return type -[**\Yoast\MyYoastApiClient\Model\CourseEnrollment[]**](../Model/CourseEnrollment.md) +[**\Yoast\MyYoastApiClient\Model\ComposerToken**](../Model/ComposerToken.md) ### Authorization @@ -416,27 +500,24 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCustomersCustomerIdIdentitiesGet** -> \Yoast\MyYoastApiClient\Model\UserIdentity[] apiCustomersCustomerIdIdentitiesGet($customerId, $filter) - -Get user identities +# **customerControllerCurrent** +> \Yoast\MyYoastApiClient\Model\Customer customerControllerCurrent() -Get and filter user identities of a customer +Get the current customer ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -444,28 +525,22 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( new GuzzleHttp\Client(), $config ); -$customerId = "customerId_example"; // string | -$filter = array('key' => "filter_example"); // map[string,string] | Used for filtering/joining the results. try { - $result = $apiInstance->apiCustomersCustomerIdIdentitiesGet($customerId, $filter); + $result = $apiInstance->customerControllerCurrent(); print_r($result); } catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersCustomerIdIdentitiesGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CustomerApi->customerControllerCurrent: ', $e->getMessage(), PHP_EOL; } ?> ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **customerId** | [**string**](../Model/.md)| | - **filter** | [**map[string,string]**](../Model/string.md)| Used for filtering/joining the results. | [optional] +This endpoint does not need any parameter. ### Return type -[**\Yoast\MyYoastApiClient\Model\UserIdentity[]**](../Model/UserIdentity.md) +[**\Yoast\MyYoastApiClient\Model\Customer**](../Model/Customer.md) ### Authorization @@ -473,25 +548,26 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCustomersCustomerIdNewsletterDelete** -> object apiCustomersCustomerIdNewsletterDelete($customerId) +# **customerControllerDownloadProfile** +> \Yoast\MyYoastApiClient\Model\JSZip customerControllerDownloadProfile($id) -Unsubscribe from the newsletter +Download profile. + +Downloads the data of the given customer as CSV files inside a ZIP file. ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -499,13 +575,13 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( new GuzzleHttp\Client(), $config ); -$customerId = "customerId_example"; // string | +$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | try { - $result = $apiInstance->apiCustomersCustomerIdNewsletterDelete($customerId); + $result = $apiInstance->customerControllerDownloadProfile($id); print_r($result); } catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersCustomerIdNewsletterDelete: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CustomerApi->customerControllerDownloadProfile: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -514,11 +590,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **customerId** | [**string**](../Model/.md)| | + **id** | [**string**](../Model/.md)| | ### Return type -**object** +[**\Yoast\MyYoastApiClient\Model\JSZip**](../Model/JSZip.md) ### Authorization @@ -526,25 +602,26 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCustomersCustomerIdNewsletterGet** -> object apiCustomersCustomerIdNewsletterGet($customerId) +# **customerControllerEnable** +> object customerControllerEnable($id) -Newsletter subscription status +Enables the customer with the given ID + +Used when customers accidentally disable their own account ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -552,13 +629,13 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( new GuzzleHttp\Client(), $config ); -$customerId = "customerId_example"; // string | +$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | try { - $result = $apiInstance->apiCustomersCustomerIdNewsletterGet($customerId); + $result = $apiInstance->customerControllerEnable($id); print_r($result); } catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersCustomerIdNewsletterGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CustomerApi->customerControllerEnable: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -567,7 +644,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **customerId** | [**string**](../Model/.md)| | + **id** | [**string**](../Model/.md)| | ### Return type @@ -579,25 +656,24 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCustomersCustomerIdNewsletterPost** -> object apiCustomersCustomerIdNewsletterPost($customerId) +# **customerControllerGetAllRoles** +> object customerControllerGetAllRoles() -Subscribe to the newsletter +Get all existing roles with their ID. ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -605,22 +681,18 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( new GuzzleHttp\Client(), $config ); -$customerId = "customerId_example"; // string | try { - $result = $apiInstance->apiCustomersCustomerIdNewsletterPost($customerId); + $result = $apiInstance->customerControllerGetAllRoles(); print_r($result); } catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersCustomerIdNewsletterPost: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CustomerApi->customerControllerGetAllRoles: ', $e->getMessage(), PHP_EOL; } ?> ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **customerId** | [**string**](../Model/.md)| | +This endpoint does not need any parameter. ### Return type @@ -632,27 +704,26 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCustomersCustomerIdOrdersGet** -> \Yoast\MyYoastApiClient\Model\Order[] apiCustomersCustomerIdOrdersGet($customerId, $filter) +# **customerControllerGetCustomersWithRole** +> string[] customerControllerGetCustomersWithRole() -Get orders +Get the ids of all customers with at least one role. -Get and filter orders of a customer +Requires the caller to have the admin role. ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -660,28 +731,22 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( new GuzzleHttp\Client(), $config ); -$customerId = "customerId_example"; // string | -$filter = array('key' => "filter_example"); // map[string,string] | Used for filtering/joining the results. try { - $result = $apiInstance->apiCustomersCustomerIdOrdersGet($customerId, $filter); + $result = $apiInstance->customerControllerGetCustomersWithRole(); print_r($result); } catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersCustomerIdOrdersGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CustomerApi->customerControllerGetCustomersWithRole: ', $e->getMessage(), PHP_EOL; } ?> ``` ### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **customerId** | [**string**](../Model/.md)| | - **filter** | [**map[string,string]**](../Model/string.md)| Used for filtering/joining the results. | [optional] +This endpoint does not need any parameter. ### Return type -[**\Yoast\MyYoastApiClient\Model\Order[]**](../Model/Order.md) +**string[]** ### Authorization @@ -689,27 +754,26 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCustomersCustomerIdOrdersIdGet** -> \Yoast\MyYoastApiClient\Model\Order apiCustomersCustomerIdOrdersIdGet($customerId, $id, $filter) +# **customerControllerGetMany** +> \Yoast\MyYoastApiClient\Model\Customer[] customerControllerGetMany($filter) -Get a order +Get customers -Get a single order of a customer +Get and filter customers ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -717,15 +781,13 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( new GuzzleHttp\Client(), $config ); -$customerId = "customerId_example"; // string | -$id = "id_example"; // string | -$filter = array('key' => "filter_example"); // map[string,string] | Used for filtering/joining the results. +$filter = new \stdClass; // object | Used for filtering/joining the results. try { - $result = $apiInstance->apiCustomersCustomerIdOrdersIdGet($customerId, $id, $filter); + $result = $apiInstance->customerControllerGetMany($filter); print_r($result); } catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersCustomerIdOrdersIdGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CustomerApi->customerControllerGetMany: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -734,13 +796,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **customerId** | [**string**](../Model/.md)| | - **id** | [**string**](../Model/.md)| | - **filter** | [**map[string,string]**](../Model/string.md)| Used for filtering/joining the results. | [optional] + **filter** | [**object**](../Model/.md)| Used for filtering/joining the results. | [optional] ### Return type -[**\Yoast\MyYoastApiClient\Model\Order**](../Model/Order.md) +[**\Yoast\MyYoastApiClient\Model\Customer[]**](../Model/Customer.md) ### Authorization @@ -748,27 +808,26 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCustomersCustomerIdSitesGet** -> \Yoast\MyYoastApiClient\Model\Site[] apiCustomersCustomerIdSitesGet($customerId, $filter) +# **customerControllerGetManyPaged** +> object customerControllerGetManyPaged($filter) -Get sites +Get customers -Get and filter sites of a customer +Get and filter customer ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -776,14 +835,13 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( new GuzzleHttp\Client(), $config ); -$customerId = "customerId_example"; // string | -$filter = array('key' => "filter_example"); // map[string,string] | Used for filtering/joining the results. +$filter = new \stdClass; // object | Used for filtering/joining the results. try { - $result = $apiInstance->apiCustomersCustomerIdSitesGet($customerId, $filter); + $result = $apiInstance->customerControllerGetManyPaged($filter); print_r($result); } catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersCustomerIdSitesGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CustomerApi->customerControllerGetManyPaged: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -792,12 +850,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **customerId** | [**string**](../Model/.md)| | - **filter** | [**map[string,string]**](../Model/string.md)| Used for filtering/joining the results. | [optional] + **filter** | [**object**](../Model/.md)| Used for filtering/joining the results. | [optional] ### Return type -[**\Yoast\MyYoastApiClient\Model\Site[]**](../Model/Site.md) +**object** ### Authorization @@ -805,27 +862,26 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCustomersCustomerIdSitesIdGet** -> \Yoast\MyYoastApiClient\Model\Site apiCustomersCustomerIdSitesIdGet($customerId, $id, $filter) +# **customerControllerGetOne** +> \Yoast\MyYoastApiClient\Model\Customer customerControllerGetOne($id, $filter) -Get a site +Get a customer -Get a single site of a customer +Get a single customer ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -833,15 +889,14 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( new GuzzleHttp\Client(), $config ); -$customerId = "customerId_example"; // string | -$id = "id_example"; // string | -$filter = array('key' => "filter_example"); // map[string,string] | Used for filtering/joining the results. +$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | +$filter = new \stdClass; // object | Used for filtering/joining the results. try { - $result = $apiInstance->apiCustomersCustomerIdSitesIdGet($customerId, $id, $filter); + $result = $apiInstance->customerControllerGetOne($id, $filter); print_r($result); } catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersCustomerIdSitesIdGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CustomerApi->customerControllerGetOne: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -850,13 +905,12 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **customerId** | [**string**](../Model/.md)| | **id** | [**string**](../Model/.md)| | - **filter** | [**map[string,string]**](../Model/string.md)| Used for filtering/joining the results. | [optional] + **filter** | [**object**](../Model/.md)| Used for filtering/joining the results. | [optional] ### Return type -[**\Yoast\MyYoastApiClient\Model\Site**](../Model/Site.md) +[**\Yoast\MyYoastApiClient\Model\Customer**](../Model/Customer.md) ### Authorization @@ -864,27 +918,26 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCustomersCustomerIdSitesPost** -> \Yoast\MyYoastApiClient\Model\Site apiCustomersCustomerIdSitesPost($createSiteBodyDto, $customerId) +# **customerControllerPatchProfile** +> \Yoast\MyYoastApiClient\Model\Customer customerControllerPatchProfile($body, $id) -Create a site for a user +Update a customer to WordPress -Create a site record so we can link a subscription to a site which is linked to a customer +This route allows a customer to updates their profile on WordPress. ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -892,14 +945,14 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( new GuzzleHttp\Client(), $config ); -$createSiteBodyDto = new \Yoast\MyYoastApiClient\Model\CreateSiteBodyDto(); // \Yoast\MyYoastApiClient\Model\CreateSiteBodyDto | -$customerId = "customerId_example"; // string | +$body = new \Yoast\MyYoastApiClient\Model\UpdateUserToWordpressDto(); // \Yoast\MyYoastApiClient\Model\UpdateUserToWordpressDto | +$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | try { - $result = $apiInstance->apiCustomersCustomerIdSitesPost($createSiteBodyDto, $customerId); + $result = $apiInstance->customerControllerPatchProfile($body, $id); print_r($result); } catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersCustomerIdSitesPost: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CustomerApi->customerControllerPatchProfile: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -908,12 +961,12 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **createSiteBodyDto** | [**\Yoast\MyYoastApiClient\Model\CreateSiteBodyDto**](../Model/CreateSiteBodyDto.md)| | - **customerId** | **string**| | + **body** | [**\Yoast\MyYoastApiClient\Model\UpdateUserToWordpressDto**](../Model/UpdateUserToWordpressDto.md)| | + **id** | [**string**](../Model/.md)| | ### Return type -[**\Yoast\MyYoastApiClient\Model\Site**](../Model/Site.md) +[**\Yoast\MyYoastApiClient\Model\Customer**](../Model/Customer.md) ### Authorization @@ -926,20 +979,19 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCustomersCustomerIdStudentCourseEnrollmentsGet** -> \Yoast\MyYoastApiClient\Model\CourseEnrollment[] apiCustomersCustomerIdStudentCourseEnrollmentsGet($customerId) +# **customerControllerProfile** +> object customerControllerProfile($id) + -Find Course Enrollments that a customer is student in ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -947,13 +999,13 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( new GuzzleHttp\Client(), $config ); -$customerId = "customerId_example"; // string | +$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | try { - $result = $apiInstance->apiCustomersCustomerIdStudentCourseEnrollmentsGet($customerId); + $result = $apiInstance->customerControllerProfile($id); print_r($result); } catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersCustomerIdStudentCourseEnrollmentsGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CustomerApi->customerControllerProfile: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -962,11 +1014,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **customerId** | [**string**](../Model/.md)| | + **id** | [**string**](../Model/.md)| | ### Return type -[**\Yoast\MyYoastApiClient\Model\CourseEnrollment[]**](../Model/CourseEnrollment.md) +**object** ### Authorization @@ -974,27 +1026,24 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCustomersCustomerIdSubscriptionsGet** -> \Yoast\MyYoastApiClient\Model\Subscription[] apiCustomersCustomerIdSubscriptionsGet($customerId, $filter) +# **customerControllerUpdateOne** +> \Yoast\MyYoastApiClient\Model\Customer customerControllerUpdateOne($body, $id) -Get subscriptions -Get and filter subscriptions of a customer ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -1002,14 +1051,14 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( new GuzzleHttp\Client(), $config ); -$customerId = "customerId_example"; // string | -$filter = array('key' => "filter_example"); // map[string,string] | Used for filtering/joining the results. +$body = new \Yoast\MyYoastApiClient\Model\UpdateUserDto(); // \Yoast\MyYoastApiClient\Model\UpdateUserDto | +$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | try { - $result = $apiInstance->apiCustomersCustomerIdSubscriptionsGet($customerId, $filter); + $result = $apiInstance->customerControllerUpdateOne($body, $id); print_r($result); } catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersCustomerIdSubscriptionsGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CustomerApi->customerControllerUpdateOne: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -1018,12 +1067,12 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **customerId** | [**string**](../Model/.md)| | - **filter** | [**map[string,string]**](../Model/string.md)| Used for filtering/joining the results. | [optional] + **body** | [**\Yoast\MyYoastApiClient\Model\UpdateUserDto**](../Model/UpdateUserDto.md)| | + **id** | [**string**](../Model/.md)| | ### Return type -[**\Yoast\MyYoastApiClient\Model\Subscription[]**](../Model/Subscription.md) +[**\Yoast\MyYoastApiClient\Model\Customer**](../Model/Customer.md) ### Authorization @@ -1036,22 +1085,21 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCustomersCustomerIdSubscriptionsIdCancelPost** -> object apiCustomersCustomerIdSubscriptionsIdCancelPost($cancelSubscriptionBodyDto, $customerId, $id) +# **customerControllerUploadAvatar** +> \Yoast\MyYoastApiClient\Model\Customer customerControllerUploadAvatar($id) -Cancel (part of) a subscription. +Upload a new UserAvatar to WordPress -Communicates a (partial) subscription to yoast.com. +This route allows the user to upload a new UserAvatar to their WordPress account ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -1059,15 +1107,13 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( new GuzzleHttp\Client(), $config ); -$cancelSubscriptionBodyDto = new \Yoast\MyYoastApiClient\Model\CancelSubscriptionBodyDto(); // \Yoast\MyYoastApiClient\Model\CancelSubscriptionBodyDto | -$customerId = "customerId_example"; // string | -$id = "id_example"; // string | +$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | try { - $result = $apiInstance->apiCustomersCustomerIdSubscriptionsIdCancelPost($cancelSubscriptionBodyDto, $customerId, $id); + $result = $apiInstance->customerControllerUploadAvatar($id); print_r($result); } catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersCustomerIdSubscriptionsIdCancelPost: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CustomerApi->customerControllerUploadAvatar: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -1076,13 +1122,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **cancelSubscriptionBodyDto** | [**\Yoast\MyYoastApiClient\Model\CancelSubscriptionBodyDto**](../Model/CancelSubscriptionBodyDto.md)| | - **customerId** | [**string**](../Model/.md)| | **id** | [**string**](../Model/.md)| | ### Return type -**object** +[**\Yoast\MyYoastApiClient\Model\Customer**](../Model/Customer.md) ### Authorization @@ -1090,27 +1134,24 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCustomersCustomerIdSubscriptionsIdGet** -> \Yoast\MyYoastApiClient\Model\Subscription apiCustomersCustomerIdSubscriptionsIdGet($customerId, $id, $filter) - -Get a subscriptions +# **customerCourseEnrollmentControllerGetBuyerCourseEnrollments** +> \Yoast\MyYoastApiClient\Model\CourseEnrollment[] customerCourseEnrollmentControllerGetBuyerCourseEnrollments($customerId) -Get a single subscriptions of a customer +Find Course Enrollments that a customer is buyer of ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -1118,15 +1159,13 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( new GuzzleHttp\Client(), $config ); -$customerId = "customerId_example"; // string | -$id = "id_example"; // string | -$filter = array('key' => "filter_example"); // map[string,string] | Used for filtering/joining the results. +$customerId = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | try { - $result = $apiInstance->apiCustomersCustomerIdSubscriptionsIdGet($customerId, $id, $filter); + $result = $apiInstance->customerCourseEnrollmentControllerGetBuyerCourseEnrollments($customerId); print_r($result); } catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersCustomerIdSubscriptionsIdGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CustomerApi->customerCourseEnrollmentControllerGetBuyerCourseEnrollments: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -1136,12 +1175,10 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **customerId** | [**string**](../Model/.md)| | - **id** | [**string**](../Model/.md)| | - **filter** | [**map[string,string]**](../Model/string.md)| Used for filtering/joining the results. | [optional] ### Return type -[**\Yoast\MyYoastApiClient\Model\Subscription**](../Model/Subscription.md) +[**\Yoast\MyYoastApiClient\Model\CourseEnrollment[]**](../Model/CourseEnrollment.md) ### Authorization @@ -1149,27 +1186,26 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCustomersGet** -> \Yoast\MyYoastApiClient\Model\Customer[] apiCustomersGet($filter) +# **customerCourseEnrollmentControllerGetCourseEnrollments** +> \Yoast\MyYoastApiClient\Model\CourseEnrollment[] customerCourseEnrollmentControllerGetCourseEnrollments($customerId, $ownershipRelation, $courseId) -Get customers +Find Course Enrollments -Get and filter customers +Find Course Enrollments and filter by course or ownership relation. ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -1177,13 +1213,15 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( new GuzzleHttp\Client(), $config ); -$filter = array('key' => "filter_example"); // map[string,string] | Used for filtering/joining the results. +$customerId = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | +$ownershipRelation = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | +$courseId = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | try { - $result = $apiInstance->apiCustomersGet($filter); + $result = $apiInstance->customerCourseEnrollmentControllerGetCourseEnrollments($customerId, $ownershipRelation, $courseId); print_r($result); } catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CustomerApi->customerCourseEnrollmentControllerGetCourseEnrollments: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -1192,11 +1230,13 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **filter** | [**map[string,string]**](../Model/string.md)| Used for filtering/joining the results. | [optional] + **customerId** | [**string**](../Model/.md)| | + **ownershipRelation** | [**string**](../Model/.md)| | + **courseId** | [**string**](../Model/.md)| | [optional] ### Return type -[**\Yoast\MyYoastApiClient\Model\Customer[]**](../Model/Customer.md) +[**\Yoast\MyYoastApiClient\Model\CourseEnrollment[]**](../Model/CourseEnrollment.md) ### Authorization @@ -1204,32 +1244,38 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCustomersIdAccessTokensPost** -> apiCustomersIdAccessTokensPost($id) +# **customerCourseEnrollmentControllerGetStudentCourseEnrollments** +> \Yoast\MyYoastApiClient\Model\CourseEnrollment[] customerCourseEnrollmentControllerGetStudentCourseEnrollments($customerId) -Create an access token for a user +Find Course Enrollments that a customer is student in ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); + $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client() + new GuzzleHttp\Client(), + $config ); -$id = "id_example"; // string | +$customerId = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | try { - $apiInstance->apiCustomersIdAccessTokensPost($id); + $result = $apiInstance->customerCourseEnrollmentControllerGetStudentCourseEnrollments($customerId); + print_r($result); } catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersIdAccessTokensPost: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CustomerApi->customerCourseEnrollmentControllerGetStudentCourseEnrollments: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -1238,39 +1284,38 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | [**string**](../Model/.md)| | + **customerId** | [**string**](../Model/.md)| | ### Return type -void (empty response body) +[**\Yoast\MyYoastApiClient\Model\CourseEnrollment[]**](../Model/CourseEnrollment.md) ### Authorization -No authorization required +[bearer](../../README.md#bearer) ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCustomersIdAvatarPost** -> \Yoast\MyYoastApiClient\Model\Customer apiCustomersIdAvatarPost($id) +# **customerGDPRControllerDeleteCustomer** +> string customerGDPRControllerDeleteCustomer($id) -Upload a new UserAvatar to WordPress +Performs a \"GDPR forget me\" request. -This route allows the user to upload a new UserAvatar to their WordPress account +Deletes and/or obfuscates all data related to a customer, except order data that we legally need to generate invoices. ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -1278,13 +1323,13 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( new GuzzleHttp\Client(), $config ); -$id = "id_example"; // string | +$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | try { - $result = $apiInstance->apiCustomersIdAvatarPost($id); + $result = $apiInstance->customerGDPRControllerDeleteCustomer($id); print_r($result); } catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersIdAvatarPost: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CustomerApi->customerGDPRControllerDeleteCustomer: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -1297,7 +1342,7 @@ Name | Type | Description | Notes ### Return type -[**\Yoast\MyYoastApiClient\Model\Customer**](../Model/Customer.md) +**string** ### Authorization @@ -1305,27 +1350,26 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCustomersIdDownloadGet** -> \Yoast\MyYoastApiClient\Model\JSZip apiCustomersIdDownloadGet($id) +# **customerIdentityControllerGetMany** +> \Yoast\MyYoastApiClient\Model\UserIdentity[] customerIdentityControllerGetMany($customerId, $filter) -Download profile. +Get user identities -Downloads the data of the given customer as CSV files inside a ZIP file. +Get and filter user identities of a customer ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -1333,13 +1377,14 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( new GuzzleHttp\Client(), $config ); -$id = "id_example"; // string | +$customerId = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | +$filter = new \stdClass; // object | Used for filtering/joining the results. try { - $result = $apiInstance->apiCustomersIdDownloadGet($id); + $result = $apiInstance->customerIdentityControllerGetMany($customerId, $filter); print_r($result); } catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersIdDownloadGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CustomerApi->customerIdentityControllerGetMany: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -1348,11 +1393,12 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | [**string**](../Model/.md)| | + **customerId** | [**string**](../Model/.md)| | + **filter** | [**object**](../Model/.md)| Used for filtering/joining the results. | [optional] ### Return type -[**\Yoast\MyYoastApiClient\Model\JSZip**](../Model/JSZip.md) +[**\Yoast\MyYoastApiClient\Model\UserIdentity[]**](../Model/UserIdentity.md) ### Authorization @@ -1360,27 +1406,24 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCustomersIdEnablePost** -> object apiCustomersIdEnablePost($id) +# **customerNewsletterControllerStatus** +> object customerNewsletterControllerStatus($customerId) -Enables the customer with the given ID - -Used when customers accidentally disable their own account +Newsletter subscription status ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -1388,13 +1431,13 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( new GuzzleHttp\Client(), $config ); -$id = "id_example"; // string | +$customerId = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | try { - $result = $apiInstance->apiCustomersIdEnablePost($id); + $result = $apiInstance->customerNewsletterControllerStatus($customerId); print_r($result); } catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersIdEnablePost: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CustomerApi->customerNewsletterControllerStatus: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -1403,7 +1446,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | [**string**](../Model/.md)| | + **customerId** | [**string**](../Model/.md)| | ### Return type @@ -1415,27 +1458,24 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCustomersIdFindRefundsGet** -> \Yoast\MyYoastApiClient\Model\Refund[] apiCustomersIdFindRefundsGet($id) +# **customerNewsletterControllerSubscribe** +> object customerNewsletterControllerSubscribe($customerId) -Find refunds for user - -Find the refunds for provided user id. +Subscribe to the newsletter ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -1443,13 +1483,13 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( new GuzzleHttp\Client(), $config ); -$id = "id_example"; // string | +$customerId = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | try { - $result = $apiInstance->apiCustomersIdFindRefundsGet($id); + $result = $apiInstance->customerNewsletterControllerSubscribe($customerId); print_r($result); } catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersIdFindRefundsGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CustomerApi->customerNewsletterControllerSubscribe: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -1458,11 +1498,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | [**string**](../Model/.md)| | + **customerId** | [**string**](../Model/.md)| | ### Return type -[**\Yoast\MyYoastApiClient\Model\Refund[]**](../Model/Refund.md) +**object** ### Authorization @@ -1470,42 +1510,36 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCustomersIdGet** -> \Yoast\MyYoastApiClient\Model\Customer apiCustomersIdGet($id, $filter) +# **customerNewsletterControllerSubscribeByEmail** +> object customerNewsletterControllerSubscribeByEmail($body, $list) -Get a customer +Subscribes a user to a newsletter -Get a single customer +Subscribes a user to the given (url) newsletter. ### Example ```php setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); - $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config + new GuzzleHttp\Client() ); -$id = "id_example"; // string | -$filter = array('key' => "filter_example"); // map[string,string] | Used for filtering/joining the results. +$body = new \Yoast\MyYoastApiClient\Model\SubscribeByEmailBodyDto(); // \Yoast\MyYoastApiClient\Model\SubscribeByEmailBodyDto | +$list = "list_example"; // string | try { - $result = $apiInstance->apiCustomersIdGet($id, $filter); + $result = $apiInstance->customerNewsletterControllerSubscribeByEmail($body, $list); print_r($result); } catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersIdGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CustomerApi->customerNewsletterControllerSubscribeByEmail: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -1514,16 +1548,16 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | [**string**](../Model/.md)| | - **filter** | [**map[string,string]**](../Model/string.md)| Used for filtering/joining the results. | [optional] + **body** | [**\Yoast\MyYoastApiClient\Model\SubscribeByEmailBodyDto**](../Model/SubscribeByEmailBodyDto.md)| | + **list** | **string**| | ### Return type -[**\Yoast\MyYoastApiClient\Model\Customer**](../Model/Customer.md) +**object** ### Authorization -[bearer](../../README.md#bearer) +No authorization required ### HTTP request headers @@ -1532,22 +1566,19 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCustomersIdPasswordPatch** -> \Yoast\MyYoastApiClient\Model\Customer apiCustomersIdPasswordPatch($changePasswordDto, $id) - -Update a customer's password in WordPress +# **customerNewsletterControllerUnsubscribe** +> object customerNewsletterControllerUnsubscribe($customerId) -This route allows a customer to updates their password on WordPress. +Unsubscribe from the newsletter ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -1555,14 +1586,13 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( new GuzzleHttp\Client(), $config ); -$changePasswordDto = new \Yoast\MyYoastApiClient\Model\ChangePasswordDto(); // \Yoast\MyYoastApiClient\Model\ChangePasswordDto | -$id = "id_example"; // string | +$customerId = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | try { - $result = $apiInstance->apiCustomersIdPasswordPatch($changePasswordDto, $id); + $result = $apiInstance->customerNewsletterControllerUnsubscribe($customerId); print_r($result); } catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersIdPasswordPatch: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CustomerApi->customerNewsletterControllerUnsubscribe: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -1571,12 +1601,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **changePasswordDto** | [**\Yoast\MyYoastApiClient\Model\ChangePasswordDto**](../Model/ChangePasswordDto.md)| | - **id** | [**string**](../Model/.md)| | + **customerId** | [**string**](../Model/.md)| | ### Return type -[**\Yoast\MyYoastApiClient\Model\Customer**](../Model/Customer.md) +**object** ### Authorization @@ -1584,25 +1613,26 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCustomersIdPatch** -> apiCustomersIdPatch($updateUserDto, $id) +# **customerOrderControllerGetMany** +> \Yoast\MyYoastApiClient\Model\Order[] customerOrderControllerGetMany($customerId, $filter) +Get orders +Get and filter orders of a customer ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -1610,13 +1640,14 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( new GuzzleHttp\Client(), $config ); -$updateUserDto = new \Yoast\MyYoastApiClient\Model\UpdateUserDto(); // \Yoast\MyYoastApiClient\Model\UpdateUserDto | -$id = "id_example"; // string | +$customerId = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | +$filter = new \stdClass; // object | Used for filtering/joining the results. try { - $apiInstance->apiCustomersIdPatch($updateUserDto, $id); + $result = $apiInstance->customerOrderControllerGetMany($customerId, $filter); + print_r($result); } catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersIdPatch: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CustomerApi->customerOrderControllerGetMany: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -1625,12 +1656,12 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **updateUserDto** | [**\Yoast\MyYoastApiClient\Model\UpdateUserDto**](../Model/UpdateUserDto.md)| | - **id** | [**string**](../Model/.md)| | + **customerId** | [**string**](../Model/.md)| | + **filter** | [**object**](../Model/.md)| Used for filtering/joining the results. | [optional] ### Return type -void (empty response body) +[**\Yoast\MyYoastApiClient\Model\Order[]**](../Model/Order.md) ### Authorization @@ -1638,25 +1669,26 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCustomersIdProfileGet** -> object apiCustomersIdProfileGet($id) +# **customerOrderControllerGetOne** +> \Yoast\MyYoastApiClient\Model\Order customerOrderControllerGetOne($customerId, $id, $filter) +Get a order +Get a single order of a customer ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -1664,13 +1696,15 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( new GuzzleHttp\Client(), $config ); -$id = "id_example"; // string | +$customerId = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | +$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | +$filter = new \stdClass; // object | Used for filtering/joining the results. try { - $result = $apiInstance->apiCustomersIdProfileGet($id); + $result = $apiInstance->customerOrderControllerGetOne($customerId, $id, $filter); print_r($result); } catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersIdProfileGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CustomerApi->customerOrderControllerGetOne: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -1679,11 +1713,13 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- + **customerId** | [**string**](../Model/.md)| | **id** | [**string**](../Model/.md)| | + **filter** | [**object**](../Model/.md)| Used for filtering/joining the results. | [optional] ### Return type -**object** +[**\Yoast\MyYoastApiClient\Model\Order**](../Model/Order.md) ### Authorization @@ -1691,27 +1727,26 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCustomersIdProfilePatch** -> \Yoast\MyYoastApiClient\Model\Customer apiCustomersIdProfilePatch($id, $updateUserToWordpressDto) +# **customerRefundControllerFindRefunds** +> \Yoast\MyYoastApiClient\Model\Refund[] customerRefundControllerFindRefunds($id) -Update a customer to WordPress +Find refunds for user -This route allows a customer to updates their profile on WordPress. +Find the refunds for provided user id. ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -1719,14 +1754,13 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( new GuzzleHttp\Client(), $config ); -$id = "id_example"; // string | -$updateUserToWordpressDto = new \Yoast\MyYoastApiClient\Model\UpdateUserToWordpressDto(); // \Yoast\MyYoastApiClient\Model\UpdateUserToWordpressDto | +$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | try { - $result = $apiInstance->apiCustomersIdProfilePatch($id, $updateUserToWordpressDto); + $result = $apiInstance->customerRefundControllerFindRefunds($id); print_r($result); } catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersIdProfilePatch: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CustomerApi->customerRefundControllerFindRefunds: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -1736,11 +1770,10 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | [**string**](../Model/.md)| | - **updateUserToWordpressDto** | [**\Yoast\MyYoastApiClient\Model\UpdateUserToWordpressDto**](../Model/UpdateUserToWordpressDto.md)| | ### Return type -[**\Yoast\MyYoastApiClient\Model\Customer**](../Model/Customer.md) +[**\Yoast\MyYoastApiClient\Model\Refund[]**](../Model/Refund.md) ### Authorization @@ -1748,13 +1781,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCustomersIdRoleMappingDelete** -> apiCustomersIdRoleMappingDelete($roleIDDto, $id) +# **customerRolesControllerAddRole** +> \Yoast\MyYoastApiClient\Model\Customer customerRolesControllerAddRole($body, $id) @@ -1762,11 +1795,10 @@ Name | Type | Description | Notes ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -1774,13 +1806,14 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( new GuzzleHttp\Client(), $config ); -$roleIDDto = new \Yoast\MyYoastApiClient\Model\RoleIDDto(); // \Yoast\MyYoastApiClient\Model\RoleIDDto | -$id = "id_example"; // string | +$body = new \Yoast\MyYoastApiClient\Model\RoleIDDto(); // \Yoast\MyYoastApiClient\Model\RoleIDDto | +$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | try { - $apiInstance->apiCustomersIdRoleMappingDelete($roleIDDto, $id); + $result = $apiInstance->customerRolesControllerAddRole($body, $id); + print_r($result); } catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersIdRoleMappingDelete: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CustomerApi->customerRolesControllerAddRole: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -1789,12 +1822,12 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **roleIDDto** | [**\Yoast\MyYoastApiClient\Model\RoleIDDto**](../Model/RoleIDDto.md)| | + **body** | [**\Yoast\MyYoastApiClient\Model\RoleIDDto**](../Model/RoleIDDto.md)| | **id** | [**string**](../Model/.md)| | ### Return type -void (empty response body) +[**\Yoast\MyYoastApiClient\Model\Customer**](../Model/Customer.md) ### Authorization @@ -1807,8 +1840,8 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCustomersIdRoleMappingPost** -> apiCustomersIdRoleMappingPost($roleIDDto, $id) +# **customerRolesControllerDeleteRole** +> \Yoast\MyYoastApiClient\Model\Customer customerRolesControllerDeleteRole($body, $id) @@ -1816,11 +1849,10 @@ void (empty response body) ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -1828,13 +1860,14 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( new GuzzleHttp\Client(), $config ); -$roleIDDto = new \Yoast\MyYoastApiClient\Model\RoleIDDto(); // \Yoast\MyYoastApiClient\Model\RoleIDDto | -$id = "id_example"; // string | +$body = new \Yoast\MyYoastApiClient\Model\RoleIDDto(); // \Yoast\MyYoastApiClient\Model\RoleIDDto | +$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | try { - $apiInstance->apiCustomersIdRoleMappingPost($roleIDDto, $id); + $result = $apiInstance->customerRolesControllerDeleteRole($body, $id); + print_r($result); } catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersIdRoleMappingPost: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CustomerApi->customerRolesControllerDeleteRole: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -1843,12 +1876,12 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **roleIDDto** | [**\Yoast\MyYoastApiClient\Model\RoleIDDto**](../Model/RoleIDDto.md)| | + **body** | [**\Yoast\MyYoastApiClient\Model\RoleIDDto**](../Model/RoleIDDto.md)| | **id** | [**string**](../Model/.md)| | ### Return type -void (empty response body) +[**\Yoast\MyYoastApiClient\Model\Customer**](../Model/Customer.md) ### Authorization @@ -1861,8 +1894,8 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCustomersIdRolesGet** -> apiCustomersIdRolesGet($id) +# **customerRolesControllerGetMany** +> \Yoast\MyYoastApiClient\Model\Role[] customerRolesControllerGetMany($id) @@ -1870,11 +1903,10 @@ void (empty response body) ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -1882,12 +1914,13 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( new GuzzleHttp\Client(), $config ); -$id = "id_example"; // string | +$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | try { - $apiInstance->apiCustomersIdRolesGet($id); + $result = $apiInstance->customerRolesControllerGetMany($id); + print_r($result); } catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersIdRolesGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CustomerApi->customerRolesControllerGetMany: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -1900,7 +1933,7 @@ Name | Type | Description | Notes ### Return type -void (empty response body) +[**\Yoast\MyYoastApiClient\Model\Role[]**](../Model/Role.md) ### Authorization @@ -1908,36 +1941,41 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCustomersNewsletterListSubscribePost** -> object apiCustomersNewsletterListSubscribePost($subscribeByEmailBodyDto, $list) +# **customerSiteControllerCreateSite** +> \Yoast\MyYoastApiClient\Model\Site customerSiteControllerCreateSite($body, $customerId) -Subscribes a user to a newsletter +Create a site for a user -Subscribes a user to the given (url) newsletter. +Create a site record so we can link a subscription to a site which is linked to a customer ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); + $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client() + new GuzzleHttp\Client(), + $config ); -$subscribeByEmailBodyDto = new \Yoast\MyYoastApiClient\Model\SubscribeByEmailBodyDto(); // \Yoast\MyYoastApiClient\Model\SubscribeByEmailBodyDto | -$list = "list_example"; // string | +$body = new \Yoast\MyYoastApiClient\Model\CreateSiteBodyDto(); // \Yoast\MyYoastApiClient\Model\CreateSiteBodyDto | +$customerId = "customerId_example"; // string | try { - $result = $apiInstance->apiCustomersNewsletterListSubscribePost($subscribeByEmailBodyDto, $list); + $result = $apiInstance->customerSiteControllerCreateSite($body, $customerId); print_r($result); } catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersNewsletterListSubscribePost: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CustomerApi->customerSiteControllerCreateSite: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -1946,16 +1984,16 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **subscribeByEmailBodyDto** | [**\Yoast\MyYoastApiClient\Model\SubscribeByEmailBodyDto**](../Model/SubscribeByEmailBodyDto.md)| | - **list** | **string**| | + **body** | [**\Yoast\MyYoastApiClient\Model\CreateSiteBodyDto**](../Model/CreateSiteBodyDto.md)| | + **customerId** | **string**| | ### Return type -**object** +[**\Yoast\MyYoastApiClient\Model\Site**](../Model/Site.md) ### Authorization -No authorization required +[bearer](../../README.md#bearer) ### HTTP request headers @@ -1964,75 +2002,93 @@ No authorization required [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCustomersNonceGet** -> object apiCustomersNonceGet() +# **customerSiteControllerGetMany** +> \Yoast\MyYoastApiClient\Model\Site[] customerSiteControllerGetMany($customerId, $filter) -Get a nonce from Yoast.com +Get sites -Get a nonce from Yoast.com for usage with further requests to Yoast.com +Get and filter sites of a customer ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); + $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client() + new GuzzleHttp\Client(), + $config ); +$customerId = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | +$filter = new \stdClass; // object | Used for filtering/joining the results. try { - $result = $apiInstance->apiCustomersNonceGet(); + $result = $apiInstance->customerSiteControllerGetMany($customerId, $filter); print_r($result); } catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersNonceGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CustomerApi->customerSiteControllerGetMany: ', $e->getMessage(), PHP_EOL; } ?> ``` ### Parameters -This endpoint does not need any parameter. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **customerId** | [**string**](../Model/.md)| | + **filter** | [**object**](../Model/.md)| Used for filtering/joining the results. | [optional] ### Return type -**object** +[**\Yoast\MyYoastApiClient\Model\Site[]**](../Model/Site.md) ### Authorization -No authorization required +[bearer](../../README.md#bearer) ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCustomersResetPasswordPatch** -> object apiCustomersResetPasswordPatch($resetPasswordDto) +# **customerSiteControllerGetOne** +> \Yoast\MyYoastApiClient\Model\Site customerSiteControllerGetOne($customerId, $id, $filter) -Reset the user's password. +Get a site -This route allows a user to reset its password. +Get a single site of a customer ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); + $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client() + new GuzzleHttp\Client(), + $config ); -$resetPasswordDto = new \Yoast\MyYoastApiClient\Model\ResetPasswordDto(); // \Yoast\MyYoastApiClient\Model\ResetPasswordDto | +$customerId = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | +$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | +$filter = new \stdClass; // object | Used for filtering/joining the results. try { - $result = $apiInstance->apiCustomersResetPasswordPatch($resetPasswordDto); + $result = $apiInstance->customerSiteControllerGetOne($customerId, $id, $filter); print_r($result); } catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersResetPasswordPatch: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CustomerApi->customerSiteControllerGetOne: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -2041,39 +2097,40 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **resetPasswordDto** | [**\Yoast\MyYoastApiClient\Model\ResetPasswordDto**](../Model/ResetPasswordDto.md)| | + **customerId** | [**string**](../Model/.md)| | + **id** | [**string**](../Model/.md)| | + **filter** | [**object**](../Model/.md)| Used for filtering/joining the results. | [optional] ### Return type -**object** +[**\Yoast\MyYoastApiClient\Model\Site**](../Model/Site.md) ### Authorization -No authorization required +[bearer](../../README.md#bearer) ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCustomersRolemappingIdsGet** -> string[] apiCustomersRolemappingIdsGet() +# **customerSubscriptionControllerCancelSubscription** +> object customerSubscriptionControllerCancelSubscription($body, $customerId, $id) -Get the ids of all customers with at least one role. +Cancel (part of) a subscription. -Requires the caller to have the admin role. +Communicates a (partial) subscription to yoast.com. ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -2081,22 +2138,30 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( new GuzzleHttp\Client(), $config ); +$body = new \Yoast\MyYoastApiClient\Model\CancelSubscriptionBodyDto(); // \Yoast\MyYoastApiClient\Model\CancelSubscriptionBodyDto | +$customerId = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | +$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | try { - $result = $apiInstance->apiCustomersRolemappingIdsGet(); + $result = $apiInstance->customerSubscriptionControllerCancelSubscription($body, $customerId, $id); print_r($result); } catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersRolemappingIdsGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CustomerApi->customerSubscriptionControllerCancelSubscription: ', $e->getMessage(), PHP_EOL; } ?> ``` ### Parameters -This endpoint does not need any parameter. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**\Yoast\MyYoastApiClient\Model\CancelSubscriptionBodyDto**](../Model/CancelSubscriptionBodyDto.md)| | + **customerId** | [**string**](../Model/.md)| | + **id** | [**string**](../Model/.md)| | ### Return type -**string[]** +**object** ### Authorization @@ -2109,30 +2174,36 @@ This endpoint does not need any parameter. [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCustomersSendResetPasswordEmailPost** -> object apiCustomersSendResetPasswordEmailPost($sendResetPasswordEmailDto) +# **customerSubscriptionControllerGetMany** +> \Yoast\MyYoastApiClient\Model\Subscription[] customerSubscriptionControllerGetMany($customerId, $filter) -Send a reset password email to the user. +Get subscriptions -Use yoast.com to send a password reset email to the user email specified in the request body. +Get and filter subscriptions of a customer ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); + $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client() + new GuzzleHttp\Client(), + $config ); -$sendResetPasswordEmailDto = new \Yoast\MyYoastApiClient\Model\SendResetPasswordEmailDto(); // \Yoast\MyYoastApiClient\Model\SendResetPasswordEmailDto | +$customerId = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | +$filter = new \stdClass; // object | Used for filtering/joining the results. try { - $result = $apiInstance->apiCustomersSendResetPasswordEmailPost($sendResetPasswordEmailDto); + $result = $apiInstance->customerSubscriptionControllerGetMany($customerId, $filter); print_r($result); } catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersSendResetPasswordEmailPost: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CustomerApi->customerSubscriptionControllerGetMany: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -2141,47 +2212,55 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **sendResetPasswordEmailDto** | [**\Yoast\MyYoastApiClient\Model\SendResetPasswordEmailDto**](../Model/SendResetPasswordEmailDto.md)| | + **customerId** | [**string**](../Model/.md)| | + **filter** | [**object**](../Model/.md)| Used for filtering/joining the results. | [optional] ### Return type -**object** +[**\Yoast\MyYoastApiClient\Model\Subscription[]**](../Model/Subscription.md) ### Authorization -No authorization required +[bearer](../../README.md#bearer) ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCustomersSignupPost** -> object apiCustomersSignupPost($signupAccountDto) +# **customerSubscriptionControllerGetOne** +> \Yoast\MyYoastApiClient\Model\Subscription customerSubscriptionControllerGetOne($customerId, $id, $filter) -Signup a customer on yoast.com. +Get a subscriptions -Using this route, a new account can be created on yoast.com +Get a single subscriptions of a customer ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); + $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client() + new GuzzleHttp\Client(), + $config ); -$signupAccountDto = new \Yoast\MyYoastApiClient\Model\SignupAccountDto(); // \Yoast\MyYoastApiClient\Model\SignupAccountDto | +$customerId = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | +$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | +$filter = new \stdClass; // object | Used for filtering/joining the results. try { - $result = $apiInstance->apiCustomersSignupPost($signupAccountDto); + $result = $apiInstance->customerSubscriptionControllerGetOne($customerId, $id, $filter); print_r($result); } catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersSignupPost: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CustomerApi->customerSubscriptionControllerGetOne: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -2190,19 +2269,21 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **signupAccountDto** | [**\Yoast\MyYoastApiClient\Model\SignupAccountDto**](../Model/SignupAccountDto.md)| | + **customerId** | [**string**](../Model/.md)| | + **id** | [**string**](../Model/.md)| | + **filter** | [**object**](../Model/.md)| Used for filtering/joining the results. | [optional] ### Return type -**object** +[**\Yoast\MyYoastApiClient\Model\Subscription**](../Model/Subscription.md) ### Authorization -No authorization required +[bearer](../../README.md#bearer) ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) diff --git a/docs/Api/CustomerNoteApi.md b/docs/Api/CustomerNoteApi.md index 1aad908..b6ba405 100644 --- a/docs/Api/CustomerNoteApi.md +++ b/docs/Api/CustomerNoteApi.md @@ -1,31 +1,27 @@ # Yoast\MyYoastApiClient\CustomerNoteApi -All URIs are relative to *http://my.yoast.test:3000* +All URIs are relative to */* Method | HTTP request | Description ------------- | ------------- | ------------- -[**apiCustomerNotesGet**](CustomerNoteApi.md#apiCustomerNotesGet) | **GET** /api/CustomerNotes | Get customer notes -[**apiCustomerNotesIdDelete**](CustomerNoteApi.md#apiCustomerNotesIdDelete) | **DELETE** /api/CustomerNotes/{id} | -[**apiCustomerNotesIdGet**](CustomerNoteApi.md#apiCustomerNotesIdGet) | **GET** /api/CustomerNotes/{id} | Get a customer note -[**apiCustomerNotesPost**](CustomerNoteApi.md#apiCustomerNotesPost) | **POST** /api/CustomerNotes | +[**customerNoteControllerCreateOne**](CustomerNoteApi.md#customernotecontrollercreateone) | **POST** /api/CustomerNotes | +[**customerNoteControllerDeleteOne**](CustomerNoteApi.md#customernotecontrollerdeleteone) | **DELETE** /api/CustomerNotes/{id} | +[**customerNoteControllerGetMany**](CustomerNoteApi.md#customernotecontrollergetmany) | **GET** /api/CustomerNotes | Get customer notes +[**customerNoteControllerGetOne**](CustomerNoteApi.md#customernotecontrollergetone) | **GET** /api/CustomerNotes/{id} | Get a customer note +# **customerNoteControllerCreateOne** +> customerNoteControllerCreateOne($body) -# **apiCustomerNotesGet** -> \Yoast\MyYoastApiClient\Model\CustomerNote[] apiCustomerNotesGet($filter) -Get customer notes - -Get and filter customer notes ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerNoteApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -33,13 +29,12 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerNoteApi( new GuzzleHttp\Client(), $config ); -$filter = array('key' => "filter_example"); // map[string,string] | Used for filtering/joining the results. +$body = new \Yoast\MyYoastApiClient\Model\CreateCustomerNoteDto(); // \Yoast\MyYoastApiClient\Model\CreateCustomerNoteDto | try { - $result = $apiInstance->apiCustomerNotesGet($filter); - print_r($result); + $apiInstance->customerNoteControllerCreateOne($body); } catch (Exception $e) { - echo 'Exception when calling CustomerNoteApi->apiCustomerNotesGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CustomerNoteApi->customerNoteControllerCreateOne: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -48,11 +43,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **filter** | [**map[string,string]**](../Model/string.md)| Used for filtering/joining the results. | [optional] + **body** | [**\Yoast\MyYoastApiClient\Model\CreateCustomerNoteDto**](../Model/CreateCustomerNoteDto.md)| | ### Return type -[**\Yoast\MyYoastApiClient\Model\CustomerNote[]**](../Model/CustomerNote.md) +void (empty response body) ### Authorization @@ -61,12 +56,12 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: application/json - - **Accept**: application/json + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCustomerNotesIdDelete** -> apiCustomerNotesIdDelete($id) +# **customerNoteControllerDeleteOne** +> customerNoteControllerDeleteOne($id) @@ -74,11 +69,10 @@ Name | Type | Description | Notes ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerNoteApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -86,12 +80,12 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerNoteApi( new GuzzleHttp\Client(), $config ); -$id = "id_example"; // string | +$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | try { - $apiInstance->apiCustomerNotesIdDelete($id); + $apiInstance->customerNoteControllerDeleteOne($id); } catch (Exception $e) { - echo 'Exception when calling CustomerNoteApi->apiCustomerNotesIdDelete: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CustomerNoteApi->customerNoteControllerDeleteOne: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -112,27 +106,26 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json + - **Content-Type**: Not defined + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCustomerNotesIdGet** -> \Yoast\MyYoastApiClient\Model\CustomerNote apiCustomerNotesIdGet($id, $filter) +# **customerNoteControllerGetMany** +> \Yoast\MyYoastApiClient\Model\CustomerNote[] customerNoteControllerGetMany($filter) -Get a customer note +Get customer notes -Get a single customer note +Get and filter customer notes ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerNoteApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -140,14 +133,13 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerNoteApi( new GuzzleHttp\Client(), $config ); -$id = "id_example"; // string | -$filter = array('key' => "filter_example"); // map[string,string] | Used for filtering/joining the results. +$filter = new \stdClass; // object | Used for filtering/joining the results. try { - $result = $apiInstance->apiCustomerNotesIdGet($id, $filter); + $result = $apiInstance->customerNoteControllerGetMany($filter); print_r($result); } catch (Exception $e) { - echo 'Exception when calling CustomerNoteApi->apiCustomerNotesIdGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CustomerNoteApi->customerNoteControllerGetMany: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -156,12 +148,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | [**string**](../Model/.md)| | - **filter** | [**map[string,string]**](../Model/string.md)| Used for filtering/joining the results. | [optional] + **filter** | [**object**](../Model/.md)| Used for filtering/joining the results. | [optional] ### Return type -[**\Yoast\MyYoastApiClient\Model\CustomerNote**](../Model/CustomerNote.md) +[**\Yoast\MyYoastApiClient\Model\CustomerNote[]**](../Model/CustomerNote.md) ### Authorization @@ -169,25 +160,26 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiCustomerNotesPost** -> apiCustomerNotesPost($createCustomerNoteDto) +# **customerNoteControllerGetOne** +> \Yoast\MyYoastApiClient\Model\CustomerNote customerNoteControllerGetOne($id, $filter) +Get a customer note +Get a single customer note ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerNoteApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -195,12 +187,14 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\CustomerNoteApi( new GuzzleHttp\Client(), $config ); -$createCustomerNoteDto = new \Yoast\MyYoastApiClient\Model\CreateCustomerNoteDto(); // \Yoast\MyYoastApiClient\Model\CreateCustomerNoteDto | +$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | +$filter = new \stdClass; // object | Used for filtering/joining the results. try { - $apiInstance->apiCustomerNotesPost($createCustomerNoteDto); + $result = $apiInstance->customerNoteControllerGetOne($id, $filter); + print_r($result); } catch (Exception $e) { - echo 'Exception when calling CustomerNoteApi->apiCustomerNotesPost: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling CustomerNoteApi->customerNoteControllerGetOne: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -209,11 +203,12 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **createCustomerNoteDto** | [**\Yoast\MyYoastApiClient\Model\CreateCustomerNoteDto**](../Model/CreateCustomerNoteDto.md)| | + **id** | [**string**](../Model/.md)| | + **filter** | [**object**](../Model/.md)| Used for filtering/joining the results. | [optional] ### Return type -void (empty response body) +[**\Yoast\MyYoastApiClient\Model\CustomerNote**](../Model/CustomerNote.md) ### Authorization @@ -221,7 +216,7 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) diff --git a/docs/Api/DownloadApi.md b/docs/Api/DownloadApi.md index a78d833..fe93fd2 100644 --- a/docs/Api/DownloadApi.md +++ b/docs/Api/DownloadApi.md @@ -1,15 +1,14 @@ # Yoast\MyYoastApiClient\DownloadApi -All URIs are relative to *http://my.yoast.test:3000* +All URIs are relative to */* Method | HTTP request | Description ------------- | ------------- | ------------- -[**apiDownloadsFileNameGet**](DownloadApi.md#apiDownloadsFileNameGet) | **GET** /api/downloads/file/{name} | Route to download a file -[**apiDownloadsFileNamePost**](DownloadApi.md#apiDownloadsFileNamePost) | **POST** /api/downloads/file/{name} | Route to update a file. +[**downloadControllerDownloadFile**](DownloadApi.md#downloadcontrollerdownloadfile) | **GET** /api/downloads/file/{name} | Route to download a file +[**downloadControllerUploadFile**](DownloadApi.md#downloadcontrolleruploadfile) | **POST** /api/downloads/file/{name} | Route to update a file. - -# **apiDownloadsFileNameGet** -> apiDownloadsFileNameGet($version, $pluginVersion, $site, $name) +# **downloadControllerDownloadFile** +> object downloadControllerDownloadFile($name, $version, $pluginVersion, $site) Route to download a file @@ -25,15 +24,16 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\DownloadApi( // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); +$name = "name_example"; // string | $version = "version_example"; // string | $pluginVersion = "pluginVersion_example"; // string | $site = "site_example"; // string | -$name = "name_example"; // string | try { - $apiInstance->apiDownloadsFileNameGet($version, $pluginVersion, $site, $name); + $result = $apiInstance->downloadControllerDownloadFile($name, $version, $pluginVersion, $site); + print_r($result); } catch (Exception $e) { - echo 'Exception when calling DownloadApi->apiDownloadsFileNameGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling DownloadApi->downloadControllerDownloadFile: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -42,14 +42,14 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- + **name** | **string**| | **version** | **string**| | **pluginVersion** | **string**| | **site** | **string**| | - **name** | **string**| | ### Return type -void (empty response body) +**object** ### Authorization @@ -57,13 +57,13 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiDownloadsFileNamePost** -> object apiDownloadsFileNamePost($updateFileDto, $name) +# **downloadControllerUploadFile** +> object downloadControllerUploadFile($body, $name) Route to update a file. @@ -79,14 +79,14 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\DownloadApi( // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); -$updateFileDto = new \Yoast\MyYoastApiClient\Model\UpdateFileDto(); // \Yoast\MyYoastApiClient\Model\UpdateFileDto | +$body = new \Yoast\MyYoastApiClient\Model\UpdateFileDto(); // \Yoast\MyYoastApiClient\Model\UpdateFileDto | $name = "name_example"; // string | try { - $result = $apiInstance->apiDownloadsFileNamePost($updateFileDto, $name); + $result = $apiInstance->downloadControllerUploadFile($body, $name); print_r($result); } catch (Exception $e) { - echo 'Exception when calling DownloadApi->apiDownloadsFileNamePost: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling DownloadApi->downloadControllerUploadFile: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -95,7 +95,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **updateFileDto** | [**\Yoast\MyYoastApiClient\Model\UpdateFileDto**](../Model/UpdateFileDto.md)| | + **body** | [**\Yoast\MyYoastApiClient\Model\UpdateFileDto**](../Model/UpdateFileDto.md)| | **name** | **string**| | ### Return type diff --git a/docs/Api/EDDApi.md b/docs/Api/EDDApi.md index 77f4c3e..5cd9657 100644 --- a/docs/Api/EDDApi.md +++ b/docs/Api/EDDApi.md @@ -1,15 +1,14 @@ # Yoast\MyYoastApiClient\EDDApi -All URIs are relative to *http://my.yoast.test:3000* +All URIs are relative to */* Method | HTTP request | Description ------------- | ------------- | ------------- -[**eddSlApiGet**](EDDApi.md#eddSlApiGet) | **GET** /edd-sl-api | Activate or deactivate a site license -[**eddSlApiPost**](EDDApi.md#eddSlApiPost) | **POST** /edd-sl-api | +[**eddControllerHandleGetRequest**](EDDApi.md#eddcontrollerhandlegetrequest) | **GET** /edd-sl-api | Activate or deactivate a site license +[**eddControllerHandlePostRequest**](EDDApi.md#eddcontrollerhandlepostrequest) | **POST** /edd-sl-api | - -# **eddSlApiGet** -> eddSlApiGet($eddAction, $url, $itemName) +# **eddControllerHandleGetRequest** +> eddControllerHandleGetRequest($eddAction, $url, $itemName) Activate or deactivate a site license @@ -30,9 +29,9 @@ $url = "url_example"; // string | $itemName = "itemName_example"; // string | try { - $apiInstance->eddSlApiGet($eddAction, $url, $itemName); + $apiInstance->eddControllerHandleGetRequest($eddAction, $url, $itemName); } catch (Exception $e) { - echo 'Exception when calling EDDApi->eddSlApiGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling EDDApi->eddControllerHandleGetRequest: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -55,13 +54,13 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json + - **Content-Type**: Not defined + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **eddSlApiPost** -> eddSlApiPost($eddDTO, $eddAction) +# **eddControllerHandlePostRequest** +> eddControllerHandlePostRequest($body, $eddAction) @@ -75,13 +74,13 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\EDDApi( // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); -$eddDTO = new \Yoast\MyYoastApiClient\Model\EddDTO(); // \Yoast\MyYoastApiClient\Model\EddDTO | +$body = new \Yoast\MyYoastApiClient\Model\EddDTO(); // \Yoast\MyYoastApiClient\Model\EddDTO | $eddAction = "eddAction_example"; // string | try { - $apiInstance->eddSlApiPost($eddDTO, $eddAction); + $apiInstance->eddControllerHandlePostRequest($body, $eddAction); } catch (Exception $e) { - echo 'Exception when calling EDDApi->eddSlApiPost: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling EDDApi->eddControllerHandlePostRequest: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -90,7 +89,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **eddDTO** | [**\Yoast\MyYoastApiClient\Model\EddDTO**](../Model/EddDTO.md)| | + **body** | [**\Yoast\MyYoastApiClient\Model\EddDTO**](../Model/EddDTO.md)| | **eddAction** | **string**| | ### Return type @@ -104,7 +103,7 @@ No authorization required ### HTTP request headers - **Content-Type**: application/json - - **Accept**: application/json + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) diff --git a/docs/Api/EmailApi.md b/docs/Api/EmailApi.md new file mode 100644 index 0000000..d9853a6 --- /dev/null +++ b/docs/Api/EmailApi.md @@ -0,0 +1,60 @@ +# Yoast\MyYoastApiClient\EmailApi + +All URIs are relative to */* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**emailControllerSendEmails**](EmailApi.md#emailcontrollersendemails) | **POST** /api/Emails/bulk-send | + +# **emailControllerSendEmails** +> int emailControllerSendEmails($body) + + + +### Example +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Yoast\MyYoastApiClient\Api\EmailApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$body = new \Yoast\MyYoastApiClient\Model\BulkSendEmailDto(); // \Yoast\MyYoastApiClient\Model\BulkSendEmailDto | + +try { + $result = $apiInstance->emailControllerSendEmails($body); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmailApi->emailControllerSendEmails: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**\Yoast\MyYoastApiClient\Model\BulkSendEmailDto**](../Model/BulkSendEmailDto.md)| | + +### Return type + +**int** + +### Authorization + +[bearer](../../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/docs/Api/ExportOrdersApi.md b/docs/Api/ExportOrdersApi.md index a8209d6..ce70c76 100644 --- a/docs/Api/ExportOrdersApi.md +++ b/docs/Api/ExportOrdersApi.md @@ -1,15 +1,14 @@ # Yoast\MyYoastApiClient\ExportOrdersApi -All URIs are relative to *http://my.yoast.test:3000* +All URIs are relative to */* Method | HTTP request | Description ------------- | ------------- | ------------- -[**exportOrdersV2FromToTypeGet**](ExportOrdersApi.md#exportOrdersV2FromToTypeGet) | **GET** /export-orders/v2/{from}/{to}/{type} | Creates an export for orders -[**exportOrdersYearMonthTypeGet**](ExportOrdersApi.md#exportOrdersYearMonthTypeGet) | **GET** /export-orders/{year}/{month}/{type} | Creates an export for orders +[**exportOrdersControllerExportOrders**](ExportOrdersApi.md#exportorderscontrollerexportorders) | **GET** /export-orders/{year}/{month}/{type} | Creates an export for orders +[**exportOrdersControllerExportOrdersV2**](ExportOrdersApi.md#exportorderscontrollerexportordersv2) | **GET** /export-orders/v2/{from}/{to}/{type} | Creates an export for orders - -# **exportOrdersV2FromToTypeGet** -> \SplFileObject exportOrdersV2FromToTypeGet($from, $to, $type, $password) +# **exportOrdersControllerExportOrders** +> string exportOrdersControllerExportOrders($year, $month, $type, $password) Creates an export for orders @@ -25,16 +24,16 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\ExportOrdersApi( // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); -$from = "from_example"; // string | -$to = "to_example"; // string | +$year = "year_example"; // string | +$month = "month_example"; // string | $type = "type_example"; // string | $password = "password_example"; // string | try { - $result = $apiInstance->exportOrdersV2FromToTypeGet($from, $to, $type, $password); + $result = $apiInstance->exportOrdersControllerExportOrders($year, $month, $type, $password); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ExportOrdersApi->exportOrdersV2FromToTypeGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ExportOrdersApi->exportOrdersControllerExportOrders: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -43,14 +42,14 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **from** | **string**| | - **to** | **string**| | + **year** | **string**| | + **month** | **string**| | **type** | **string**| | **password** | **string**| | [optional] ### Return type -[**\SplFileObject**](../Model/\SplFileObject.md) +**string** ### Authorization @@ -58,13 +57,13 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **exportOrdersYearMonthTypeGet** -> \SplFileObject exportOrdersYearMonthTypeGet($year, $month, $type, $password) +# **exportOrdersControllerExportOrdersV2** +> string exportOrdersControllerExportOrdersV2($from, $to, $type, $password) Creates an export for orders @@ -80,16 +79,16 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\ExportOrdersApi( // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); -$year = "year_example"; // string | -$month = "month_example"; // string | +$from = "from_example"; // string | +$to = "to_example"; // string | $type = "type_example"; // string | $password = "password_example"; // string | try { - $result = $apiInstance->exportOrdersYearMonthTypeGet($year, $month, $type, $password); + $result = $apiInstance->exportOrdersControllerExportOrdersV2($from, $to, $type, $password); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ExportOrdersApi->exportOrdersYearMonthTypeGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ExportOrdersApi->exportOrdersControllerExportOrdersV2: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -98,14 +97,14 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **year** | **string**| | - **month** | **string**| | + **from** | **string**| | + **to** | **string**| | **type** | **string**| | **password** | **string**| | [optional] ### Return type -[**\SplFileObject**](../Model/\SplFileObject.md) +**string** ### Authorization @@ -113,7 +112,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) diff --git a/docs/Api/FromWooCommerceApi.md b/docs/Api/FromWooCommerceApi.md index f3b6140..d1ee97f 100644 --- a/docs/Api/FromWooCommerceApi.md +++ b/docs/Api/FromWooCommerceApi.md @@ -1,17 +1,16 @@ # Yoast\MyYoastApiClient\FromWooCommerceApi -All URIs are relative to *http://my.yoast.test:3000* +All URIs are relative to */* Method | HTTP request | Description ------------- | ------------- | ------------- -[**apiCustomersFromWooCommercePut**](FromWooCommerceApi.md#apiCustomersFromWooCommercePut) | **PUT** /api/Customers/fromWooCommerce | Update or create a customer -[**apiOrdersFromWooCommercePut**](FromWooCommerceApi.md#apiOrdersFromWooCommercePut) | **PUT** /api/Orders/fromWooCommerce | Sync orders to MyYoast. -[**apiProductGroupsFromWooCommercePut**](FromWooCommerceApi.md#apiProductGroupsFromWooCommercePut) | **PUT** /api/ProductGroups/fromWooCommerce | Sync products to MyYoast. -[**apiProductsFromWooCommercePut**](FromWooCommerceApi.md#apiProductsFromWooCommercePut) | **PUT** /api/Products/fromWooCommerce | Sync products to MyYoast. +[**fromWooCommerceControllerCustomerFromWooCommerce**](FromWooCommerceApi.md#fromwoocommercecontrollercustomerfromwoocommerce) | **PUT** /api/Customers/fromWooCommerce | Update or create a customer +[**fromWooCommerceControllerOrderFromWooCommerce**](FromWooCommerceApi.md#fromwoocommercecontrollerorderfromwoocommerce) | **PUT** /api/Orders/fromWooCommerce | Sync orders to MyYoast. +[**fromWooCommerceControllerProductFromWooCommerce**](FromWooCommerceApi.md#fromwoocommercecontrollerproductfromwoocommerce) | **PUT** /api/Products/fromWooCommerce | Sync products to MyYoast. +[**fromWooCommerceControllerProductGroupFromWooCommerce**](FromWooCommerceApi.md#fromwoocommercecontrollerproductgroupfromwoocommerce) | **PUT** /api/ProductGroups/fromWooCommerce | Sync products to MyYoast. - -# **apiCustomersFromWooCommercePut** -> \Yoast\MyYoastApiClient\Model\Customer apiCustomersFromWooCommercePut($customerFromWooDto) +# **fromWooCommerceControllerCustomerFromWooCommerce** +> \Yoast\MyYoastApiClient\Model\Customer fromWooCommerceControllerCustomerFromWooCommerce($body) Update or create a customer @@ -21,11 +20,10 @@ This endpoint can be used by WooCommerce to update or create a customer in the M ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\FromWooCommerceApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -33,13 +31,13 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\FromWooCommerceApi( new GuzzleHttp\Client(), $config ); -$customerFromWooDto = new \Yoast\MyYoastApiClient\Model\CustomerFromWooDto(); // \Yoast\MyYoastApiClient\Model\CustomerFromWooDto | +$body = new \Yoast\MyYoastApiClient\Model\CustomerFromWooDto(); // \Yoast\MyYoastApiClient\Model\CustomerFromWooDto | try { - $result = $apiInstance->apiCustomersFromWooCommercePut($customerFromWooDto); + $result = $apiInstance->fromWooCommerceControllerCustomerFromWooCommerce($body); print_r($result); } catch (Exception $e) { - echo 'Exception when calling FromWooCommerceApi->apiCustomersFromWooCommercePut: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling FromWooCommerceApi->fromWooCommerceControllerCustomerFromWooCommerce: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -48,7 +46,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **customerFromWooDto** | [**\Yoast\MyYoastApiClient\Model\CustomerFromWooDto**](../Model/CustomerFromWooDto.md)| | + **body** | [**\Yoast\MyYoastApiClient\Model\CustomerFromWooDto**](../Model/CustomerFromWooDto.md)| | ### Return type @@ -65,8 +63,8 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiOrdersFromWooCommercePut** -> \Yoast\MyYoastApiClient\Model\Order apiOrdersFromWooCommercePut($orderFromWooDto) +# **fromWooCommerceControllerOrderFromWooCommerce** +> \Yoast\MyYoastApiClient\Model\Order fromWooCommerceControllerOrderFromWooCommerce($body) Sync orders to MyYoast. @@ -76,11 +74,10 @@ This route allows WooCommerce to sync order data to MyYoast. ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\FromWooCommerceApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -88,13 +85,13 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\FromWooCommerceApi( new GuzzleHttp\Client(), $config ); -$orderFromWooDto = new \Yoast\MyYoastApiClient\Model\OrderFromWooDto(); // \Yoast\MyYoastApiClient\Model\OrderFromWooDto | +$body = new \Yoast\MyYoastApiClient\Model\OrderFromWooDto(); // \Yoast\MyYoastApiClient\Model\OrderFromWooDto | try { - $result = $apiInstance->apiOrdersFromWooCommercePut($orderFromWooDto); + $result = $apiInstance->fromWooCommerceControllerOrderFromWooCommerce($body); print_r($result); } catch (Exception $e) { - echo 'Exception when calling FromWooCommerceApi->apiOrdersFromWooCommercePut: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling FromWooCommerceApi->fromWooCommerceControllerOrderFromWooCommerce: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -103,7 +100,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **orderFromWooDto** | [**\Yoast\MyYoastApiClient\Model\OrderFromWooDto**](../Model/OrderFromWooDto.md)| | + **body** | [**\Yoast\MyYoastApiClient\Model\OrderFromWooDto**](../Model/OrderFromWooDto.md)| | ### Return type @@ -120,8 +117,8 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiProductGroupsFromWooCommercePut** -> \Yoast\MyYoastApiClient\Model\ProductGroup apiProductGroupsFromWooCommercePut($productGroupFromWooDto) +# **fromWooCommerceControllerProductFromWooCommerce** +> \Yoast\MyYoastApiClient\Model\Product fromWooCommerceControllerProductFromWooCommerce($body) Sync products to MyYoast. @@ -131,11 +128,10 @@ This route allows WooCommerce to sync product data to MyYoast. ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\FromWooCommerceApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -143,13 +139,13 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\FromWooCommerceApi( new GuzzleHttp\Client(), $config ); -$productGroupFromWooDto = new \Yoast\MyYoastApiClient\Model\ProductGroupFromWooDto(); // \Yoast\MyYoastApiClient\Model\ProductGroupFromWooDto | +$body = new \Yoast\MyYoastApiClient\Model\ProductFromWooDto(); // \Yoast\MyYoastApiClient\Model\ProductFromWooDto | try { - $result = $apiInstance->apiProductGroupsFromWooCommercePut($productGroupFromWooDto); + $result = $apiInstance->fromWooCommerceControllerProductFromWooCommerce($body); print_r($result); } catch (Exception $e) { - echo 'Exception when calling FromWooCommerceApi->apiProductGroupsFromWooCommercePut: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling FromWooCommerceApi->fromWooCommerceControllerProductFromWooCommerce: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -158,11 +154,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **productGroupFromWooDto** | [**\Yoast\MyYoastApiClient\Model\ProductGroupFromWooDto**](../Model/ProductGroupFromWooDto.md)| | + **body** | [**\Yoast\MyYoastApiClient\Model\ProductFromWooDto**](../Model/ProductFromWooDto.md)| | ### Return type -[**\Yoast\MyYoastApiClient\Model\ProductGroup**](../Model/ProductGroup.md) +[**\Yoast\MyYoastApiClient\Model\Product**](../Model/Product.md) ### Authorization @@ -175,8 +171,8 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiProductsFromWooCommercePut** -> \Yoast\MyYoastApiClient\Model\Product apiProductsFromWooCommercePut($productFromWooDto) +# **fromWooCommerceControllerProductGroupFromWooCommerce** +> \Yoast\MyYoastApiClient\Model\ProductGroup fromWooCommerceControllerProductGroupFromWooCommerce($body) Sync products to MyYoast. @@ -186,11 +182,10 @@ This route allows WooCommerce to sync product data to MyYoast. ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\FromWooCommerceApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -198,13 +193,13 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\FromWooCommerceApi( new GuzzleHttp\Client(), $config ); -$productFromWooDto = new \Yoast\MyYoastApiClient\Model\ProductFromWooDto(); // \Yoast\MyYoastApiClient\Model\ProductFromWooDto | +$body = new \Yoast\MyYoastApiClient\Model\ProductGroupFromWooDto(); // \Yoast\MyYoastApiClient\Model\ProductGroupFromWooDto | try { - $result = $apiInstance->apiProductsFromWooCommercePut($productFromWooDto); + $result = $apiInstance->fromWooCommerceControllerProductGroupFromWooCommerce($body); print_r($result); } catch (Exception $e) { - echo 'Exception when calling FromWooCommerceApi->apiProductsFromWooCommercePut: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling FromWooCommerceApi->fromWooCommerceControllerProductGroupFromWooCommerce: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -213,11 +208,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **productFromWooDto** | [**\Yoast\MyYoastApiClient\Model\ProductFromWooDto**](../Model/ProductFromWooDto.md)| | + **body** | [**\Yoast\MyYoastApiClient\Model\ProductGroupFromWooDto**](../Model/ProductGroupFromWooDto.md)| | ### Return type -[**\Yoast\MyYoastApiClient\Model\Product**](../Model/Product.md) +[**\Yoast\MyYoastApiClient\Model\ProductGroup**](../Model/ProductGroup.md) ### Authorization diff --git a/docs/Api/GDPRApi.md b/docs/Api/GDPRApi.md new file mode 100644 index 0000000..1d6bec4 --- /dev/null +++ b/docs/Api/GDPRApi.md @@ -0,0 +1,62 @@ +# Yoast\MyYoastApiClient\GDPRApi + +All URIs are relative to */* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**customerGDPRControllerDeleteCustomer**](GDPRApi.md#customergdprcontrollerdeletecustomer) | **DELETE** /api/Customers/{id}/gdpr-delete | Performs a \"GDPR forget me\" request. + +# **customerGDPRControllerDeleteCustomer** +> string customerGDPRControllerDeleteCustomer($id) + +Performs a \"GDPR forget me\" request. + +Deletes and/or obfuscates all data related to a customer, except order data that we legally need to generate invoices. + +### Example +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Yoast\MyYoastApiClient\Api\GDPRApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | + +try { + $result = $apiInstance->customerGDPRControllerDeleteCustomer($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling GDPRApi->customerGDPRControllerDeleteCustomer: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | [**string**](../Model/.md)| | + +### Return type + +**string** + +### Authorization + +[bearer](../../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/docs/Api/HelpscoutApi.md b/docs/Api/HelpscoutApi.md index a5f4466..8806ca7 100644 --- a/docs/Api/HelpscoutApi.md +++ b/docs/Api/HelpscoutApi.md @@ -1,14 +1,13 @@ # Yoast\MyYoastApiClient\HelpscoutApi -All URIs are relative to *http://my.yoast.test:3000* +All URIs are relative to */* Method | HTTP request | Description ------------- | ------------- | ------------- -[**helpscoutPost**](HelpscoutApi.md#helpscoutPost) | **POST** /helpscout | Get information about a customer +[**helpScoutControllerHelpscout**](HelpscoutApi.md#helpscoutcontrollerhelpscout) | **POST** /helpscout | Get information about a customer - -# **helpscoutPost** -> object helpscoutPost($helpScoutDto, $xHelpScoutSignature) +# **helpScoutControllerHelpscout** +> object helpScoutControllerHelpscout($body, $xHelpScoutSignature) Get information about a customer @@ -24,14 +23,14 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\HelpscoutApi( // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); -$helpScoutDto = new \Yoast\MyYoastApiClient\Model\HelpScoutDto(); // \Yoast\MyYoastApiClient\Model\HelpScoutDto | +$body = new \Yoast\MyYoastApiClient\Model\HelpScoutDto(); // \Yoast\MyYoastApiClient\Model\HelpScoutDto | $xHelpScoutSignature = "xHelpScoutSignature_example"; // string | The Helpscout signature try { - $result = $apiInstance->helpscoutPost($helpScoutDto, $xHelpScoutSignature); + $result = $apiInstance->helpScoutControllerHelpscout($body, $xHelpScoutSignature); print_r($result); } catch (Exception $e) { - echo 'Exception when calling HelpscoutApi->helpscoutPost: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling HelpscoutApi->helpScoutControllerHelpscout: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -40,7 +39,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **helpScoutDto** | [**\Yoast\MyYoastApiClient\Model\HelpScoutDto**](../Model/HelpScoutDto.md)| | + **body** | [**\Yoast\MyYoastApiClient\Model\HelpScoutDto**](../Model/HelpScoutDto.md)| | **xHelpScoutSignature** | **string**| The Helpscout signature | ### Return type diff --git a/docs/Api/OrderApi.md b/docs/Api/OrderApi.md index b227370..507c672 100644 --- a/docs/Api/OrderApi.md +++ b/docs/Api/OrderApi.md @@ -1,31 +1,32 @@ # Yoast\MyYoastApiClient\OrderApi -All URIs are relative to *http://my.yoast.test:3000* +All URIs are relative to */* Method | HTTP request | Description ------------- | ------------- | ------------- -[**apiOrdersAutoRenewalCountGet**](OrderApi.md#apiOrdersAutoRenewalCountGet) | **GET** /api/Orders/auto-renewal-count | -[**apiOrdersExportGet**](OrderApi.md#apiOrdersExportGet) | **GET** /api/Orders/export | Get orders -[**apiOrdersGet**](OrderApi.md#apiOrdersGet) | **GET** /api/Orders | Get orders -[**apiOrdersIdGet**](OrderApi.md#apiOrdersIdGet) | **GET** /api/Orders/{id} | Get a order -[**apiOrdersIdInvoiceGet**](OrderApi.md#apiOrdersIdInvoiceGet) | **GET** /api/Orders/{id}/invoice | Create invoice -[**apiOrdersIdRefundsRefundIdInvoiceGet**](OrderApi.md#apiOrdersIdRefundsRefundIdInvoiceGet) | **GET** /api/Orders/{id}/refunds/{refundId}/invoice | Creates a credit note +[**orderControllerExport**](OrderApi.md#ordercontrollerexport) | **GET** /api/Orders/export | Get orders +[**orderControllerGetAutoRenewalCount**](OrderApi.md#ordercontrollergetautorenewalcount) | **GET** /api/Orders/auto-renewal-count | +[**orderControllerGetMany**](OrderApi.md#ordercontrollergetmany) | **GET** /api/Orders | Get orders +[**orderControllerGetManyPaged**](OrderApi.md#ordercontrollergetmanypaged) | **GET** /api/Orders/paged | Get orders +[**orderControllerGetOne**](OrderApi.md#ordercontrollergetone) | **GET** /api/Orders/{id} | Get a order +[**orderControllerInvoice**](OrderApi.md#ordercontrollerinvoice) | **GET** /api/Orders/{id}/invoice | Create invoice +[**orderControllerRefundInvoice**](OrderApi.md#ordercontrollerrefundinvoice) | **GET** /api/Orders/{id}/refunds/{refundId}/invoice | Creates a credit note +# **orderControllerExport** +> \Yoast\MyYoastApiClient\Model\Order[] orderControllerExport($startDate, $endDate) -# **apiOrdersAutoRenewalCountGet** -> \Yoast\MyYoastApiClient\Model\AutoRenewalCountResponseDto apiOrdersAutoRenewalCountGet($startDate, $endDate, $secret) - +Get orders +A large export of orders between dates ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\OrderApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -35,13 +36,12 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\OrderApi( ); $startDate = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | $endDate = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | -$secret = "secret_example"; // string | try { - $result = $apiInstance->apiOrdersAutoRenewalCountGet($startDate, $endDate, $secret); + $result = $apiInstance->orderControllerExport($startDate, $endDate); print_r($result); } catch (Exception $e) { - echo 'Exception when calling OrderApi->apiOrdersAutoRenewalCountGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling OrderApi->orderControllerExport: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -52,11 +52,10 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **startDate** | **\DateTime**| | **endDate** | **\DateTime**| | - **secret** | **string**| | ### Return type -[**\Yoast\MyYoastApiClient\Model\AutoRenewalCountResponseDto**](../Model/AutoRenewalCountResponseDto.md) +[**\Yoast\MyYoastApiClient\Model\Order[]**](../Model/Order.md) ### Authorization @@ -64,27 +63,24 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiOrdersExportGet** -> \Yoast\MyYoastApiClient\Model\Order[] apiOrdersExportGet($startDate, $endDate) +# **orderControllerGetAutoRenewalCount** +> \Yoast\MyYoastApiClient\Model\AutoRenewalCountResponseDto orderControllerGetAutoRenewalCount($startDate, $endDate, $secret) -Get orders -A large export of orders between dates ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\OrderApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -94,12 +90,13 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\OrderApi( ); $startDate = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | $endDate = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | +$secret = "secret_example"; // string | try { - $result = $apiInstance->apiOrdersExportGet($startDate, $endDate); + $result = $apiInstance->orderControllerGetAutoRenewalCount($startDate, $endDate, $secret); print_r($result); } catch (Exception $e) { - echo 'Exception when calling OrderApi->apiOrdersExportGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling OrderApi->orderControllerGetAutoRenewalCount: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -110,10 +107,11 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **startDate** | **\DateTime**| | **endDate** | **\DateTime**| | + **secret** | **string**| | ### Return type -[**\Yoast\MyYoastApiClient\Model\Order[]**](../Model/Order.md) +[**\Yoast\MyYoastApiClient\Model\AutoRenewalCountResponseDto**](../Model/AutoRenewalCountResponseDto.md) ### Authorization @@ -121,13 +119,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiOrdersGet** -> \Yoast\MyYoastApiClient\Model\Order[] apiOrdersGet($filter) +# **orderControllerGetMany** +> \Yoast\MyYoastApiClient\Model\Order[] orderControllerGetMany($filter) Get orders @@ -137,11 +135,10 @@ Get and filter orders ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\OrderApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -149,13 +146,13 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\OrderApi( new GuzzleHttp\Client(), $config ); -$filter = array('key' => "filter_example"); // map[string,string] | Used for filtering/joining the results. +$filter = new \stdClass; // object | Used for filtering/joining the results. try { - $result = $apiInstance->apiOrdersGet($filter); + $result = $apiInstance->orderControllerGetMany($filter); print_r($result); } catch (Exception $e) { - echo 'Exception when calling OrderApi->apiOrdersGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling OrderApi->orderControllerGetMany: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -164,7 +161,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **filter** | [**map[string,string]**](../Model/string.md)| Used for filtering/joining the results. | [optional] + **filter** | [**object**](../Model/.md)| Used for filtering/joining the results. | [optional] ### Return type @@ -176,13 +173,66 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiOrdersIdGet** -> \Yoast\MyYoastApiClient\Model\Order apiOrdersIdGet($id, $filter) +# **orderControllerGetManyPaged** +> orderControllerGetManyPaged($filter) + +Get orders + +Get and filter orders + +### Example +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Yoast\MyYoastApiClient\Api\OrderApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$filter = new \stdClass; // object | Used for filtering/joining the results. + +try { + $apiInstance->orderControllerGetManyPaged($filter); +} catch (Exception $e) { + echo 'Exception when calling OrderApi->orderControllerGetManyPaged: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **filter** | [**object**](../Model/.md)| Used for filtering/joining the results. | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[bearer](../../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **orderControllerGetOne** +> \Yoast\MyYoastApiClient\Model\Order orderControllerGetOne($id, $filter) Get a order @@ -192,11 +242,10 @@ Get a single order ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\OrderApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -204,14 +253,14 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\OrderApi( new GuzzleHttp\Client(), $config ); -$id = "id_example"; // string | -$filter = array('key' => "filter_example"); // map[string,string] | Used for filtering/joining the results. +$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | +$filter = new \stdClass; // object | Used for filtering/joining the results. try { - $result = $apiInstance->apiOrdersIdGet($id, $filter); + $result = $apiInstance->orderControllerGetOne($id, $filter); print_r($result); } catch (Exception $e) { - echo 'Exception when calling OrderApi->apiOrdersIdGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling OrderApi->orderControllerGetOne: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -221,7 +270,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | [**string**](../Model/.md)| | - **filter** | [**map[string,string]**](../Model/string.md)| Used for filtering/joining the results. | [optional] + **filter** | [**object**](../Model/.md)| Used for filtering/joining the results. | [optional] ### Return type @@ -233,13 +282,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiOrdersIdInvoiceGet** -> apiOrdersIdInvoiceGet($id) +# **orderControllerInvoice** +> orderControllerInvoice($id) Create invoice @@ -249,11 +298,10 @@ Creates a PDF for an invoice ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\OrderApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -261,12 +309,12 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\OrderApi( new GuzzleHttp\Client(), $config ); -$id = "id_example"; // string | +$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | try { - $apiInstance->apiOrdersIdInvoiceGet($id); + $apiInstance->orderControllerInvoice($id); } catch (Exception $e) { - echo 'Exception when calling OrderApi->apiOrdersIdInvoiceGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling OrderApi->orderControllerInvoice: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -287,13 +335,13 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json + - **Content-Type**: Not defined + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiOrdersIdRefundsRefundIdInvoiceGet** -> apiOrdersIdRefundsRefundIdInvoiceGet($id, $refundId) +# **orderControllerRefundInvoice** +> orderControllerRefundInvoice($id, $refundId) Creates a credit note @@ -303,11 +351,10 @@ Creates a PDF for a credit note ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\OrderApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -319,9 +366,9 @@ $id = "id_example"; // string | $refundId = "refundId_example"; // string | try { - $apiInstance->apiOrdersIdRefundsRefundIdInvoiceGet($id, $refundId); + $apiInstance->orderControllerRefundInvoice($id, $refundId); } catch (Exception $e) { - echo 'Exception when calling OrderApi->apiOrdersIdRefundsRefundIdInvoiceGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling OrderApi->orderControllerRefundInvoice: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -343,8 +390,8 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json + - **Content-Type**: Not defined + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) diff --git a/docs/Api/PackagesApi.md b/docs/Api/PackagesApi.md index d8831da..391c6bd 100644 --- a/docs/Api/PackagesApi.md +++ b/docs/Api/PackagesApi.md @@ -1,16 +1,16 @@ # Yoast\MyYoastApiClient\PackagesApi -All URIs are relative to *http://my.yoast.test:3000* +All URIs are relative to */* Method | HTTP request | Description ------------- | ------------- | ------------- -[**packagesDistOrgNameArchiveZipGet**](PackagesApi.md#packagesDistOrgNameArchiveZipGet) | **GET** /packages/dist/{org}/{name}/{archive}.zip | Serves an .zip of the plugin. -[**packagesPOrgNameAndHashJsonGet**](PackagesApi.md#packagesPOrgNameAndHashJsonGet) | **GET** /packages/p/{org}/{nameAndHash}.json | Serves the requested provider.json -[**packagesPackagesJsonGet**](PackagesApi.md#packagesPackagesJsonGet) | **GET** /packages/packages.json | Serves the general packages.json file. +[**packagesControllerServeArchiveZIP**](PackagesApi.md#packagescontrollerservearchivezip) | **GET** /packages/dist/{org}/{name}/{archive}.zip | Serves an .zip of the plugin. +[**packagesControllerServePackagesJSON**](PackagesApi.md#packagescontrollerservepackagesjson) | **GET** /packages/packages.json | Serves the general packages.json file. +[**packagesControllerServeProvider2JSON**](PackagesApi.md#packagescontrollerserveprovider2json) | **GET** /packages/p2/{org}/{name}.json | Serves the requested provider.json +[**packagesControllerServeProviderJSON**](PackagesApi.md#packagescontrollerserveproviderjson) | **GET** /packages/p/{org}/{nameAndHash}.json | Serves the requested provider.json - -# **packagesDistOrgNameArchiveZipGet** -> \SplFileObject packagesDistOrgNameArchiveZipGet($org, $archive, $name) +# **packagesControllerServeArchiveZIP** +> string packagesControllerServeArchiveZIP($org, $archive, $name) Serves an .zip of the plugin. @@ -31,10 +31,10 @@ $archive = "archive_example"; // string | $name = "name_example"; // string | try { - $result = $apiInstance->packagesDistOrgNameArchiveZipGet($org, $archive, $name); + $result = $apiInstance->packagesControllerServeArchiveZIP($org, $archive, $name); print_r($result); } catch (Exception $e) { - echo 'Exception when calling PackagesApi->packagesDistOrgNameArchiveZipGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling PackagesApi->packagesControllerServeArchiveZIP: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -49,7 +49,52 @@ Name | Type | Description | Notes ### Return type -[**\SplFileObject**](../Model/\SplFileObject.md) +**string** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **packagesControllerServePackagesJSON** +> string packagesControllerServePackagesJSON() + +Serves the general packages.json file. + +Serves the general packages.json file. + +### Example +```php +packagesControllerServePackagesJSON(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling PackagesApi->packagesControllerServePackagesJSON: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**string** ### Authorization @@ -57,13 +102,13 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **packagesPOrgNameAndHashJsonGet** -> \SplFileObject packagesPOrgNameAndHashJsonGet($org, $nameAndHash) +# **packagesControllerServeProvider2JSON** +> string packagesControllerServeProvider2JSON($org, $name) Serves the requested provider.json @@ -80,13 +125,13 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\PackagesApi( new GuzzleHttp\Client() ); $org = "org_example"; // string | -$nameAndHash = "nameAndHash_example"; // string | The package name and package hash separated by a $ character +$name = "name_example"; // string | The package name, optionally suffixed with -dev try { - $result = $apiInstance->packagesPOrgNameAndHashJsonGet($org, $nameAndHash); + $result = $apiInstance->packagesControllerServeProvider2JSON($org, $name); print_r($result); } catch (Exception $e) { - echo 'Exception when calling PackagesApi->packagesPOrgNameAndHashJsonGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling PackagesApi->packagesControllerServeProvider2JSON: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -96,11 +141,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **org** | **string**| | - **nameAndHash** | **string**| The package name and package hash separated by a $ character | + **name** | **string**| The package name, optionally suffixed with -dev | ### Return type -[**\SplFileObject**](../Model/\SplFileObject.md) +**string** ### Authorization @@ -108,17 +153,17 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **packagesPackagesJsonGet** -> \SplFileObject packagesPackagesJsonGet() +# **packagesControllerServeProviderJSON** +> string packagesControllerServeProviderJSON($org, $nameAndHash) -Serves the general packages.json file. +Serves the requested provider.json -Serves the general packages.json file. +Serves the requested provider.json defined by the org, name and hash of the file. ### Example ```php @@ -130,22 +175,28 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\PackagesApi( // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); +$org = "org_example"; // string | +$nameAndHash = "nameAndHash_example"; // string | The package name and package hash separated by a $ character try { - $result = $apiInstance->packagesPackagesJsonGet(); + $result = $apiInstance->packagesControllerServeProviderJSON($org, $nameAndHash); print_r($result); } catch (Exception $e) { - echo 'Exception when calling PackagesApi->packagesPackagesJsonGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling PackagesApi->packagesControllerServeProviderJSON: ', $e->getMessage(), PHP_EOL; } ?> ``` ### Parameters -This endpoint does not need any parameter. + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **org** | **string**| | + **nameAndHash** | **string**| The package name and package hash separated by a $ character | ### Return type -[**\SplFileObject**](../Model/\SplFileObject.md) +**string** ### Authorization @@ -153,7 +204,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) diff --git a/docs/Api/ProductApi.md b/docs/Api/ProductApi.md index 04e3f59..951a615 100644 --- a/docs/Api/ProductApi.md +++ b/docs/Api/ProductApi.md @@ -1,21 +1,18 @@ # Yoast\MyYoastApiClient\ProductApi -All URIs are relative to *http://my.yoast.test:3000* +All URIs are relative to */* Method | HTTP request | Description ------------- | ------------- | ------------- -[**apiProductsGet**](ProductApi.md#apiProductsGet) | **GET** /api/Products | Get products -[**apiProductsIdGet**](ProductApi.md#apiProductsIdGet) | **GET** /api/Products/{id} | Get a product -[**apiProductsProductIdDelete**](ProductApi.md#apiProductsProductIdDelete) | **DELETE** /api/Products/{productId} | -[**apiProductsWordpressPluginVersionDetailsGet**](ProductApi.md#apiProductsWordpressPluginVersionDetailsGet) | **GET** /api/Products/wordpressPluginVersionDetails | +[**productControllerDeleteOne**](ProductApi.md#productcontrollerdeleteone) | **DELETE** /api/Products/{productId} | +[**productControllerGetMany**](ProductApi.md#productcontrollergetmany) | **GET** /api/Products | Get products +[**productControllerGetOne**](ProductApi.md#productcontrollergetone) | **GET** /api/Products/{id} | Get a product +[**productControllerPluginVersionDetails**](ProductApi.md#productcontrollerpluginversiondetails) | **GET** /api/Products/wordpressPluginVersionDetails | +# **productControllerDeleteOne** +> productControllerDeleteOne($id) -# **apiProductsGet** -> \Yoast\MyYoastApiClient\Model\Product[] apiProductsGet($filter) -Get products - -Get and filter products ### Example ```php @@ -27,13 +24,12 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\ProductApi( // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); -$filter = array('key' => "filter_example"); // map[string,string] | Used for filtering/joining the results. +$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | try { - $result = $apiInstance->apiProductsGet($filter); - print_r($result); + $apiInstance->productControllerDeleteOne($id); } catch (Exception $e) { - echo 'Exception when calling ProductApi->apiProductsGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ProductApi->productControllerDeleteOne: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -42,11 +38,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **filter** | [**map[string,string]**](../Model/string.md)| Used for filtering/joining the results. | [optional] + **id** | [**string**](../Model/.md)| | ### Return type -[**\Yoast\MyYoastApiClient\Model\Product[]**](../Model/Product.md) +void (empty response body) ### Authorization @@ -54,17 +50,17 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json + - **Content-Type**: Not defined + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiProductsIdGet** -> \Yoast\MyYoastApiClient\Model\Product apiProductsIdGet($id, $filter) +# **productControllerGetMany** +> \Yoast\MyYoastApiClient\Model\Product[] productControllerGetMany($filter) -Get a product +Get products -Get a single product +Get and filter products ### Example ```php @@ -76,14 +72,13 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\ProductApi( // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); -$id = "id_example"; // string | -$filter = array('key' => "filter_example"); // map[string,string] | Used for filtering/joining the results. +$filter = new \stdClass; // object | Used for filtering/joining the results. try { - $result = $apiInstance->apiProductsIdGet($id, $filter); + $result = $apiInstance->productControllerGetMany($filter); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ProductApi->apiProductsIdGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ProductApi->productControllerGetMany: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -92,12 +87,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | [**string**](../Model/.md)| | - **filter** | [**map[string,string]**](../Model/string.md)| Used for filtering/joining the results. | [optional] + **filter** | [**object**](../Model/.md)| Used for filtering/joining the results. | [optional] ### Return type -[**\Yoast\MyYoastApiClient\Model\Product**](../Model/Product.md) +[**\Yoast\MyYoastApiClient\Model\Product[]**](../Model/Product.md) ### Authorization @@ -105,15 +99,17 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiProductsProductIdDelete** -> apiProductsProductIdDelete($id) +# **productControllerGetOne** +> \Yoast\MyYoastApiClient\Model\Product productControllerGetOne($id, $filter) +Get a product +Get a single product ### Example ```php @@ -125,12 +121,14 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\ProductApi( // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client() ); -$id = "id_example"; // string | +$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | +$filter = new \stdClass; // object | Used for filtering/joining the results. try { - $apiInstance->apiProductsProductIdDelete($id); + $result = $apiInstance->productControllerGetOne($id, $filter); + print_r($result); } catch (Exception $e) { - echo 'Exception when calling ProductApi->apiProductsProductIdDelete: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ProductApi->productControllerGetOne: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -140,10 +138,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | [**string**](../Model/.md)| | + **filter** | [**object**](../Model/.md)| Used for filtering/joining the results. | [optional] ### Return type -void (empty response body) +[**\Yoast\MyYoastApiClient\Model\Product**](../Model/Product.md) ### Authorization @@ -151,13 +150,13 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiProductsWordpressPluginVersionDetailsGet** -> apiProductsWordpressPluginVersionDetailsGet($password) +# **productControllerPluginVersionDetails** +> productControllerPluginVersionDetails($password) @@ -174,9 +173,9 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\ProductApi( $password = "password_example"; // string | try { - $apiInstance->apiProductsWordpressPluginVersionDetailsGet($password); + $apiInstance->productControllerPluginVersionDetails($password); } catch (Exception $e) { - echo 'Exception when calling ProductApi->apiProductsWordpressPluginVersionDetailsGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ProductApi->productControllerPluginVersionDetails: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -197,8 +196,8 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json + - **Content-Type**: Not defined + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) diff --git a/docs/Api/ProductGroupApi.md b/docs/Api/ProductGroupApi.md index af5ab31..b8e9c98 100644 --- a/docs/Api/ProductGroupApi.md +++ b/docs/Api/ProductGroupApi.md @@ -1,14 +1,13 @@ # Yoast\MyYoastApiClient\ProductGroupApi -All URIs are relative to *http://my.yoast.test:3000* +All URIs are relative to */* Method | HTTP request | Description ------------- | ------------- | ------------- -[**apiProductGroupsGet**](ProductGroupApi.md#apiProductGroupsGet) | **GET** /api/ProductGroups | Get productgroups +[**productGroupControllerGetMany**](ProductGroupApi.md#productgroupcontrollergetmany) | **GET** /api/ProductGroups | Get productgroups - -# **apiProductGroupsGet** -> \Yoast\MyYoastApiClient\Model\ProductGroup[] apiProductGroupsGet($filter) +# **productGroupControllerGetMany** +> \Yoast\MyYoastApiClient\Model\ProductGroup[] productGroupControllerGetMany($filter) Get productgroups @@ -18,11 +17,10 @@ Get and filter productgroups ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\ProductGroupApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -30,13 +28,13 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\ProductGroupApi( new GuzzleHttp\Client(), $config ); -$filter = array('key' => "filter_example"); // map[string,string] | Used for filtering/joining the results. +$filter = new \stdClass; // object | Used for filtering/joining the results. try { - $result = $apiInstance->apiProductGroupsGet($filter); + $result = $apiInstance->productGroupControllerGetMany($filter); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ProductGroupApi->apiProductGroupsGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ProductGroupApi->productGroupControllerGetMany: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -45,7 +43,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **filter** | [**map[string,string]**](../Model/string.md)| Used for filtering/joining the results. | [optional] + **filter** | [**object**](../Model/.md)| Used for filtering/joining the results. | [optional] ### Return type @@ -57,7 +55,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) diff --git a/docs/Api/ProvisionerApi.md b/docs/Api/ProvisionerApi.md new file mode 100644 index 0000000..94b06fe --- /dev/null +++ b/docs/Api/ProvisionerApi.md @@ -0,0 +1,113 @@ +# Yoast\MyYoastApiClient\ProvisionerApi + +All URIs are relative to */* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**provisionerDataControllerGetMany**](ProvisionerApi.md#provisionerdatacontrollergetmany) | **GET** /api/ProvisionerData | Get provisioner data +[**provisionerDataControllerGetOne**](ProvisionerApi.md#provisionerdatacontrollergetone) | **GET** /api/ProvisionerData/{id} | Get provisioner data + +# **provisionerDataControllerGetMany** +> \Yoast\MyYoastApiClient\Model\ProvisionerData[] provisionerDataControllerGetMany() + +Get provisioner data + +Get and filter provisioner data + +### Example +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Yoast\MyYoastApiClient\Api\ProvisionerApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); + +try { + $result = $apiInstance->provisionerDataControllerGetMany(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ProvisionerApi->provisionerDataControllerGetMany: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**\Yoast\MyYoastApiClient\Model\ProvisionerData[]**](../Model/ProvisionerData.md) + +### Authorization + +[bearer](../../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **provisionerDataControllerGetOne** +> \Yoast\MyYoastApiClient\Model\Subscription provisionerDataControllerGetOne($id) + +Get provisioner data + +Get provisioner data + +### Example +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Yoast\MyYoastApiClient\Api\ProvisionerApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | + +try { + $result = $apiInstance->provisionerDataControllerGetOne($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ProvisionerApi->provisionerDataControllerGetOne: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | [**string**](../Model/.md)| | + +### Return type + +[**\Yoast\MyYoastApiClient\Model\Subscription**](../Model/Subscription.md) + +### Authorization + +[bearer](../../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/docs/Api/RefundApi.md b/docs/Api/RefundApi.md index 04886ec..6b8787a 100644 --- a/docs/Api/RefundApi.md +++ b/docs/Api/RefundApi.md @@ -1,16 +1,15 @@ # Yoast\MyYoastApiClient\RefundApi -All URIs are relative to *http://my.yoast.test:3000* +All URIs are relative to */* Method | HTTP request | Description ------------- | ------------- | ------------- -[**apiRefundsExportGet**](RefundApi.md#apiRefundsExportGet) | **GET** /api/Refunds/export | Get refunds -[**apiRefundsGet**](RefundApi.md#apiRefundsGet) | **GET** /api/Refunds | Get refunds -[**apiRefundsIdGet**](RefundApi.md#apiRefundsIdGet) | **GET** /api/Refunds/{id} | Get a refund +[**refundControllerExport**](RefundApi.md#refundcontrollerexport) | **GET** /api/Refunds/export | Get refunds +[**refundControllerGetMany**](RefundApi.md#refundcontrollergetmany) | **GET** /api/Refunds | Get refunds +[**refundControllerGetOne**](RefundApi.md#refundcontrollergetone) | **GET** /api/Refunds/{id} | Get a refund - -# **apiRefundsExportGet** -> \Yoast\MyYoastApiClient\Model\Refund[] apiRefundsExportGet($startDate, $endDate) +# **refundControllerExport** +> \Yoast\MyYoastApiClient\Model\Refund[] refundControllerExport($startDate, $endDate) Get refunds @@ -20,11 +19,10 @@ A large export of refunds between dates ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\RefundApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -36,10 +34,10 @@ $startDate = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | $endDate = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | try { - $result = $apiInstance->apiRefundsExportGet($startDate, $endDate); + $result = $apiInstance->refundControllerExport($startDate, $endDate); print_r($result); } catch (Exception $e) { - echo 'Exception when calling RefundApi->apiRefundsExportGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling RefundApi->refundControllerExport: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -61,13 +59,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiRefundsGet** -> \Yoast\MyYoastApiClient\Model\Refund[] apiRefundsGet($filter) +# **refundControllerGetMany** +> \Yoast\MyYoastApiClient\Model\Refund[] refundControllerGetMany($filter) Get refunds @@ -77,11 +75,10 @@ Get and filter refunds ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\RefundApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -89,13 +86,13 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\RefundApi( new GuzzleHttp\Client(), $config ); -$filter = array('key' => "filter_example"); // map[string,string] | Used for filtering/joining the results. +$filter = new \stdClass; // object | Used for filtering/joining the results. try { - $result = $apiInstance->apiRefundsGet($filter); + $result = $apiInstance->refundControllerGetMany($filter); print_r($result); } catch (Exception $e) { - echo 'Exception when calling RefundApi->apiRefundsGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling RefundApi->refundControllerGetMany: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -104,7 +101,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **filter** | [**map[string,string]**](../Model/string.md)| Used for filtering/joining the results. | [optional] + **filter** | [**object**](../Model/.md)| Used for filtering/joining the results. | [optional] ### Return type @@ -116,13 +113,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiRefundsIdGet** -> \Yoast\MyYoastApiClient\Model\Refund apiRefundsIdGet($id, $filter) +# **refundControllerGetOne** +> \Yoast\MyYoastApiClient\Model\Refund refundControllerGetOne($id, $filter) Get a refund @@ -132,11 +129,10 @@ Get a single refund ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\RefundApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -144,14 +140,14 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\RefundApi( new GuzzleHttp\Client(), $config ); -$id = "id_example"; // string | -$filter = array('key' => "filter_example"); // map[string,string] | Used for filtering/joining the results. +$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | +$filter = new \stdClass; // object | Used for filtering/joining the results. try { - $result = $apiInstance->apiRefundsIdGet($id, $filter); + $result = $apiInstance->refundControllerGetOne($id, $filter); print_r($result); } catch (Exception $e) { - echo 'Exception when calling RefundApi->apiRefundsIdGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling RefundApi->refundControllerGetOne: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -161,7 +157,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | [**string**](../Model/.md)| | - **filter** | [**map[string,string]**](../Model/string.md)| Used for filtering/joining the results. | [optional] + **filter** | [**object**](../Model/.md)| Used for filtering/joining the results. | [optional] ### Return type @@ -173,7 +169,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) diff --git a/docs/Api/RobotsApi.md b/docs/Api/RobotsApi.md index 34df8ff..dcf65ee 100644 --- a/docs/Api/RobotsApi.md +++ b/docs/Api/RobotsApi.md @@ -1,14 +1,13 @@ # Yoast\MyYoastApiClient\RobotsApi -All URIs are relative to *http://my.yoast.test:3000* +All URIs are relative to */* Method | HTTP request | Description ------------- | ------------- | ------------- -[**robotsTxtGet**](RobotsApi.md#robotsTxtGet) | **GET** /robots.txt | +[**robotsControllerServeRobots**](RobotsApi.md#robotscontrollerserverobots) | **GET** /robots.txt | - -# **robotsTxtGet** -> \SplFileObject robotsTxtGet() +# **robotsControllerServeRobots** +> string robotsControllerServeRobots() @@ -24,10 +23,10 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\RobotsApi( ); try { - $result = $apiInstance->robotsTxtGet(); + $result = $apiInstance->robotsControllerServeRobots(); print_r($result); } catch (Exception $e) { - echo 'Exception when calling RobotsApi->robotsTxtGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling RobotsApi->robotsControllerServeRobots: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -37,7 +36,7 @@ This endpoint does not need any parameter. ### Return type -[**\SplFileObject**](../Model/\SplFileObject.md) +**string** ### Authorization @@ -45,7 +44,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) diff --git a/docs/Api/ServerCheckApi.md b/docs/Api/ServerCheckApi.md index ee8a968..dcc1145 100644 --- a/docs/Api/ServerCheckApi.md +++ b/docs/Api/ServerCheckApi.md @@ -1,14 +1,13 @@ # Yoast\MyYoastApiClient\ServerCheckApi -All URIs are relative to *http://my.yoast.test:3000* +All URIs are relative to */* Method | HTTP request | Description ------------- | ------------- | ------------- -[**serverCheckGet**](ServerCheckApi.md#serverCheckGet) | **GET** /server-check | Server health check +[**serverHealthControllerCheckHealth**](ServerCheckApi.md#serverhealthcontrollercheckhealth) | **GET** /server-check | Server health check - -# **serverCheckGet** -> string serverCheckGet() +# **serverHealthControllerCheckHealth** +> string serverHealthControllerCheckHealth() Server health check @@ -26,10 +25,10 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\ServerCheckApi( ); try { - $result = $apiInstance->serverCheckGet(); + $result = $apiInstance->serverHealthControllerCheckHealth(); print_r($result); } catch (Exception $e) { - echo 'Exception when calling ServerCheckApi->serverCheckGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling ServerCheckApi->serverHealthControllerCheckHealth: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -47,7 +46,7 @@ No authorization required ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) diff --git a/docs/Api/SiteApi.md b/docs/Api/SiteApi.md index 36fb2de..6d74016 100644 --- a/docs/Api/SiteApi.md +++ b/docs/Api/SiteApi.md @@ -1,25 +1,25 @@ # Yoast\MyYoastApiClient\SiteApi -All URIs are relative to *http://my.yoast.test:3000* +All URIs are relative to */* Method | HTTP request | Description ------------- | ------------- | ------------- -[**apiSitesCurrentGet**](SiteApi.md#apiSitesCurrentGet) | **GET** /api/Sites/current | Get the current connected site for an access token. -[**apiSitesGet**](SiteApi.md#apiSitesGet) | **GET** /api/Sites | Get sites -[**apiSitesIdDelete**](SiteApi.md#apiSitesIdDelete) | **DELETE** /api/Sites/{id} | -[**apiSitesIdGet**](SiteApi.md#apiSitesIdGet) | **GET** /api/Sites/{id} | Get a site -[**apiSitesIdPatch**](SiteApi.md#apiSitesIdPatch) | **PATCH** /api/Sites/{id} | -[**apiSitesIdSubscriptionsPut**](SiteApi.md#apiSitesIdSubscriptionsPut) | **PUT** /api/Sites/{id}/subscriptions | Adds a subscription to a site -[**apiSitesIdSubscriptionsSubscriptionIdDelete**](SiteApi.md#apiSitesIdSubscriptionsSubscriptionIdDelete) | **DELETE** /api/Sites/{id}/subscriptions/{subscriptionId} | Removes a subscription from a site -[**apiSitesIndexPost**](SiteApi.md#apiSitesIndexPost) | **POST** /api/Sites/index | -[**apiSitesInfoGet**](SiteApi.md#apiSitesInfoGet) | **GET** /api/Sites/info | Get the current connected site for an access token. -[**apiSitesSwitchSubscriptionNumberOfTimesPost**](SiteApi.md#apiSitesSwitchSubscriptionNumberOfTimesPost) | **POST** /api/Sites/switchSubscriptionNumberOfTimes | Switches the subscription for a number of times. -[**apiSitesSwitchSubscriptionPost**](SiteApi.md#apiSitesSwitchSubscriptionPost) | **POST** /api/Sites/switchSubscription | Switches the subscription for a number of times. -[**apiSitesTransferPost**](SiteApi.md#apiSitesTransferPost) | **POST** /api/Sites/transfer | Transfer sites. - - -# **apiSitesCurrentGet** -> object apiSitesCurrentGet($token, $url) +[**siteControllerCurrent**](SiteApi.md#sitecontrollercurrent) | **GET** /api/Sites/current | Get the current connected site for an access token. +[**siteControllerCurrentClone**](SiteApi.md#sitecontrollercurrentclone) | **GET** /api/Sites/info | Get the current connected site for an access token. +[**siteControllerDeleteOne**](SiteApi.md#sitecontrollerdeleteone) | **DELETE** /api/Sites/{id} | +[**siteControllerGetMany**](SiteApi.md#sitecontrollergetmany) | **GET** /api/Sites | Get sites +[**siteControllerGetManyPaged**](SiteApi.md#sitecontrollergetmanypaged) | **GET** /api/Sites/paged | Get sites +[**siteControllerGetOne**](SiteApi.md#sitecontrollergetone) | **GET** /api/Sites/{id} | Get a site +[**siteControllerIndex**](SiteApi.md#sitecontrollerindex) | **POST** /api/Sites/index | +[**siteControllerSwitchSubscription**](SiteApi.md#sitecontrollerswitchsubscription) | **POST** /api/Sites/switchSubscription | Switches the subscription for a number of times. +[**siteControllerSwitchSubscriptionNumberOfTimes**](SiteApi.md#sitecontrollerswitchsubscriptionnumberoftimes) | **POST** /api/Sites/switchSubscriptionNumberOfTimes | Switches the subscription for a number of times. +[**siteControllerTransfer**](SiteApi.md#sitecontrollertransfer) | **POST** /api/Sites/transfer | Transfer sites. +[**siteControllerUpdateOne**](SiteApi.md#sitecontrollerupdateone) | **PATCH** /api/Sites/{id} | +[**siteSubscriptionControllerAddSubscription**](SiteApi.md#sitesubscriptioncontrolleraddsubscription) | **PUT** /api/Sites/{id}/subscriptions | Adds a subscription to a site +[**siteSubscriptionControllerRemoveSubscription**](SiteApi.md#sitesubscriptioncontrollerremovesubscription) | **DELETE** /api/Sites/{id}/subscriptions/{subscriptionId} | Removes a subscription from a site + +# **siteControllerCurrent** +> object siteControllerCurrent($token, $url) Get the current connected site for an access token. @@ -27,11 +27,10 @@ Get the current connected site for an access token. ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\SiteApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -43,10 +42,10 @@ $token = "token_example"; // string | $url = "url_example"; // string | try { - $result = $apiInstance->apiSitesCurrentGet($token, $url); + $result = $apiInstance->siteControllerCurrent($token, $url); print_r($result); } catch (Exception $e) { - echo 'Exception when calling SiteApi->apiSitesCurrentGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling SiteApi->siteControllerCurrent: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -68,27 +67,24 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiSitesGet** -> \Yoast\MyYoastApiClient\Model\Site[] apiSitesGet($filter) - -Get sites +# **siteControllerCurrentClone** +> object siteControllerCurrentClone($token, $url) -Get and filter sites +Get the current connected site for an access token. ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\SiteApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -96,13 +92,14 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\SiteApi( new GuzzleHttp\Client(), $config ); -$filter = array('key' => "filter_example"); // map[string,string] | Used for filtering/joining the results. +$token = "token_example"; // string | +$url = "url_example"; // string | try { - $result = $apiInstance->apiSitesGet($filter); + $result = $apiInstance->siteControllerCurrentClone($token, $url); print_r($result); } catch (Exception $e) { - echo 'Exception when calling SiteApi->apiSitesGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling SiteApi->siteControllerCurrentClone: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -111,11 +108,12 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **filter** | [**map[string,string]**](../Model/string.md)| Used for filtering/joining the results. | [optional] + **token** | **string**| | [optional] + **url** | **string**| | [optional] ### Return type -[**\Yoast\MyYoastApiClient\Model\Site[]**](../Model/Site.md) +**object** ### Authorization @@ -123,13 +121,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiSitesIdDelete** -> apiSitesIdDelete($id) +# **siteControllerDeleteOne** +> \Yoast\MyYoastApiClient\Model\Site siteControllerDeleteOne($id) @@ -137,11 +135,10 @@ Name | Type | Description | Notes ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\SiteApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -149,12 +146,13 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\SiteApi( new GuzzleHttp\Client(), $config ); -$id = "id_example"; // string | +$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | try { - $apiInstance->apiSitesIdDelete($id); + $result = $apiInstance->siteControllerDeleteOne($id); + print_r($result); } catch (Exception $e) { - echo 'Exception when calling SiteApi->apiSitesIdDelete: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling SiteApi->siteControllerDeleteOne: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -167,7 +165,7 @@ Name | Type | Description | Notes ### Return type -void (empty response body) +[**\Yoast\MyYoastApiClient\Model\Site**](../Model/Site.md) ### Authorization @@ -175,27 +173,26 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiSitesIdGet** -> \Yoast\MyYoastApiClient\Model\Site apiSitesIdGet($id, $filter) +# **siteControllerGetMany** +> \Yoast\MyYoastApiClient\Model\Site[] siteControllerGetMany($filter) -Get a site +Get sites -Get a single site +Get and filter sites ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\SiteApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -203,14 +200,13 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\SiteApi( new GuzzleHttp\Client(), $config ); -$id = "id_example"; // string | -$filter = array('key' => "filter_example"); // map[string,string] | Used for filtering/joining the results. +$filter = new \stdClass; // object | Used for filtering/joining the results. try { - $result = $apiInstance->apiSitesIdGet($id, $filter); + $result = $apiInstance->siteControllerGetMany($filter); print_r($result); } catch (Exception $e) { - echo 'Exception when calling SiteApi->apiSitesIdGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling SiteApi->siteControllerGetMany: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -219,12 +215,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | [**string**](../Model/.md)| | - **filter** | [**map[string,string]**](../Model/string.md)| Used for filtering/joining the results. | [optional] + **filter** | [**object**](../Model/.md)| Used for filtering/joining the results. | [optional] ### Return type -[**\Yoast\MyYoastApiClient\Model\Site**](../Model/Site.md) +[**\Yoast\MyYoastApiClient\Model\Site[]**](../Model/Site.md) ### Authorization @@ -232,25 +227,26 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiSitesIdPatch** -> apiSitesIdPatch($updateSiteDto, $id) +# **siteControllerGetManyPaged** +> object siteControllerGetManyPaged($filter) +Get sites +Get and filter sites ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\SiteApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -258,13 +254,13 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\SiteApi( new GuzzleHttp\Client(), $config ); -$updateSiteDto = new \Yoast\MyYoastApiClient\Model\UpdateSiteDto(); // \Yoast\MyYoastApiClient\Model\UpdateSiteDto | -$id = "id_example"; // string | +$filter = new \stdClass; // object | Used for filtering/joining the results. try { - $apiInstance->apiSitesIdPatch($updateSiteDto, $id); + $result = $apiInstance->siteControllerGetManyPaged($filter); + print_r($result); } catch (Exception $e) { - echo 'Exception when calling SiteApi->apiSitesIdPatch: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling SiteApi->siteControllerGetManyPaged: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -273,12 +269,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **updateSiteDto** | [**\Yoast\MyYoastApiClient\Model\UpdateSiteDto**](../Model/UpdateSiteDto.md)| | - **id** | [**string**](../Model/.md)| | + **filter** | [**object**](../Model/.md)| Used for filtering/joining the results. | [optional] ### Return type -void (empty response body) +**object** ### Authorization @@ -286,25 +281,26 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiSitesIdSubscriptionsPut** -> \Yoast\MyYoastApiClient\Model\Site apiSitesIdSubscriptionsPut($addSubscriptionDto, $id) +# **siteControllerGetOne** +> \Yoast\MyYoastApiClient\Model\Site siteControllerGetOne($id, $filter) -Adds a subscription to a site +Get a site + +Get a single site ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\SiteApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -312,14 +308,14 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\SiteApi( new GuzzleHttp\Client(), $config ); -$addSubscriptionDto = new \Yoast\MyYoastApiClient\Model\AddSubscriptionDto(); // \Yoast\MyYoastApiClient\Model\AddSubscriptionDto | -$id = "id_example"; // string | +$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | +$filter = new \stdClass; // object | Used for filtering/joining the results. try { - $result = $apiInstance->apiSitesIdSubscriptionsPut($addSubscriptionDto, $id); + $result = $apiInstance->siteControllerGetOne($id, $filter); print_r($result); } catch (Exception $e) { - echo 'Exception when calling SiteApi->apiSitesIdSubscriptionsPut: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling SiteApi->siteControllerGetOne: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -328,8 +324,8 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **addSubscriptionDto** | [**\Yoast\MyYoastApiClient\Model\AddSubscriptionDto**](../Model/AddSubscriptionDto.md)| | **id** | [**string**](../Model/.md)| | + **filter** | [**object**](../Model/.md)| Used for filtering/joining the results. | [optional] ### Return type @@ -341,25 +337,24 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiSitesIdSubscriptionsSubscriptionIdDelete** -> \Yoast\MyYoastApiClient\Model\Site apiSitesIdSubscriptionsSubscriptionIdDelete($id, $subscriptionId) +# **siteControllerIndex** +> object siteControllerIndex($token, $url, $method) + -Removes a subscription from a site ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\SiteApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -367,14 +362,15 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\SiteApi( new GuzzleHttp\Client(), $config ); -$id = "id_example"; // string | -$subscriptionId = "subscriptionId_example"; // string | +$token = "token_example"; // string | +$url = "url_example"; // string | +$method = "method_example"; // string | try { - $result = $apiInstance->apiSitesIdSubscriptionsSubscriptionIdDelete($id, $subscriptionId); + $result = $apiInstance->siteControllerIndex($token, $url, $method); print_r($result); } catch (Exception $e) { - echo 'Exception when calling SiteApi->apiSitesIdSubscriptionsSubscriptionIdDelete: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling SiteApi->siteControllerIndex: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -383,12 +379,13 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | [**string**](../Model/.md)| | - **subscriptionId** | [**string**](../Model/.md)| | + **token** | **string**| | + **url** | **string**| | + **method** | **string**| | ### Return type -[**\Yoast\MyYoastApiClient\Model\Site**](../Model/Site.md) +**object** ### Authorization @@ -396,25 +393,26 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiSitesIndexPost** -> object apiSitesIndexPost($token, $url, $method) +# **siteControllerSwitchSubscription** +> int siteControllerSwitchSubscription($body) +Switches the subscription for a number of times. +Switches the subscription for a number of times. ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\SiteApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -422,15 +420,13 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\SiteApi( new GuzzleHttp\Client(), $config ); -$token = "token_example"; // string | -$url = "url_example"; // string | -$method = "method_example"; // string | +$body = new \Yoast\MyYoastApiClient\Model\TransferSiteDto(); // \Yoast\MyYoastApiClient\Model\TransferSiteDto | try { - $result = $apiInstance->apiSitesIndexPost($token, $url, $method); + $result = $apiInstance->siteControllerSwitchSubscription($body); print_r($result); } catch (Exception $e) { - echo 'Exception when calling SiteApi->apiSitesIndexPost: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling SiteApi->siteControllerSwitchSubscription: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -439,13 +435,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **token** | **string**| | - **url** | **string**| | - **method** | **string**| | + **body** | [**\Yoast\MyYoastApiClient\Model\TransferSiteDto**](../Model/TransferSiteDto.md)| | ### Return type -**object** +**int** ### Authorization @@ -458,20 +452,21 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiSitesInfoGet** -> object apiSitesInfoGet($token, $url) +# **siteControllerSwitchSubscriptionNumberOfTimes** +> int siteControllerSwitchSubscriptionNumberOfTimes($body) -Get the current connected site for an access token. +Switches the subscription for a number of times. + +Switches the subscription for a number of times. ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\SiteApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -479,14 +474,13 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\SiteApi( new GuzzleHttp\Client(), $config ); -$token = "token_example"; // string | -$url = "url_example"; // string | +$body = new \Yoast\MyYoastApiClient\Model\SwitchSubscriptionNumberOfTimesDto(); // \Yoast\MyYoastApiClient\Model\SwitchSubscriptionNumberOfTimesDto | try { - $result = $apiInstance->apiSitesInfoGet($token, $url); + $result = $apiInstance->siteControllerSwitchSubscriptionNumberOfTimes($body); print_r($result); } catch (Exception $e) { - echo 'Exception when calling SiteApi->apiSitesInfoGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling SiteApi->siteControllerSwitchSubscriptionNumberOfTimes: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -495,12 +489,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **token** | **string**| | [optional] - **url** | **string**| | [optional] + **body** | [**\Yoast\MyYoastApiClient\Model\SwitchSubscriptionNumberOfTimesDto**](../Model/SwitchSubscriptionNumberOfTimesDto.md)| | ### Return type -**object** +**int** ### Authorization @@ -513,22 +506,21 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiSitesSwitchSubscriptionNumberOfTimesPost** -> object apiSitesSwitchSubscriptionNumberOfTimesPost($switchSubscriptionNumberOfTimesDto) +# **siteControllerTransfer** +> \Yoast\MyYoastApiClient\Model\Site[] siteControllerTransfer($body) -Switches the subscription for a number of times. +Transfer sites. -Switches the subscription for a number of times. +Transfers the sites from one customer to another customer. ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\SiteApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -536,13 +528,13 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\SiteApi( new GuzzleHttp\Client(), $config ); -$switchSubscriptionNumberOfTimesDto = new \Yoast\MyYoastApiClient\Model\SwitchSubscriptionNumberOfTimesDto(); // \Yoast\MyYoastApiClient\Model\SwitchSubscriptionNumberOfTimesDto | +$body = new \Yoast\MyYoastApiClient\Model\TransferSiteDto(); // \Yoast\MyYoastApiClient\Model\TransferSiteDto | try { - $result = $apiInstance->apiSitesSwitchSubscriptionNumberOfTimesPost($switchSubscriptionNumberOfTimesDto); + $result = $apiInstance->siteControllerTransfer($body); print_r($result); } catch (Exception $e) { - echo 'Exception when calling SiteApi->apiSitesSwitchSubscriptionNumberOfTimesPost: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling SiteApi->siteControllerTransfer: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -551,11 +543,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **switchSubscriptionNumberOfTimesDto** | [**\Yoast\MyYoastApiClient\Model\SwitchSubscriptionNumberOfTimesDto**](../Model/SwitchSubscriptionNumberOfTimesDto.md)| | + **body** | [**\Yoast\MyYoastApiClient\Model\TransferSiteDto**](../Model/TransferSiteDto.md)| | ### Return type -**object** +[**\Yoast\MyYoastApiClient\Model\Site[]**](../Model/Site.md) ### Authorization @@ -568,22 +560,19 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiSitesSwitchSubscriptionPost** -> float apiSitesSwitchSubscriptionPost($transferSiteDto) +# **siteControllerUpdateOne** +> \Yoast\MyYoastApiClient\Model\Site siteControllerUpdateOne($body, $id) -Switches the subscription for a number of times. -Switches the subscription for a number of times. ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\SiteApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -591,13 +580,14 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\SiteApi( new GuzzleHttp\Client(), $config ); -$transferSiteDto = new \Yoast\MyYoastApiClient\Model\TransferSiteDto(); // \Yoast\MyYoastApiClient\Model\TransferSiteDto | +$body = new \Yoast\MyYoastApiClient\Model\UpdateSiteDto(); // \Yoast\MyYoastApiClient\Model\UpdateSiteDto | +$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | try { - $result = $apiInstance->apiSitesSwitchSubscriptionPost($transferSiteDto); + $result = $apiInstance->siteControllerUpdateOne($body, $id); print_r($result); } catch (Exception $e) { - echo 'Exception when calling SiteApi->apiSitesSwitchSubscriptionPost: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling SiteApi->siteControllerUpdateOne: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -606,11 +596,12 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **transferSiteDto** | [**\Yoast\MyYoastApiClient\Model\TransferSiteDto**](../Model/TransferSiteDto.md)| | + **body** | [**\Yoast\MyYoastApiClient\Model\UpdateSiteDto**](../Model/UpdateSiteDto.md)| | + **id** | [**string**](../Model/.md)| | ### Return type -**float** +[**\Yoast\MyYoastApiClient\Model\Site**](../Model/Site.md) ### Authorization @@ -623,22 +614,19 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiSitesTransferPost** -> \Yoast\MyYoastApiClient\Model\Site[] apiSitesTransferPost($transferSiteDto) +# **siteSubscriptionControllerAddSubscription** +> \Yoast\MyYoastApiClient\Model\Site siteSubscriptionControllerAddSubscription($body, $id) -Transfer sites. - -Transfers the sites from one customer to another customer. +Adds a subscription to a site ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\SiteApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -646,13 +634,14 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\SiteApi( new GuzzleHttp\Client(), $config ); -$transferSiteDto = new \Yoast\MyYoastApiClient\Model\TransferSiteDto(); // \Yoast\MyYoastApiClient\Model\TransferSiteDto | +$body = new \Yoast\MyYoastApiClient\Model\AddSubscriptionDto(); // \Yoast\MyYoastApiClient\Model\AddSubscriptionDto | +$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | try { - $result = $apiInstance->apiSitesTransferPost($transferSiteDto); + $result = $apiInstance->siteSubscriptionControllerAddSubscription($body, $id); print_r($result); } catch (Exception $e) { - echo 'Exception when calling SiteApi->apiSitesTransferPost: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling SiteApi->siteSubscriptionControllerAddSubscription: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -661,11 +650,12 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **transferSiteDto** | [**\Yoast\MyYoastApiClient\Model\TransferSiteDto**](../Model/TransferSiteDto.md)| | + **body** | [**\Yoast\MyYoastApiClient\Model\AddSubscriptionDto**](../Model/AddSubscriptionDto.md)| | + **id** | [**string**](../Model/.md)| | ### Return type -[**\Yoast\MyYoastApiClient\Model\Site[]**](../Model/Site.md) +[**\Yoast\MyYoastApiClient\Model\Site**](../Model/Site.md) ### Authorization @@ -678,3 +668,57 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) +# **siteSubscriptionControllerRemoveSubscription** +> \Yoast\MyYoastApiClient\Model\Site siteSubscriptionControllerRemoveSubscription($id, $subscriptionId) + +Removes a subscription from a site + +### Example +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Yoast\MyYoastApiClient\Api\SiteApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | +$subscriptionId = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | + +try { + $result = $apiInstance->siteSubscriptionControllerRemoveSubscription($id, $subscriptionId); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SiteApi->siteSubscriptionControllerRemoveSubscription: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | [**string**](../Model/.md)| | + **subscriptionId** | [**string**](../Model/.md)| | + +### Return type + +[**\Yoast\MyYoastApiClient\Model\Site**](../Model/Site.md) + +### Authorization + +[bearer](../../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/docs/Api/SubscriptionApi.md b/docs/Api/SubscriptionApi.md index 94500e2..8f23756 100644 --- a/docs/Api/SubscriptionApi.md +++ b/docs/Api/SubscriptionApi.md @@ -1,21 +1,130 @@ # Yoast\MyYoastApiClient\SubscriptionApi -All URIs are relative to *http://my.yoast.test:3000* +All URIs are relative to */* Method | HTTP request | Description ------------- | ------------- | ------------- -[**apiSubscriptionsExpiringGet**](SubscriptionApi.md#apiSubscriptionsExpiringGet) | **GET** /api/Subscriptions/expiring | -[**apiSubscriptionsGet**](SubscriptionApi.md#apiSubscriptionsGet) | **GET** /api/Subscriptions | Get subscriptions -[**apiSubscriptionsIdDelete**](SubscriptionApi.md#apiSubscriptionsIdDelete) | **DELETE** /api/Subscriptions/{id} | Delete a subscription -[**apiSubscriptionsIdGet**](SubscriptionApi.md#apiSubscriptionsIdGet) | **GET** /api/Subscriptions/{id} | Get a subscription -[**apiSubscriptionsIdRecalculateSubscriptionCountPost**](SubscriptionApi.md#apiSubscriptionsIdRecalculateSubscriptionCountPost) | **POST** /api/Subscriptions/{id}/recalculateSubscriptionCount | Recalculate SubscriptionCount. -[**apiSubscriptionsRenewSubscriptionNumberSecretKeyGet**](SubscriptionApi.md#apiSubscriptionsRenewSubscriptionNumberSecretKeyGet) | **GET** /api/Subscriptions/renew/{subscriptionNumber}/{secretKey} | Renew subscriptions -[**apiSubscriptionsSetExpiryDatePost**](SubscriptionApi.md#apiSubscriptionsSetExpiryDatePost) | **POST** /api/Subscriptions/setExpiryDate | Set Date. -[**apiSubscriptionsTransferPost**](SubscriptionApi.md#apiSubscriptionsTransferPost) | **POST** /api/Subscriptions/transfer | Transfer subscription ownership +[**subscriptionControllerDeleteOne**](SubscriptionApi.md#subscriptioncontrollerdeleteone) | **DELETE** /api/Subscriptions/{id} | Delete a subscription +[**subscriptionControllerForceCancel**](SubscriptionApi.md#subscriptioncontrollerforcecancel) | **POST** /api/Subscriptions/{id}/force-cancel | Forcefully cancel a subscription +[**subscriptionControllerGetExpiringSubscriptions**](SubscriptionApi.md#subscriptioncontrollergetexpiringsubscriptions) | **GET** /api/Subscriptions/expiring | +[**subscriptionControllerGetMany**](SubscriptionApi.md#subscriptioncontrollergetmany) | **GET** /api/Subscriptions | Get subscriptions +[**subscriptionControllerGetManyPaged**](SubscriptionApi.md#subscriptioncontrollergetmanypaged) | **GET** /api/Subscriptions/paged | Get subscriptions +[**subscriptionControllerGetOne**](SubscriptionApi.md#subscriptioncontrollergetone) | **GET** /api/Subscriptions/{id} | Get a subscription +[**subscriptionControllerRecalculateSubscriptionCount**](SubscriptionApi.md#subscriptioncontrollerrecalculatesubscriptioncount) | **POST** /api/Subscriptions/{id}/recalculateSubscriptionCount | Recalculate SubscriptionCount. +[**subscriptionControllerRenew**](SubscriptionApi.md#subscriptioncontrollerrenew) | **GET** /api/Subscriptions/renew/{subscriptionNumber}/{secretKey} | Renew subscriptions +[**subscriptionControllerSetExpiryDate**](SubscriptionApi.md#subscriptioncontrollersetexpirydate) | **POST** /api/Subscriptions/setExpiryDate | Set Date. +[**subscriptionControllerTransferOwnership**](SubscriptionApi.md#subscriptioncontrollertransferownership) | **POST** /api/Subscriptions/transfer | Transfer subscription ownership + +# **subscriptionControllerDeleteOne** +> string subscriptionControllerDeleteOne($id) +Delete a subscription + +Deletes a single subscription + +### Example +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Yoast\MyYoastApiClient\Api\SubscriptionApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | + +try { + $result = $apiInstance->subscriptionControllerDeleteOne($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SubscriptionApi->subscriptionControllerDeleteOne: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | [**string**](../Model/.md)| | + +### Return type + +**string** + +### Authorization + +[bearer](../../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **subscriptionControllerForceCancel** +> \Yoast\MyYoastApiClient\Model\Subscription subscriptionControllerForceCancel($id) + +Forcefully cancel a subscription + +This immediately cancels a subscription without notifying the customer. The customer will lose access instantly + +### Example +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Yoast\MyYoastApiClient\Api\SubscriptionApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | + +try { + $result = $apiInstance->subscriptionControllerForceCancel($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SubscriptionApi->subscriptionControllerForceCancel: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | [**string**](../Model/.md)| | + +### Return type + +[**\Yoast\MyYoastApiClient\Model\Subscription**](../Model/Subscription.md) -# **apiSubscriptionsExpiringGet** -> \Yoast\MyYoastApiClient\Model\Subscription[] apiSubscriptionsExpiringGet($from, $until, $requiresManualRenewal) +### Authorization + +[bearer](../../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **subscriptionControllerGetExpiringSubscriptions** +> \Yoast\MyYoastApiClient\Model\Subscription[] subscriptionControllerGetExpiringSubscriptions($from, $until, $requiresManualRenewal) @@ -23,11 +132,10 @@ Method | HTTP request | Description ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\SubscriptionApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -40,10 +148,10 @@ $until = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | $requiresManualRenewal = true; // bool | try { - $result = $apiInstance->apiSubscriptionsExpiringGet($from, $until, $requiresManualRenewal); + $result = $apiInstance->subscriptionControllerGetExpiringSubscriptions($from, $until, $requiresManualRenewal); print_r($result); } catch (Exception $e) { - echo 'Exception when calling SubscriptionApi->apiSubscriptionsExpiringGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling SubscriptionApi->subscriptionControllerGetExpiringSubscriptions: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -66,13 +174,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiSubscriptionsGet** -> \Yoast\MyYoastApiClient\Model\Subscription[] apiSubscriptionsGet($filter) +# **subscriptionControllerGetMany** +> \Yoast\MyYoastApiClient\Model\Subscription[] subscriptionControllerGetMany($filter) Get subscriptions @@ -82,11 +190,10 @@ Get and filter subscriptions ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\SubscriptionApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -94,13 +201,13 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\SubscriptionApi( new GuzzleHttp\Client(), $config ); -$filter = array('key' => "filter_example"); // map[string,string] | Used for filtering/joining the results. +$filter = new \stdClass; // object | Used for filtering/joining the results. try { - $result = $apiInstance->apiSubscriptionsGet($filter); + $result = $apiInstance->subscriptionControllerGetMany($filter); print_r($result); } catch (Exception $e) { - echo 'Exception when calling SubscriptionApi->apiSubscriptionsGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling SubscriptionApi->subscriptionControllerGetMany: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -109,7 +216,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **filter** | [**map[string,string]**](../Model/string.md)| Used for filtering/joining the results. | [optional] + **filter** | [**object**](../Model/.md)| Used for filtering/joining the results. | [optional] ### Return type @@ -121,27 +228,26 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiSubscriptionsIdDelete** -> string apiSubscriptionsIdDelete($id) +# **subscriptionControllerGetManyPaged** +> object subscriptionControllerGetManyPaged($filter) -Delete a subscription +Get subscriptions -Deletes a single subscription +Get and filter subscriptions ### Example ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\SubscriptionApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -149,13 +255,13 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\SubscriptionApi( new GuzzleHttp\Client(), $config ); -$id = "id_example"; // string | +$filter = new \stdClass; // object | Used for filtering/joining the results. try { - $result = $apiInstance->apiSubscriptionsIdDelete($id); + $result = $apiInstance->subscriptionControllerGetManyPaged($filter); print_r($result); } catch (Exception $e) { - echo 'Exception when calling SubscriptionApi->apiSubscriptionsIdDelete: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling SubscriptionApi->subscriptionControllerGetManyPaged: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -164,11 +270,11 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | [**string**](../Model/.md)| | + **filter** | [**object**](../Model/.md)| Used for filtering/joining the results. | [optional] ### Return type -**string** +**object** ### Authorization @@ -176,13 +282,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiSubscriptionsIdGet** -> \Yoast\MyYoastApiClient\Model\Subscription apiSubscriptionsIdGet($id, $filter) +# **subscriptionControllerGetOne** +> \Yoast\MyYoastApiClient\Model\Subscription subscriptionControllerGetOne($id, $filter) Get a subscription @@ -192,11 +298,10 @@ Get a single subscription ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\SubscriptionApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -204,14 +309,14 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\SubscriptionApi( new GuzzleHttp\Client(), $config ); -$id = "id_example"; // string | -$filter = array('key' => "filter_example"); // map[string,string] | Used for filtering/joining the results. +$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | +$filter = new \stdClass; // object | Used for filtering/joining the results. try { - $result = $apiInstance->apiSubscriptionsIdGet($id, $filter); + $result = $apiInstance->subscriptionControllerGetOne($id, $filter); print_r($result); } catch (Exception $e) { - echo 'Exception when calling SubscriptionApi->apiSubscriptionsIdGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling SubscriptionApi->subscriptionControllerGetOne: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -221,7 +326,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **id** | [**string**](../Model/.md)| | - **filter** | [**map[string,string]**](../Model/string.md)| Used for filtering/joining the results. | [optional] + **filter** | [**object**](../Model/.md)| Used for filtering/joining the results. | [optional] ### Return type @@ -233,13 +338,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiSubscriptionsIdRecalculateSubscriptionCountPost** -> \Yoast\MyYoastApiClient\Model\Subscription apiSubscriptionsIdRecalculateSubscriptionCountPost($id) +# **subscriptionControllerRecalculateSubscriptionCount** +> \Yoast\MyYoastApiClient\Model\Subscription subscriptionControllerRecalculateSubscriptionCount($id) Recalculate SubscriptionCount. @@ -249,11 +354,10 @@ Route to recalculate the Subscription Count for a given subscription. ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\SubscriptionApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -264,10 +368,10 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\SubscriptionApi( $id = "id_example"; // string | try { - $result = $apiInstance->apiSubscriptionsIdRecalculateSubscriptionCountPost($id); + $result = $apiInstance->subscriptionControllerRecalculateSubscriptionCount($id); print_r($result); } catch (Exception $e) { - echo 'Exception when calling SubscriptionApi->apiSubscriptionsIdRecalculateSubscriptionCountPost: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling SubscriptionApi->subscriptionControllerRecalculateSubscriptionCount: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -288,13 +392,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiSubscriptionsRenewSubscriptionNumberSecretKeyGet** -> \Yoast\MyYoastApiClient\Model\Subscription apiSubscriptionsRenewSubscriptionNumberSecretKeyGet($subscriptionNumber, $secretKey) +# **subscriptionControllerRenew** +> \Yoast\MyYoastApiClient\Model\Subscription subscriptionControllerRenew($subscriptionNumber, $secretKey) Renew subscriptions @@ -304,11 +408,10 @@ Route for renewing subscriptions ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\SubscriptionApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -320,10 +423,10 @@ $subscriptionNumber = "subscriptionNumber_example"; // string | $secretKey = "secretKey_example"; // string | try { - $result = $apiInstance->apiSubscriptionsRenewSubscriptionNumberSecretKeyGet($subscriptionNumber, $secretKey); + $result = $apiInstance->subscriptionControllerRenew($subscriptionNumber, $secretKey); print_r($result); } catch (Exception $e) { - echo 'Exception when calling SubscriptionApi->apiSubscriptionsRenewSubscriptionNumberSecretKeyGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling SubscriptionApi->subscriptionControllerRenew: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -345,13 +448,13 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiSubscriptionsSetExpiryDatePost** -> \Yoast\MyYoastApiClient\Model\Subscription apiSubscriptionsSetExpiryDatePost($setExpiryDateDto) +# **subscriptionControllerSetExpiryDate** +> \Yoast\MyYoastApiClient\Model\Subscription subscriptionControllerSetExpiryDate($body) Set Date. @@ -361,11 +464,10 @@ Sets either the end date or next payment date, based on which one the subscripti ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\SubscriptionApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -373,13 +475,13 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\SubscriptionApi( new GuzzleHttp\Client(), $config ); -$setExpiryDateDto = new \Yoast\MyYoastApiClient\Model\SetExpiryDateDto(); // \Yoast\MyYoastApiClient\Model\SetExpiryDateDto | +$body = new \Yoast\MyYoastApiClient\Model\SetExpiryDateDto(); // \Yoast\MyYoastApiClient\Model\SetExpiryDateDto | try { - $result = $apiInstance->apiSubscriptionsSetExpiryDatePost($setExpiryDateDto); + $result = $apiInstance->subscriptionControllerSetExpiryDate($body); print_r($result); } catch (Exception $e) { - echo 'Exception when calling SubscriptionApi->apiSubscriptionsSetExpiryDatePost: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling SubscriptionApi->subscriptionControllerSetExpiryDate: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -388,7 +490,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **setExpiryDateDto** | [**\Yoast\MyYoastApiClient\Model\SetExpiryDateDto**](../Model/SetExpiryDateDto.md)| | + **body** | [**\Yoast\MyYoastApiClient\Model\SetExpiryDateDto**](../Model/SetExpiryDateDto.md)| | ### Return type @@ -405,8 +507,8 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiSubscriptionsTransferPost** -> \Yoast\MyYoastApiClient\Model\Subscription[] apiSubscriptionsTransferPost($transferOwnershipDto) +# **subscriptionControllerTransferOwnership** +> \Yoast\MyYoastApiClient\Model\Subscription[] subscriptionControllerTransferOwnership($body) Transfer subscription ownership @@ -416,11 +518,10 @@ Change the subscription owner from one customer to another ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\SubscriptionApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -428,13 +529,13 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\SubscriptionApi( new GuzzleHttp\Client(), $config ); -$transferOwnershipDto = new \Yoast\MyYoastApiClient\Model\TransferOwnershipDto(); // \Yoast\MyYoastApiClient\Model\TransferOwnershipDto | +$body = new \Yoast\MyYoastApiClient\Model\TransferOwnershipDto(); // \Yoast\MyYoastApiClient\Model\TransferOwnershipDto | try { - $result = $apiInstance->apiSubscriptionsTransferPost($transferOwnershipDto); + $result = $apiInstance->subscriptionControllerTransferOwnership($body); print_r($result); } catch (Exception $e) { - echo 'Exception when calling SubscriptionApi->apiSubscriptionsTransferPost: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling SubscriptionApi->subscriptionControllerTransferOwnership: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -443,7 +544,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **transferOwnershipDto** | [**\Yoast\MyYoastApiClient\Model\TransferOwnershipDto**](../Model/TransferOwnershipDto.md)| | + **body** | [**\Yoast\MyYoastApiClient\Model\TransferOwnershipDto**](../Model/TransferOwnershipDto.md)| | ### Return type diff --git a/docs/Api/SubscriptionProvisioningApi.md b/docs/Api/SubscriptionProvisioningApi.md new file mode 100644 index 0000000..385f240 --- /dev/null +++ b/docs/Api/SubscriptionProvisioningApi.md @@ -0,0 +1,291 @@ +# Yoast\MyYoastApiClient\SubscriptionProvisioningApi + +All URIs are relative to */* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**subscriptionProvisioningControllerCancelSubscription**](SubscriptionProvisioningApi.md#subscriptionprovisioningcontrollercancelsubscription) | **POST** /api/provisioning/subscriptions/{id}/cancel | Cancel a single subscription +[**subscriptionProvisioningControllerCreate**](SubscriptionProvisioningApi.md#subscriptionprovisioningcontrollercreate) | **POST** /api/provisioning/subscriptions/create | Create a subscription +[**subscriptionProvisioningControllerGetOne**](SubscriptionProvisioningApi.md#subscriptionprovisioningcontrollergetone) | **GET** /api/provisioning/subscriptions/{id} | Get a subscription +[**subscriptionProvisioningControllerRenewSubscription**](SubscriptionProvisioningApi.md#subscriptionprovisioningcontrollerrenewsubscription) | **POST** /api/provisioning/subscriptions/{id}/renew | Renew a subscription +[**subscriptionProvisioningControllerSetSiteForSubscription**](SubscriptionProvisioningApi.md#subscriptionprovisioningcontrollersetsiteforsubscription) | **POST** /api/provisioning/subscriptions/{id}/set-site | Link a subscription to a site + +# **subscriptionProvisioningControllerCancelSubscription** +> \Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto subscriptionProvisioningControllerCancelSubscription($body, $id) + +Cancel a single subscription + +Cancel the subscription when the period ends or immediately. + +### Example +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new Yoast\MyYoastApiClient\Api\SubscriptionProvisioningApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$body = new \Yoast\MyYoastApiClient\Model\CancelProvisionedSubscriptionDto(); // \Yoast\MyYoastApiClient\Model\CancelProvisionedSubscriptionDto | +$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | + +try { + $result = $apiInstance->subscriptionProvisioningControllerCancelSubscription($body, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SubscriptionProvisioningApi->subscriptionProvisioningControllerCancelSubscription: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**\Yoast\MyYoastApiClient\Model\CancelProvisionedSubscriptionDto**](../Model/CancelProvisionedSubscriptionDto.md)| | + **id** | [**string**](../Model/.md)| | + +### Return type + +[**\Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto**](../Model/SubscriptionProvisioningResponseDto.md) + +### Authorization + +[basic](../../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **subscriptionProvisioningControllerCreate** +> \Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto subscriptionProvisioningControllerCreate($body) + +Create a subscription + +Creates a subscription for a customer. + +### Example +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new Yoast\MyYoastApiClient\Api\SubscriptionProvisioningApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$body = new \Yoast\MyYoastApiClient\Model\CreateProvisionedSubscriptionDto(); // \Yoast\MyYoastApiClient\Model\CreateProvisionedSubscriptionDto | + +try { + $result = $apiInstance->subscriptionProvisioningControllerCreate($body); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SubscriptionProvisioningApi->subscriptionProvisioningControllerCreate: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**\Yoast\MyYoastApiClient\Model\CreateProvisionedSubscriptionDto**](../Model/CreateProvisionedSubscriptionDto.md)| | + +### Return type + +[**\Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto**](../Model/SubscriptionProvisioningResponseDto.md) + +### Authorization + +[basic](../../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **subscriptionProvisioningControllerGetOne** +> \Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto subscriptionProvisioningControllerGetOne($id) + +Get a subscription + +Get a single subscription that was provisioned for a third party + +### Example +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new Yoast\MyYoastApiClient\Api\SubscriptionProvisioningApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | + +try { + $result = $apiInstance->subscriptionProvisioningControllerGetOne($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SubscriptionProvisioningApi->subscriptionProvisioningControllerGetOne: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | [**string**](../Model/.md)| | + +### Return type + +[**\Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto**](../Model/SubscriptionProvisioningResponseDto.md) + +### Authorization + +[basic](../../README.md#basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **subscriptionProvisioningControllerRenewSubscription** +> \Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto subscriptionProvisioningControllerRenewSubscription($id) + +Renew a subscription + +Renew the subscription for a new period. + +### Example +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new Yoast\MyYoastApiClient\Api\SubscriptionProvisioningApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | + +try { + $result = $apiInstance->subscriptionProvisioningControllerRenewSubscription($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SubscriptionProvisioningApi->subscriptionProvisioningControllerRenewSubscription: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | [**string**](../Model/.md)| | + +### Return type + +[**\Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto**](../Model/SubscriptionProvisioningResponseDto.md) + +### Authorization + +[basic](../../README.md#basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **subscriptionProvisioningControllerSetSiteForSubscription** +> \Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto subscriptionProvisioningControllerSetSiteForSubscription($body, $id) + +Link a subscription to a site + +Links the subscription to a customer's website. Setting a site the the subscription will remove the site if already set. + +### Example +```php +setUsername('YOUR_USERNAME') + ->setPassword('YOUR_PASSWORD'); + + +$apiInstance = new Yoast\MyYoastApiClient\Api\SubscriptionProvisioningApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$body = new \Yoast\MyYoastApiClient\Model\SetProvisionedSiteDto(); // \Yoast\MyYoastApiClient\Model\SetProvisionedSiteDto | +$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | + +try { + $result = $apiInstance->subscriptionProvisioningControllerSetSiteForSubscription($body, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling SubscriptionProvisioningApi->subscriptionProvisioningControllerSetSiteForSubscription: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**\Yoast\MyYoastApiClient\Model\SetProvisionedSiteDto**](../Model/SetProvisionedSiteDto.md)| | + **id** | [**string**](../Model/.md)| | + +### Return type + +[**\Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto**](../Model/SubscriptionProvisioningResponseDto.md) + +### Authorization + +[basic](../../README.md#basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + diff --git a/docs/Api/WorkerApi.md b/docs/Api/WorkerApi.md index f77ff50..f524653 100644 --- a/docs/Api/WorkerApi.md +++ b/docs/Api/WorkerApi.md @@ -1,18 +1,18 @@ # Yoast\MyYoastApiClient\WorkerApi -All URIs are relative to *http://my.yoast.test:3000* +All URIs are relative to */* Method | HTTP request | Description ------------- | ------------- | ------------- -[**apiWorkerGetRecurringJobsInfoNameGet**](WorkerApi.md#apiWorkerGetRecurringJobsInfoNameGet) | **GET** /api/Worker/getRecurringJobsInfo/{name} | -[**apiWorkerGetScheduledJobsNameGet**](WorkerApi.md#apiWorkerGetScheduledJobsNameGet) | **GET** /api/Worker/getScheduledJobs/{name} | -[**apiWorkerIdDelete**](WorkerApi.md#apiWorkerIdDelete) | **DELETE** /api/Worker/{id} | -[**apiWorkerIdGet**](WorkerApi.md#apiWorkerIdGet) | **GET** /api/Worker/{id} | -[**apiWorkerPost**](WorkerApi.md#apiWorkerPost) | **POST** /api/Worker | +[**queueControllerAddJob**](WorkerApi.md#queuecontrolleraddjob) | **POST** /api/Worker/job | +[**queueControllerGetJob**](WorkerApi.md#queuecontrollergetjob) | **GET** /api/Worker/job/{id} | +[**queueControllerGetRecurringJobs**](WorkerApi.md#queuecontrollergetrecurringjobs) | **GET** /api/Worker/getRecurringJobs | +[**queueControllerGetRecurringJobsInfo**](WorkerApi.md#queuecontrollergetrecurringjobsinfo) | **GET** /api/Worker/getRecurringJobs/{name} | +[**queueControllerGetScheduledJobs**](WorkerApi.md#queuecontrollergetscheduledjobs) | **GET** /api/Worker/getScheduledJobs/{name} | +[**queueControllerRemoveJob**](WorkerApi.md#queuecontrollerremovejob) | **DELETE** /api/Worker/job/{id} | - -# **apiWorkerGetRecurringJobsInfoNameGet** -> apiWorkerGetRecurringJobsInfoNameGet($name) +# **queueControllerAddJob** +> queueControllerAddJob($body) @@ -20,11 +20,10 @@ Method | HTTP request | Description ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\WorkerApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -32,12 +31,12 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\WorkerApi( new GuzzleHttp\Client(), $config ); -$name = "name_example"; // string | +$body = new \Yoast\MyYoastApiClient\Model\AddJobDto(); // \Yoast\MyYoastApiClient\Model\AddJobDto | try { - $apiInstance->apiWorkerGetRecurringJobsInfoNameGet($name); + $apiInstance->queueControllerAddJob($body); } catch (Exception $e) { - echo 'Exception when calling WorkerApi->apiWorkerGetRecurringJobsInfoNameGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling WorkerApi->queueControllerAddJob: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -46,7 +45,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **name** | **string**| | + **body** | [**\Yoast\MyYoastApiClient\Model\AddJobDto**](../Model/AddJobDto.md)| | ### Return type @@ -59,12 +58,12 @@ void (empty response body) ### HTTP request headers - **Content-Type**: application/json - - **Accept**: application/json + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiWorkerGetScheduledJobsNameGet** -> apiWorkerGetScheduledJobsNameGet($name) +# **queueControllerGetJob** +> queueControllerGetJob($id) @@ -72,11 +71,10 @@ void (empty response body) ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\WorkerApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -84,12 +82,12 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\WorkerApi( new GuzzleHttp\Client(), $config ); -$name = "name_example"; // string | +$id = "id_example"; // string | try { - $apiInstance->apiWorkerGetScheduledJobsNameGet($name); + $apiInstance->queueControllerGetJob($id); } catch (Exception $e) { - echo 'Exception when calling WorkerApi->apiWorkerGetScheduledJobsNameGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling WorkerApi->queueControllerGetJob: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -98,7 +96,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **name** | **string**| | + **id** | **string**| | ### Return type @@ -110,13 +108,13 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json + - **Content-Type**: Not defined + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiWorkerIdDelete** -> apiWorkerIdDelete($id) +# **queueControllerGetRecurringJobs** +> queueControllerGetRecurringJobs() @@ -124,11 +122,10 @@ void (empty response body) ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\WorkerApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -136,12 +133,59 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\WorkerApi( new GuzzleHttp\Client(), $config ); -$id = "id_example"; // string | try { - $apiInstance->apiWorkerIdDelete($id); + $apiInstance->queueControllerGetRecurringJobs(); +} catch (Exception $e) { + echo 'Exception when calling WorkerApi->queueControllerGetRecurringJobs: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +[bearer](../../README.md#bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **queueControllerGetRecurringJobsInfo** +> queueControllerGetRecurringJobsInfo($name) + + + +### Example +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Yoast\MyYoastApiClient\Api\WorkerApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$name = "name_example"; // string | + +try { + $apiInstance->queueControllerGetRecurringJobsInfo($name); } catch (Exception $e) { - echo 'Exception when calling WorkerApi->apiWorkerIdDelete: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling WorkerApi->queueControllerGetRecurringJobsInfo: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -150,7 +194,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **string**| | + **name** | **string**| | ### Return type @@ -162,13 +206,13 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json + - **Content-Type**: Not defined + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiWorkerIdGet** -> apiWorkerIdGet($id) +# **queueControllerGetScheduledJobs** +> queueControllerGetScheduledJobs($name) @@ -176,11 +220,10 @@ void (empty response body) ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\WorkerApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -188,12 +231,12 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\WorkerApi( new GuzzleHttp\Client(), $config ); -$id = "id_example"; // string | +$name = "name_example"; // string | try { - $apiInstance->apiWorkerIdGet($id); + $apiInstance->queueControllerGetScheduledJobs($name); } catch (Exception $e) { - echo 'Exception when calling WorkerApi->apiWorkerIdGet: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling WorkerApi->queueControllerGetScheduledJobs: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -202,7 +245,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **id** | **string**| | + **name** | **string**| | ### Return type @@ -214,13 +257,13 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json + - **Content-Type**: Not defined + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) -# **apiWorkerPost** -> apiWorkerPost($addJobDto) +# **queueControllerRemoveJob** +> queueControllerRemoveJob($id) @@ -228,11 +271,10 @@ void (empty response body) ```php setAccessToken('YOUR_ACCESS_TOKEN'); -// Configure API key authorization: bearer -$config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKey('access_token', 'YOUR_API_KEY'); -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -// $config = Yoast\MyYoastApiClient\Configuration::getDefaultConfiguration()->setApiKeyPrefix('access_token', 'Bearer'); $apiInstance = new Yoast\MyYoastApiClient\Api\WorkerApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. @@ -240,12 +282,12 @@ $apiInstance = new Yoast\MyYoastApiClient\Api\WorkerApi( new GuzzleHttp\Client(), $config ); -$addJobDto = new \Yoast\MyYoastApiClient\Model\AddJobDto(); // \Yoast\MyYoastApiClient\Model\AddJobDto | +$id = "id_example"; // string | try { - $apiInstance->apiWorkerPost($addJobDto); + $apiInstance->queueControllerRemoveJob($id); } catch (Exception $e) { - echo 'Exception when calling WorkerApi->apiWorkerPost: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling WorkerApi->queueControllerRemoveJob: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -254,7 +296,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **addJobDto** | [**\Yoast\MyYoastApiClient\Model\AddJobDto**](../Model/AddJobDto.md)| | + **id** | **string**| | ### Return type @@ -266,8 +308,8 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: application/json - - **Accept**: application/json + - **Content-Type**: Not defined + - **Accept**: Not defined [[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) diff --git a/docs/Model/AccessToken.md b/docs/Model/AccessToken.md index cc60d44..257158b 100644 --- a/docs/Model/AccessToken.md +++ b/docs/Model/AccessToken.md @@ -10,6 +10,5 @@ Name | Type | Description | Notes **modifiedAt** | [**\DateTime**](\DateTime.md) | | **userId** | **string** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ActivateAccountDto.md b/docs/Model/ActivateAccountDto.md index 2529920..778781d 100644 --- a/docs/Model/ActivateAccountDto.md +++ b/docs/Model/ActivateAccountDto.md @@ -5,6 +5,5 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **key** | **string** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AddJobDto.md b/docs/Model/AddJobDto.md index 95debdf..becbcc4 100644 --- a/docs/Model/AddJobDto.md +++ b/docs/Model/AddJobDto.md @@ -7,6 +7,5 @@ Name | Type | Description | Notes **data** | **object** | | [optional] **options** | [**\Yoast\MyYoastApiClient\Model\JobOptionsDto**](JobOptionsDto.md) | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/AddSubscriptionDto.md b/docs/Model/AddSubscriptionDto.md index 1af9041..7533bac 100644 --- a/docs/Model/AddSubscriptionDto.md +++ b/docs/Model/AddSubscriptionDto.md @@ -5,6 +5,5 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **subscriptionId** | **string** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Admission.md b/docs/Model/Admission.md new file mode 100644 index 0000000..95d9d77 --- /dev/null +++ b/docs/Model/Admission.md @@ -0,0 +1,14 @@ +# Admission + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | +**createdAt** | [**\DateTime**](\DateTime.md) | | +**modifiedAt** | [**\DateTime**](\DateTime.md) | | +**studentId** | **string** | | +**buyerId** | **string** | | +**subscriptionId** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/docs/Model/AutoRenewalCountResponseDto.md b/docs/Model/AutoRenewalCountResponseDto.md index d1a4f8a..88cf008 100644 --- a/docs/Model/AutoRenewalCountResponseDto.md +++ b/docs/Model/AutoRenewalCountResponseDto.md @@ -3,8 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**amount** | **float** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +**amount** | **int** | | +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BillingDto.md b/docs/Model/BillingDto.md index bc3a959..050ccb7 100644 --- a/docs/Model/BillingDto.md +++ b/docs/Model/BillingDto.md @@ -15,6 +15,5 @@ Name | Type | Description | Notes **email** | **string** | | **phone** | **string** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Blacklist.md b/docs/Model/Blacklist.md index 965891d..df668fb 100644 --- a/docs/Model/Blacklist.md +++ b/docs/Model/Blacklist.md @@ -7,6 +7,5 @@ Name | Type | Description | Notes **url** | **string** | | **dateAdded** | [**\DateTime**](\DateTime.md) | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BulkInviteDto.md b/docs/Model/BulkInviteDto.md index 6db3114..929d757 100644 --- a/docs/Model/BulkInviteDto.md +++ b/docs/Model/BulkInviteDto.md @@ -7,6 +7,5 @@ Name | Type | Description | Notes **lineItemNumber** | **string** | | **email** | **string** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/BulkSendEmailDto.md b/docs/Model/BulkSendEmailDto.md new file mode 100644 index 0000000..e854e00 --- /dev/null +++ b/docs/Model/BulkSendEmailDto.md @@ -0,0 +1,10 @@ +# BulkSendEmailDto + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**templateName** | **string** | The alias of the PostMark template to send to all recipients. | +**receiverEmails** | **string[]** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/docs/Model/CancelProvisionedSubscriptionDto.md b/docs/Model/CancelProvisionedSubscriptionDto.md new file mode 100644 index 0000000..ea8eb47 --- /dev/null +++ b/docs/Model/CancelProvisionedSubscriptionDto.md @@ -0,0 +1,9 @@ +# CancelProvisionedSubscriptionDto + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**immediately** | **bool** | Immediately will cancel the subscription directly, otherwise it will end when the period has expired. | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/docs/Model/CancelSubscriptionBodyDto.md b/docs/Model/CancelSubscriptionBodyDto.md index 2f16a63..02aa480 100644 --- a/docs/Model/CancelSubscriptionBodyDto.md +++ b/docs/Model/CancelSubscriptionBodyDto.md @@ -5,6 +5,5 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **amount** | **int** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ChangePasswordDto.md b/docs/Model/ChangePasswordDto.md index fc0bff4..e67ba64 100644 --- a/docs/Model/ChangePasswordDto.md +++ b/docs/Model/ChangePasswordDto.md @@ -7,6 +7,5 @@ Name | Type | Description | Notes **passwordConfirmation** | **string** | | **oldPassword** | **string** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ComposerToken.md b/docs/Model/ComposerToken.md index 2d5403b..2a46236 100644 --- a/docs/Model/ComposerToken.md +++ b/docs/Model/ComposerToken.md @@ -10,6 +10,5 @@ Name | Type | Description | Notes **modifiedAt** | [**\DateTime**](\DateTime.md) | | **userId** | **string** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CouponLineDto.md b/docs/Model/CouponLineDto.md index 96cb531..5d1da30 100644 --- a/docs/Model/CouponLineDto.md +++ b/docs/Model/CouponLineDto.md @@ -9,6 +9,5 @@ Name | Type | Description | Notes **discountTax** | **string** | | **metaData** | [**\Yoast\MyYoastApiClient\Model\MetaDataDto[]**](MetaDataDto.md) | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Course.md b/docs/Model/Course.md index 2237c6b..98f60f5 100644 --- a/docs/Model/Course.md +++ b/docs/Model/Course.md @@ -19,6 +19,5 @@ Name | Type | Description | Notes **sale** | **bool** | | **saleLabel** | **string** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CourseDataDto.md b/docs/Model/CourseDataDto.md index 5ddafe7..bd8286f 100644 --- a/docs/Model/CourseDataDto.md +++ b/docs/Model/CourseDataDto.md @@ -6,6 +6,5 @@ Name | Type | Description | Notes **postTitle** | **string** | | **iD** | **int** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CourseEnrollment.md b/docs/Model/CourseEnrollment.md index 2f980ce..b152e33 100644 --- a/docs/Model/CourseEnrollment.md +++ b/docs/Model/CourseEnrollment.md @@ -5,12 +5,13 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **string** | | **status** | **string** | | -**progress** | **float** | | +**progress** | **int** | | **createdAt** | [**\DateTime**](\DateTime.md) | | **modifiedAt** | [**\DateTime**](\DateTime.md) | | **isTrial** | **bool** | | **outsideTrialProgress** | **bool** | | **trialCompleted** | **bool** | | +**isMigrated** | **bool** | | **lineItemId** | **string** | | **lineItemNumber** | **int** | | **expiryDate** | [**\DateTime**](\DateTime.md) | | @@ -20,6 +21,5 @@ Name | Type | Description | Notes **courseId** | **string** | | **productId** | **string** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CourseEnrollmentFromAcademyDto.md b/docs/Model/CourseEnrollmentFromAcademyDto.md index 61d68b2..01bbec9 100644 --- a/docs/Model/CourseEnrollmentFromAcademyDto.md +++ b/docs/Model/CourseEnrollmentFromAcademyDto.md @@ -5,6 +5,5 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **progressData** | [**\Yoast\MyYoastApiClient\Model\ProgressData**](ProgressData.md) | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateBlacklistSiteDto.md b/docs/Model/CreateBlacklistSiteDto.md index 6667aad..2945a90 100644 --- a/docs/Model/CreateBlacklistSiteDto.md +++ b/docs/Model/CreateBlacklistSiteDto.md @@ -4,6 +4,5 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateCustomerNoteDto.md b/docs/Model/CreateCustomerNoteDto.md index a56e728..ac8666f 100644 --- a/docs/Model/CreateCustomerNoteDto.md +++ b/docs/Model/CreateCustomerNoteDto.md @@ -6,8 +6,7 @@ Name | Type | Description | Notes **customerId** | **string** | | **authorId** | **string** | | **content** | **string** | | -**nextContactDate** | [**\DateTime**](\DateTime.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +**nextContactDate** | [**\DateTime**](\DateTime.md) | | [optional] +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateDto.md b/docs/Model/CreateDto.md new file mode 100644 index 0000000..efe816e --- /dev/null +++ b/docs/Model/CreateDto.md @@ -0,0 +1,10 @@ +# CreateDto + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **string** | | +**subscriptionId** | **string** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/docs/Model/CreateProvisionedSubscriptionDto.md b/docs/Model/CreateProvisionedSubscriptionDto.md new file mode 100644 index 0000000..e13527e --- /dev/null +++ b/docs/Model/CreateProvisionedSubscriptionDto.md @@ -0,0 +1,13 @@ +# CreateProvisionedSubscriptionDto + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**customerEmail** | **string** | The email address of the customer. | +**productCode** | **string** | The product-code of the product the subscription is for. | +**site** | **string** | The site URL that the subscription needs to be connectd to. | +**firstName** | **string** | The first name of the customer. | +**lastName** | **string** | The last name of the customers. | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/docs/Model/CreateSiteBodyDto.md b/docs/Model/CreateSiteBodyDto.md index 6a0adfd..5de04c6 100644 --- a/docs/Model/CreateSiteBodyDto.md +++ b/docs/Model/CreateSiteBodyDto.md @@ -6,6 +6,5 @@ Name | Type | Description | Notes **url** | **string** | | **type** | **string** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Customer.md b/docs/Model/Customer.md index d4090c9..7f976f9 100644 --- a/docs/Model/Customer.md +++ b/docs/Model/Customer.md @@ -26,6 +26,5 @@ Name | Type | Description | Notes **userPhone** | **string** | | **userAvatarUrl** | **string** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CustomerData.md b/docs/Model/CustomerData.md index c1dc2b9..761bdc8 100644 --- a/docs/Model/CustomerData.md +++ b/docs/Model/CustomerData.md @@ -19,6 +19,5 @@ Name | Type | Description | Notes **shipping** | [**\Yoast\MyYoastApiClient\Model\ShippingDto**](ShippingDto.md) | | **username** | **string** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CustomerDto.md b/docs/Model/CustomerDto.md index 2d5829c..6b1405c 100644 --- a/docs/Model/CustomerDto.md +++ b/docs/Model/CustomerDto.md @@ -3,12 +3,11 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **float** | | +**id** | **int** | | **fname** | **string** | | **lname** | **string** | | **email** | **string** | | **emails** | **string[]** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CustomerFromWooDto.md b/docs/Model/CustomerFromWooDto.md index d3d9fc4..9541703 100644 --- a/docs/Model/CustomerFromWooDto.md +++ b/docs/Model/CustomerFromWooDto.md @@ -5,6 +5,5 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **customerData** | [**\Yoast\MyYoastApiClient\Model\CustomerData**](CustomerData.md) | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CustomerNote.md b/docs/Model/CustomerNote.md index 5445bf3..9f9dc1a 100644 --- a/docs/Model/CustomerNote.md +++ b/docs/Model/CustomerNote.md @@ -11,6 +11,5 @@ Name | Type | Description | Notes **customerId** | **string** | | **authorId** | **string** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DeleteResult.md b/docs/Model/DeleteResult.md new file mode 100644 index 0000000..9c70b25 --- /dev/null +++ b/docs/Model/DeleteResult.md @@ -0,0 +1,8 @@ +# DeleteResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/docs/Model/EddDTO.md b/docs/Model/EddDTO.md index d4b515c..aeabdbc 100644 --- a/docs/Model/EddDTO.md +++ b/docs/Model/EddDTO.md @@ -7,6 +7,5 @@ Name | Type | Description | Notes **url** | **string** | | **itemName** | **string** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ExtraCourseDataDto.md b/docs/Model/ExtraCourseDataDto.md index 5685da0..fbc0b40 100644 --- a/docs/Model/ExtraCourseDataDto.md +++ b/docs/Model/ExtraCourseDataDto.md @@ -14,6 +14,5 @@ Name | Type | Description | Notes **sale** | **bool** | | **saleLabel** | **string** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ExtraOrderData.md b/docs/Model/ExtraOrderData.md index 764f788..3e9a43d 100644 --- a/docs/Model/ExtraOrderData.md +++ b/docs/Model/ExtraOrderData.md @@ -13,6 +13,5 @@ Name | Type | Description | Notes **transactions** | [**\Yoast\MyYoastApiClient\Model\TransactionDataDto[]**](TransactionDataDto.md) | | **wooRefunds** | [**\Yoast\MyYoastApiClient\Model\RefundDataDto[]**](RefundDataDto.md) | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ExtraProductData.md b/docs/Model/ExtraProductData.md index cade4d3..8d8af90 100644 --- a/docs/Model/ExtraProductData.md +++ b/docs/Model/ExtraProductData.md @@ -8,8 +8,7 @@ Name | Type | Description | Notes **productGroupSlugs** | **string[]** | | **billingType** | **string** | | **billingTerm** | **string** | | [optional] -**activationLimit** | **float** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +**activationLimit** | **int** | | [optional] +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/FeeLineDto.md b/docs/Model/FeeLineDto.md new file mode 100644 index 0000000..ea90d0c --- /dev/null +++ b/docs/Model/FeeLineDto.md @@ -0,0 +1,17 @@ +# FeeLineDto + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | +**name** | **string** | | +**taxClass** | **string** | | +**taxStatus** | **string** | | +**amount** | **string** | | +**total** | **string** | | +**totalTax** | **string** | | +**taxes** | [**\Yoast\MyYoastApiClient\Model\LineItemTax[]**](LineItemTax.md) | | +**metaData** | [**\Yoast\MyYoastApiClient\Model\MetaDataDto[]**](MetaDataDto.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/docs/Model/FromAcademyDto.md b/docs/Model/FromAcademyDto.md index 185861d..217aede 100644 --- a/docs/Model/FromAcademyDto.md +++ b/docs/Model/FromAcademyDto.md @@ -6,6 +6,5 @@ Name | Type | Description | Notes **courseData** | [**\Yoast\MyYoastApiClient\Model\CourseDataDto**](CourseDataDto.md) | | **extraData** | [**\Yoast\MyYoastApiClient\Model\ExtraCourseDataDto**](ExtraCourseDataDto.md) | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GenerateDto.md b/docs/Model/GenerateDto.md index e0db1a9..ad3a5ae 100644 --- a/docs/Model/GenerateDto.md +++ b/docs/Model/GenerateDto.md @@ -5,6 +5,5 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **string** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/HelpScoutDto.md b/docs/Model/HelpScoutDto.md index af7ca74..1b555d8 100644 --- a/docs/Model/HelpScoutDto.md +++ b/docs/Model/HelpScoutDto.md @@ -3,11 +3,10 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**ticket** | [**\Yoast\MyYoastApiClient\Model\TicketDTO**](TicketDTO.md) | | -**customer** | [**\Yoast\MyYoastApiClient\Model\CustomerDto**](CustomerDto.md) | | -**user** | [**\Yoast\MyYoastApiClient\Model\UserDto**](UserDto.md) | | -**mailbox** | [**\Yoast\MyYoastApiClient\Model\MailboxDto**](MailboxDto.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +**ticket** | [**\Yoast\MyYoastApiClient\Model\TicketDto**](TicketDto.md) | | [optional] +**customer** | [**\Yoast\MyYoastApiClient\Model\CustomerDto**](CustomerDto.md) | | [optional] +**user** | [**\Yoast\MyYoastApiClient\Model\UserDto**](UserDto.md) | | [optional] +**mailbox** | [**\Yoast\MyYoastApiClient\Model\MailboxDto**](MailboxDto.md) | | [optional] +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/InviteDto.md b/docs/Model/InviteDto.md index a24fb6c..d778ff3 100644 --- a/docs/Model/InviteDto.md +++ b/docs/Model/InviteDto.md @@ -5,6 +5,5 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **email** | **string** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/JSZip.md b/docs/Model/JSZip.md index d5194d7..6d34fa5 100644 --- a/docs/Model/JSZip.md +++ b/docs/Model/JSZip.md @@ -4,6 +4,5 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/JobOptionsDto.md b/docs/Model/JobOptionsDto.md index aaf4410..9d4b2bb 100644 --- a/docs/Model/JobOptionsDto.md +++ b/docs/Model/JobOptionsDto.md @@ -3,18 +3,17 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**priority** | **float** | | [optional] -**delay** | **float** | | [optional] -**attempts** | **float** | | [optional] +**priority** | **int** | | [optional] +**delay** | **int** | | [optional] +**attempts** | **int** | | [optional] **repeat** | **object** | | [optional] **backoff** | **object** | | [optional] **lifo** | **bool** | | [optional] -**timeout** | **float** | | [optional] +**timeout** | **int** | | [optional] **jobId** | **object** | | [optional] **removeOnComplete** | **object** | | [optional] **removeOnFail** | **object** | | [optional] -**stackTraceLimit** | **float** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +**stackTraceLimit** | **int** | | [optional] +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LineItemDto.md b/docs/Model/LineItemDto.md index 39202da..92bc4c1 100644 --- a/docs/Model/LineItemDto.md +++ b/docs/Model/LineItemDto.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes **bundledItemTitle** | **string** | | [optional] **id** | **int** | | **name** | **string** | | -**price** | **float** | | +**price** | **int** | | **productId** | **int** | | **quantity** | **int** | | **sku** | **string** | | @@ -21,6 +21,5 @@ Name | Type | Description | Notes **bundledItems** | **string[]** | | [optional] **metaData** | [**\Yoast\MyYoastApiClient\Model\MetaDataDto[]**](MetaDataDto.md) | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LineItemTax.md b/docs/Model/LineItemTax.md index 8f7538a..1c1c04b 100644 --- a/docs/Model/LineItemTax.md +++ b/docs/Model/LineItemTax.md @@ -7,6 +7,5 @@ Name | Type | Description | Notes **subtotal** | **string** | | **total** | **string** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LoginDto.md b/docs/Model/LoginDto.md index e35b676..e625f20 100644 --- a/docs/Model/LoginDto.md +++ b/docs/Model/LoginDto.md @@ -6,6 +6,5 @@ Name | Type | Description | Notes **username** | **string** | | **password** | **string** | The password of the MyYoast user to login. | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LoginUserDto.md b/docs/Model/LoginUserDto.md index 11ec89b..a2aca49 100644 --- a/docs/Model/LoginUserDto.md +++ b/docs/Model/LoginUserDto.md @@ -8,6 +8,5 @@ Name | Type | Description | Notes **rememberMe** | **bool** | Whether or not the user wants to remain logged in after closing their browser. | [optional] **otp** | **string** | A one time password AKA 2 factor authentication key. | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LogoutUserBodyDto.md b/docs/Model/LogoutUserBodyDto.md index b039524..f10e0d1 100644 --- a/docs/Model/LogoutUserBodyDto.md +++ b/docs/Model/LogoutUserBodyDto.md @@ -5,6 +5,5 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **nonce** | **string** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/MailboxDto.md b/docs/Model/MailboxDto.md index 79e55de..5996c00 100644 --- a/docs/Model/MailboxDto.md +++ b/docs/Model/MailboxDto.md @@ -3,9 +3,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **float** | | +**id** | **int** | | **email** | **string** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/MetaDataDto.md b/docs/Model/MetaDataDto.md index b7a2cf9..d79b2e0 100644 --- a/docs/Model/MetaDataDto.md +++ b/docs/Model/MetaDataDto.md @@ -7,6 +7,5 @@ Name | Type | Description | Notes **key** | **string** | | **value** | **object** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Order.md b/docs/Model/Order.md index 1e463b1..b0645e0 100644 --- a/docs/Model/Order.md +++ b/docs/Model/Order.md @@ -41,7 +41,7 @@ Name | Type | Description | Notes **customerId** | **string** | | **processedCompletionAt** | [**\DateTime**](\DateTime.md) | | **renewalKey** | **string** | | +**vatNumberValid** | **bool** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OrderData.md b/docs/Model/OrderData.md index 782aeea..4d76b1a 100644 --- a/docs/Model/OrderData.md +++ b/docs/Model/OrderData.md @@ -24,7 +24,7 @@ Name | Type | Description | Notes **discountTax** | **string** | | **discountTotal** | **string** | | **couponLines** | [**\Yoast\MyYoastApiClient\Model\CouponLineDto[]**](CouponLineDto.md) | | -**feeLines** | **string[]** | | +**feeLines** | [**\Yoast\MyYoastApiClient\Model\FeeLineDto[]**](FeeLineDto.md) | | **lineItems** | [**\Yoast\MyYoastApiClient\Model\LineItemDto[]**](LineItemDto.md) | | **metaData** | [**\Yoast\MyYoastApiClient\Model\MetaDataDto[]**](MetaDataDto.md) | | **number** | **string** | | @@ -45,6 +45,5 @@ Name | Type | Description | Notes **transactionId** | **string** | | **version** | **string** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/OrderFromWooDto.md b/docs/Model/OrderFromWooDto.md index b53826c..0c5fa13 100644 --- a/docs/Model/OrderFromWooDto.md +++ b/docs/Model/OrderFromWooDto.md @@ -6,6 +6,5 @@ Name | Type | Description | Notes **orderData** | [**\Yoast\MyYoastApiClient\Model\OrderData**](OrderData.md) | | **extraData** | [**\Yoast\MyYoastApiClient\Model\ExtraOrderData**](ExtraOrderData.md) | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Product.md b/docs/Model/Product.md index 869f3c6..6b6830a 100644 --- a/docs/Model/Product.md +++ b/docs/Model/Product.md @@ -29,6 +29,5 @@ Name | Type | Description | Notes **activationLimit** | **int** | | **courseId** | **string** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ProductCategory.md b/docs/Model/ProductCategory.md index 1a8d8b8..018e2de 100644 --- a/docs/Model/ProductCategory.md +++ b/docs/Model/ProductCategory.md @@ -7,6 +7,5 @@ Name | Type | Description | Notes **name** | **string** | | **slug** | **string** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ProductData.md b/docs/Model/ProductData.md index b8233a2..7e7a8fe 100644 --- a/docs/Model/ProductData.md +++ b/docs/Model/ProductData.md @@ -20,6 +20,5 @@ Name | Type | Description | Notes **taxClass** | **string** | | **categories** | [**\Yoast\MyYoastApiClient\Model\ProductCategory[]**](ProductCategory.md) | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ProductDownload.md b/docs/Model/ProductDownload.md index da063a3..c83a733 100644 --- a/docs/Model/ProductDownload.md +++ b/docs/Model/ProductDownload.md @@ -7,6 +7,5 @@ Name | Type | Description | Notes **name** | **string** | | **file** | **string** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ProductFromWooDto.md b/docs/Model/ProductFromWooDto.md index ffff127..a1660f6 100644 --- a/docs/Model/ProductFromWooDto.md +++ b/docs/Model/ProductFromWooDto.md @@ -6,6 +6,5 @@ Name | Type | Description | Notes **productData** | [**\Yoast\MyYoastApiClient\Model\ProductData**](ProductData.md) | | **extraData** | [**\Yoast\MyYoastApiClient\Model\ExtraProductData**](ExtraProductData.md) | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ProductGroup.md b/docs/Model/ProductGroup.md index 4e424e3..38f9e62 100644 --- a/docs/Model/ProductGroup.md +++ b/docs/Model/ProductGroup.md @@ -16,6 +16,5 @@ Name | Type | Description | Notes **courseId** | **string** | | **parentId** | **string** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ProductGroupExtraData.md b/docs/Model/ProductGroupExtraData.md index 78b43f3..a094910 100644 --- a/docs/Model/ProductGroupExtraData.md +++ b/docs/Model/ProductGroupExtraData.md @@ -7,6 +7,5 @@ Name | Type | Description | Notes **icon** | **string** | | **changelog** | **string** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ProductGroupFromWooDto.md b/docs/Model/ProductGroupFromWooDto.md index 7c9a5de..f280b3a 100644 --- a/docs/Model/ProductGroupFromWooDto.md +++ b/docs/Model/ProductGroupFromWooDto.md @@ -7,6 +7,5 @@ Name | Type | Description | Notes **productGroupMeta** | [**\Yoast\MyYoastApiClient\Model\ProductGroupMeta**](ProductGroupMeta.md) | | **extraData** | [**\Yoast\MyYoastApiClient\Model\ProductGroupExtraData**](ProductGroupExtraData.md) | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ProductGroupMeta.md b/docs/Model/ProductGroupMeta.md index 9ab064a..321014a 100644 --- a/docs/Model/ProductGroupMeta.md +++ b/docs/Model/ProductGroupMeta.md @@ -7,6 +7,5 @@ Name | Type | Description | Notes **svgIcon** | **string** | | **version** | **string** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ProductGroupTerm.md b/docs/Model/ProductGroupTerm.md index 2abba87..06d4ddc 100644 --- a/docs/Model/ProductGroupTerm.md +++ b/docs/Model/ProductGroupTerm.md @@ -7,6 +7,5 @@ Name | Type | Description | Notes **slug** | **string** | | **description** | **string** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ProductImage.md b/docs/Model/ProductImage.md index a663b02..e85f550 100644 --- a/docs/Model/ProductImage.md +++ b/docs/Model/ProductImage.md @@ -13,6 +13,5 @@ Name | Type | Description | Notes **alt** | **string** | | **position** | **int** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ProgressData.md b/docs/Model/ProgressData.md index a111007..680f2ea 100644 --- a/docs/Model/ProgressData.md +++ b/docs/Model/ProgressData.md @@ -11,6 +11,5 @@ Name | Type | Description | Notes **isTrial** | **bool** | | **trialCompleted** | **bool** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ProvisionerData.md b/docs/Model/ProvisionerData.md new file mode 100644 index 0000000..f26176a --- /dev/null +++ b/docs/Model/ProvisionerData.md @@ -0,0 +1,12 @@ +# ProvisionerData + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | +**updatedAt** | [**\DateTime**](\DateTime.md) | | +**createdAt** | [**\DateTime**](\DateTime.md) | | +**userId** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/docs/Model/PurgeKVRequestDto.md b/docs/Model/PurgeKVRequestDto.md index a21c738..87320f8 100644 --- a/docs/Model/PurgeKVRequestDto.md +++ b/docs/Model/PurgeKVRequestDto.md @@ -3,8 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**limit** | **float** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +**limit** | **int** | | [optional] +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Refund.md b/docs/Model/Refund.md index d40e2d1..612b67b 100644 --- a/docs/Model/Refund.md +++ b/docs/Model/Refund.md @@ -13,6 +13,5 @@ Name | Type | Description | Notes **createdAt** | [**\DateTime**](\DateTime.md) | | **orderId** | **string** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RefundDataDto.md b/docs/Model/RefundDataDto.md index 25d36bd..6001c87 100644 --- a/docs/Model/RefundDataDto.md +++ b/docs/Model/RefundDataDto.md @@ -8,11 +8,10 @@ Name | Type | Description | Notes **dateCreatedGmt** | [**\DateTime**](\DateTime.md) | | **amount** | **string** | | **reason** | **string** | | -**refundedBy** | **float** | | +**refundedBy** | **int** | | **refundedPayment** | **bool** | | **metaData** | [**\Yoast\MyYoastApiClient\Model\MetaDataDto[]**](MetaDataDto.md) | | **lineItems** | [**\Yoast\MyYoastApiClient\Model\LineItemDto[]**](LineItemDto.md) | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/RenameBodyDto.md b/docs/Model/RenameBodyDto.md index 57c8a7c..f09ead9 100644 --- a/docs/Model/RenameBodyDto.md +++ b/docs/Model/RenameBodyDto.md @@ -5,6 +5,5 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **string** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/ResetPasswordDto.md b/docs/Model/ResetPasswordDto.md index b9dcc46..74bf685 100644 --- a/docs/Model/ResetPasswordDto.md +++ b/docs/Model/ResetPasswordDto.md @@ -8,6 +8,5 @@ Name | Type | Description | Notes **password2** | **string** | | **key** | **string** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Role.md b/docs/Model/Role.md new file mode 100644 index 0000000..f061cda --- /dev/null +++ b/docs/Model/Role.md @@ -0,0 +1,13 @@ +# Role + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | | +**name** | **string** | | +**description** | **string** | | +**created** | [**\DateTime**](\DateTime.md) | | +**modified** | [**\DateTime**](\DateTime.md) | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/docs/Model/RoleIDDto.md b/docs/Model/RoleIDDto.md index 036c8f6..bfa8d8d 100644 --- a/docs/Model/RoleIDDto.md +++ b/docs/Model/RoleIDDto.md @@ -3,8 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**roleId** | **float** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +**roleId** | **int** | | +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SendResetPasswordEmailDto.md b/docs/Model/SendResetPasswordEmailDto.md index c33bd8b..7c14172 100644 --- a/docs/Model/SendResetPasswordEmailDto.md +++ b/docs/Model/SendResetPasswordEmailDto.md @@ -5,6 +5,5 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **email** | **string** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SetExpiryDateDto.md b/docs/Model/SetExpiryDateDto.md index b4f5890..c94a5a6 100644 --- a/docs/Model/SetExpiryDateDto.md +++ b/docs/Model/SetExpiryDateDto.md @@ -6,6 +6,5 @@ Name | Type | Description | Notes **subscriptionId** | **string** | | **expiryDate** | [**\DateTime**](\DateTime.md) | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SetProvisionedSiteDto.md b/docs/Model/SetProvisionedSiteDto.md new file mode 100644 index 0000000..bb3c4f9 --- /dev/null +++ b/docs/Model/SetProvisionedSiteDto.md @@ -0,0 +1,9 @@ +# SetProvisionedSiteDto + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**site** | **string** | The site that should be connected to this subscription. | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/docs/Model/ShippingDto.md b/docs/Model/ShippingDto.md index 61778c1..692ad22 100644 --- a/docs/Model/ShippingDto.md +++ b/docs/Model/ShippingDto.md @@ -13,6 +13,5 @@ Name | Type | Description | Notes **postcode** | **string** | | **state** | **string** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SignupAccountDto.md b/docs/Model/SignupAccountDto.md index f434f24..87a487d 100644 --- a/docs/Model/SignupAccountDto.md +++ b/docs/Model/SignupAccountDto.md @@ -7,6 +7,5 @@ Name | Type | Description | Notes **repeatPassword** | **string** | | **userEmail** | **string** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Site.md b/docs/Model/Site.md index 8b1ef16..1448075 100644 --- a/docs/Model/Site.md +++ b/docs/Model/Site.md @@ -19,7 +19,7 @@ Name | Type | Description | Notes **clientId** | **string** | | **clientSecret** | **string** | | **userId** | **string** | | +**provisionerId** | **string** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SubscribeByEmailBodyDto.md b/docs/Model/SubscribeByEmailBodyDto.md index b5489a3..3f62279 100644 --- a/docs/Model/SubscribeByEmailBodyDto.md +++ b/docs/Model/SubscribeByEmailBodyDto.md @@ -7,6 +7,5 @@ Name | Type | Description | Notes **firstName** | **string** | | **lastName** | **string** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Subscription.md b/docs/Model/Subscription.md index ff227be..0c73e57 100644 --- a/docs/Model/Subscription.md +++ b/docs/Model/Subscription.md @@ -23,7 +23,9 @@ Name | Type | Description | Notes **renewalSecret** | **string** | | **subscriptionNumber** | **string** | | **lastBillingTerm** | **string** | | +**subscriberId** | **string** | | +**productId** | [**Uuid**](Uuid.md) | | +**provisionerId** | [**Uuid**](Uuid.md) | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/SubscriptionProvisioningResponseDto.md b/docs/Model/SubscriptionProvisioningResponseDto.md new file mode 100644 index 0000000..75134f0 --- /dev/null +++ b/docs/Model/SubscriptionProvisioningResponseDto.md @@ -0,0 +1,15 @@ +# SubscriptionProvisioningResponseDto + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**iD** | **string** | The subscription ID to be used privately. | +**subscriptionNumber** | **string** | The subscription invoice number, can be communicated publicly. | +**status** | **string** | The status of the subscription. | +**startDate** | **int** | The date the subscription has started. | +**endDate** | **int** | The date the subscription will expire. | +**pluginDownloadUrls** | **string[]** | The URLs for the latest version of the download for the products in the subscription. | +**siteUrl** | **string** | The URL for the site connected to this subscription. | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/docs/Model/SwitchSubscriptionNumberOfTimesDto.md b/docs/Model/SwitchSubscriptionNumberOfTimesDto.md index 6b6ad5d..18fce82 100644 --- a/docs/Model/SwitchSubscriptionNumberOfTimesDto.md +++ b/docs/Model/SwitchSubscriptionNumberOfTimesDto.md @@ -7,6 +7,5 @@ Name | Type | Description | Notes **toSourceId** | **int** | | **productId** | **int** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TaxLineItem.md b/docs/Model/TaxLineItem.md index 0a36c26..fd55a4b 100644 --- a/docs/Model/TaxLineItem.md +++ b/docs/Model/TaxLineItem.md @@ -12,6 +12,5 @@ Name | Type | Description | Notes **shippingTaxTotal** | **string** | | **taxTotal** | **string** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TicketDTO.md b/docs/Model/TicketDTO.md index 99774b1..221c4e2 100644 --- a/docs/Model/TicketDTO.md +++ b/docs/Model/TicketDTO.md @@ -1,4 +1,4 @@ -# TicketDTO +# TicketDto ## Properties Name | Type | Description | Notes @@ -7,6 +7,5 @@ Name | Type | Description | Notes **number** | **string** | | **subject** | **string** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/Transaction.md b/docs/Model/Transaction.md index 1a67d51..044e9dd 100644 --- a/docs/Model/Transaction.md +++ b/docs/Model/Transaction.md @@ -3,10 +3,9 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**capturedAmount** | **float** | | -**refundedAmount** | **float** | | +**capturedAmount** | **int** | | +**refundedAmount** | **int** | | **refunds** | **string[]** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TransactionDataDto.md b/docs/Model/TransactionDataDto.md index d8eb9c6..c1ff848 100644 --- a/docs/Model/TransactionDataDto.md +++ b/docs/Model/TransactionDataDto.md @@ -10,6 +10,5 @@ Name | Type | Description | Notes **paid** | **bool** | | **transactionObject** | [**\Yoast\MyYoastApiClient\Model\Transaction**](Transaction.md) | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TransferDto.md b/docs/Model/TransferDto.md index ebd4f39..18b42b4 100644 --- a/docs/Model/TransferDto.md +++ b/docs/Model/TransferDto.md @@ -6,6 +6,5 @@ Name | Type | Description | Notes **fromSourceId** | **int** | | **toSourceId** | **int** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TransferOwnershipDto.md b/docs/Model/TransferOwnershipDto.md index c580320..311e637 100644 --- a/docs/Model/TransferOwnershipDto.md +++ b/docs/Model/TransferOwnershipDto.md @@ -6,6 +6,5 @@ Name | Type | Description | Notes **fromCustomerId** | **string** | | **toCustomerId** | **string** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/TransferSiteDto.md b/docs/Model/TransferSiteDto.md index 048b34b..e2d6e3a 100644 --- a/docs/Model/TransferSiteDto.md +++ b/docs/Model/TransferSiteDto.md @@ -6,6 +6,5 @@ Name | Type | Description | Notes **fromSourceId** | **int** | | **toSourceId** | **int** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdateAllKVRequestDto.md b/docs/Model/UpdateAllKVRequestDto.md index 352f62a..334242f 100644 --- a/docs/Model/UpdateAllKVRequestDto.md +++ b/docs/Model/UpdateAllKVRequestDto.md @@ -4,9 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **urls** | **string[]** | | [optional] -**pageSize** | **float** | | [optional] -**page** | **float** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +**pageSize** | **int** | | [optional] +**page** | **int** | | [optional] +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdateDto.md b/docs/Model/UpdateDto.md new file mode 100644 index 0000000..745b152 --- /dev/null +++ b/docs/Model/UpdateDto.md @@ -0,0 +1,9 @@ +# UpdateDto + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **string** | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/docs/Model/UpdateFileDto.md b/docs/Model/UpdateFileDto.md index f6a2537..4f76e88 100644 --- a/docs/Model/UpdateFileDto.md +++ b/docs/Model/UpdateFileDto.md @@ -3,9 +3,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**secret** | **string** | | **version** | **string** | | +**overwrite** | **string** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdateSiteDto.md b/docs/Model/UpdateSiteDto.md index 25a11ae..4c89723 100644 --- a/docs/Model/UpdateSiteDto.md +++ b/docs/Model/UpdateSiteDto.md @@ -5,6 +5,5 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | **string** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdateUserDto.md b/docs/Model/UpdateUserDto.md index 8c2511b..1dd241f 100644 --- a/docs/Model/UpdateUserDto.md +++ b/docs/Model/UpdateUserDto.md @@ -9,6 +9,5 @@ Name | Type | Description | Notes **userAvatarUrl** | **string** | | **enabled** | **bool** | | [optional] -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UpdateUserToWordpressDto.md b/docs/Model/UpdateUserToWordpressDto.md index b5976a3..f9ba775 100644 --- a/docs/Model/UpdateUserToWordpressDto.md +++ b/docs/Model/UpdateUserToWordpressDto.md @@ -7,6 +7,5 @@ Name | Type | Description | Notes **firstName** | **string** | | **lastName** | **string** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UserDto.md b/docs/Model/UserDto.md index 1e46c53..f1d9123 100644 --- a/docs/Model/UserDto.md +++ b/docs/Model/UserDto.md @@ -5,10 +5,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **fname** | **string** | | **lname** | **string** | | -**id** | **float** | | +**id** | **int** | | **role** | **string** | | -**convRedirect** | **float** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) +**convRedirect** | **int** | | +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/UserIdentity.md b/docs/Model/UserIdentity.md index 59fe882..7f3ded8 100644 --- a/docs/Model/UserIdentity.md +++ b/docs/Model/UserIdentity.md @@ -15,6 +15,5 @@ Name | Type | Description | Notes **modifiedAt** | [**\DateTime**](\DateTime.md) | | **userId** | **string** | | -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/src/Api/AdmissionApi.php b/src/Api/AdmissionApi.php new file mode 100644 index 0000000..3c3fb3f --- /dev/null +++ b/src/Api/AdmissionApi.php @@ -0,0 +1,1389 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation admissionControllerChangeStudent + * + * Update an admission + * + * @param \Yoast\MyYoastApiClient\Model\UpdateDto $body body (required) + * @param string $id id (required) + * + * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Yoast\MyYoastApiClient\Model\Admission + */ + public function admissionControllerChangeStudent($body, $id) + { + list($response) = $this->admissionControllerChangeStudentWithHttpInfo($body, $id); + return $response; + } + + /** + * Operation admissionControllerChangeStudentWithHttpInfo + * + * Update an admission + * + * @param \Yoast\MyYoastApiClient\Model\UpdateDto $body (required) + * @param string $id (required) + * + * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Yoast\MyYoastApiClient\Model\Admission, HTTP status code, HTTP response headers (array of strings) + */ + public function admissionControllerChangeStudentWithHttpInfo($body, $id) + { + $returnType = '\Yoast\MyYoastApiClient\Model\Admission'; + $request = $this->admissionControllerChangeStudentRequest($body, $id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if (!in_array($returnType, ['string','integer','bool'])) { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Yoast\MyYoastApiClient\Model\Admission', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation admissionControllerChangeStudentAsync + * + * Update an admission + * + * @param \Yoast\MyYoastApiClient\Model\UpdateDto $body (required) + * @param string $id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function admissionControllerChangeStudentAsync($body, $id) + { + return $this->admissionControllerChangeStudentAsyncWithHttpInfo($body, $id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation admissionControllerChangeStudentAsyncWithHttpInfo + * + * Update an admission + * + * @param \Yoast\MyYoastApiClient\Model\UpdateDto $body (required) + * @param string $id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function admissionControllerChangeStudentAsyncWithHttpInfo($body, $id) + { + $returnType = '\Yoast\MyYoastApiClient\Model\Admission'; + $request = $this->admissionControllerChangeStudentRequest($body, $id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + 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(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'admissionControllerChangeStudent' + * + * @param \Yoast\MyYoastApiClient\Model\UpdateDto $body (required) + * @param string $id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function admissionControllerChangeStudentRequest($body, $id) + { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling admissionControllerChangeStudent' + ); + } + // 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 admissionControllerChangeStudent' + ); + } + + $resourcePath = '/api/Admissions/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation admissionControllerGetMany + * + * Get admissions + * + * @param object $filter Used for filtering/joining the results. (optional) + * + * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Yoast\MyYoastApiClient\Model\Admission[] + */ + public function admissionControllerGetMany($filter = null) + { + list($response) = $this->admissionControllerGetManyWithHttpInfo($filter); + return $response; + } + + /** + * Operation admissionControllerGetManyWithHttpInfo + * + * Get admissions + * + * @param object $filter Used for filtering/joining the results. (optional) + * + * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Yoast\MyYoastApiClient\Model\Admission[], HTTP status code, HTTP response headers (array of strings) + */ + public function admissionControllerGetManyWithHttpInfo($filter = null) + { + $returnType = '\Yoast\MyYoastApiClient\Model\Admission[]'; + $request = $this->admissionControllerGetManyRequest($filter); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if (!in_array($returnType, ['string','integer','bool'])) { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Yoast\MyYoastApiClient\Model\Admission[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation admissionControllerGetManyAsync + * + * Get admissions + * + * @param object $filter Used for filtering/joining the results. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function admissionControllerGetManyAsync($filter = null) + { + return $this->admissionControllerGetManyAsyncWithHttpInfo($filter) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation admissionControllerGetManyAsyncWithHttpInfo + * + * Get admissions + * + * @param object $filter Used for filtering/joining the results. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function admissionControllerGetManyAsyncWithHttpInfo($filter = null) + { + $returnType = '\Yoast\MyYoastApiClient\Model\Admission[]'; + $request = $this->admissionControllerGetManyRequest($filter); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + 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(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'admissionControllerGetMany' + * + * @param object $filter Used for filtering/joining the results. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function admissionControllerGetManyRequest($filter = null) + { + + $resourcePath = '/api/Admissions'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($filter !== null) { + $queryParams['filter'] = ObjectSerializer::toQueryValue($filter, null); + } + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation admissionControllerGetManyPaged + * + * Get admissions + * + * @param object $filter Used for filtering/joining the results. (optional) + * + * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function admissionControllerGetManyPaged($filter = null) + { + $this->admissionControllerGetManyPagedWithHttpInfo($filter); + } + + /** + * Operation admissionControllerGetManyPagedWithHttpInfo + * + * Get admissions + * + * @param object $filter Used for filtering/joining the results. (optional) + * + * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function admissionControllerGetManyPagedWithHttpInfo($filter = null) + { + $returnType = ''; + $request = $this->admissionControllerGetManyPagedRequest($filter); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation admissionControllerGetManyPagedAsync + * + * Get admissions + * + * @param object $filter Used for filtering/joining the results. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function admissionControllerGetManyPagedAsync($filter = null) + { + return $this->admissionControllerGetManyPagedAsyncWithHttpInfo($filter) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation admissionControllerGetManyPagedAsyncWithHttpInfo + * + * Get admissions + * + * @param object $filter Used for filtering/joining the results. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function admissionControllerGetManyPagedAsyncWithHttpInfo($filter = null) + { + $returnType = ''; + $request = $this->admissionControllerGetManyPagedRequest($filter); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $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(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'admissionControllerGetManyPaged' + * + * @param object $filter Used for filtering/joining the results. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function admissionControllerGetManyPagedRequest($filter = null) + { + + $resourcePath = '/api/Admissions/paged'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($filter !== null) { + $queryParams['filter'] = ObjectSerializer::toQueryValue($filter, null); + } + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + [] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + [], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation admissionControllerGetOne + * + * Get an admission + * + * @param string $id id (required) + * + * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Yoast\MyYoastApiClient\Model\Admission + */ + public function admissionControllerGetOne($id) + { + list($response) = $this->admissionControllerGetOneWithHttpInfo($id); + return $response; + } + + /** + * Operation admissionControllerGetOneWithHttpInfo + * + * Get an admission + * + * @param string $id (required) + * + * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Yoast\MyYoastApiClient\Model\Admission, HTTP status code, HTTP response headers (array of strings) + */ + public function admissionControllerGetOneWithHttpInfo($id) + { + $returnType = '\Yoast\MyYoastApiClient\Model\Admission'; + $request = $this->admissionControllerGetOneRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if (!in_array($returnType, ['string','integer','bool'])) { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Yoast\MyYoastApiClient\Model\Admission', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation admissionControllerGetOneAsync + * + * Get an admission + * + * @param string $id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function admissionControllerGetOneAsync($id) + { + return $this->admissionControllerGetOneAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation admissionControllerGetOneAsyncWithHttpInfo + * + * Get an admission + * + * @param string $id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function admissionControllerGetOneAsyncWithHttpInfo($id) + { + $returnType = '\Yoast\MyYoastApiClient\Model\Admission'; + $request = $this->admissionControllerGetOneRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + 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(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'admissionControllerGetOne' + * + * @param string $id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function admissionControllerGetOneRequest($id) + { + // 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 admissionControllerGetOne' + ); + } + + $resourcePath = '/api/Admissions/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation admissionControllerInvite + * + * Invite a customer + * + * @param \Yoast\MyYoastApiClient\Model\CreateDto $body body (required) + * + * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Yoast\MyYoastApiClient\Model\Admission + */ + public function admissionControllerInvite($body) + { + list($response) = $this->admissionControllerInviteWithHttpInfo($body); + return $response; + } + + /** + * Operation admissionControllerInviteWithHttpInfo + * + * Invite a customer + * + * @param \Yoast\MyYoastApiClient\Model\CreateDto $body (required) + * + * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Yoast\MyYoastApiClient\Model\Admission, HTTP status code, HTTP response headers (array of strings) + */ + public function admissionControllerInviteWithHttpInfo($body) + { + $returnType = '\Yoast\MyYoastApiClient\Model\Admission'; + $request = $this->admissionControllerInviteRequest($body); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if (!in_array($returnType, ['string','integer','bool'])) { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Yoast\MyYoastApiClient\Model\Admission', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation admissionControllerInviteAsync + * + * Invite a customer + * + * @param \Yoast\MyYoastApiClient\Model\CreateDto $body (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function admissionControllerInviteAsync($body) + { + return $this->admissionControllerInviteAsyncWithHttpInfo($body) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation admissionControllerInviteAsyncWithHttpInfo + * + * Invite a customer + * + * @param \Yoast\MyYoastApiClient\Model\CreateDto $body (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function admissionControllerInviteAsyncWithHttpInfo($body) + { + $returnType = '\Yoast\MyYoastApiClient\Model\Admission'; + $request = $this->admissionControllerInviteRequest($body); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + 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(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'admissionControllerInvite' + * + * @param \Yoast\MyYoastApiClient\Model\CreateDto $body (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function admissionControllerInviteRequest($body) + { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling admissionControllerInvite' + ); + } + + $resourcePath = '/api/Admissions'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // body params + $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $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/src/Api/AuthApi.php b/src/Api/AuthApi.php index 6cdd896..0fe699e 100644 --- a/src/Api/AuthApi.php +++ b/src/Api/AuthApi.php @@ -17,9 +17,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -88,37 +87,37 @@ public function getConfig() } /** - * Operation apiCustomersLoginPost + * Operation loginControllerGenerateAccessToken * * Log in a user on MyYoast. * - * @param \Yoast\MyYoastApiClient\Model\LoginDto $loginDto loginDto (required) + * @param \Yoast\MyYoastApiClient\Model\LoginDto $body body (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Yoast\MyYoastApiClient\Model\AccessToken */ - public function apiCustomersLoginPost($loginDto) + public function loginControllerGenerateAccessToken($body) { - list($response) = $this->apiCustomersLoginPostWithHttpInfo($loginDto); + list($response) = $this->loginControllerGenerateAccessTokenWithHttpInfo($body); return $response; } /** - * Operation apiCustomersLoginPostWithHttpInfo + * Operation loginControllerGenerateAccessTokenWithHttpInfo * * Log in a user on MyYoast. * - * @param \Yoast\MyYoastApiClient\Model\LoginDto $loginDto (required) + * @param \Yoast\MyYoastApiClient\Model\LoginDto $body (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Yoast\MyYoastApiClient\Model\AccessToken, HTTP status code, HTTP response headers (array of strings) */ - public function apiCustomersLoginPostWithHttpInfo($loginDto) + public function loginControllerGenerateAccessTokenWithHttpInfo($body) { $returnType = '\Yoast\MyYoastApiClient\Model\AccessToken'; - $request = $this->apiCustomersLoginPostRequest($loginDto); + $request = $this->loginControllerGenerateAccessTokenRequest($body); try { $options = $this->createHttpClientOption(); @@ -153,7 +152,7 @@ public function apiCustomersLoginPostWithHttpInfo($loginDto) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -180,18 +179,18 @@ public function apiCustomersLoginPostWithHttpInfo($loginDto) } /** - * Operation apiCustomersLoginPostAsync + * Operation loginControllerGenerateAccessTokenAsync * * Log in a user on MyYoast. * - * @param \Yoast\MyYoastApiClient\Model\LoginDto $loginDto (required) + * @param \Yoast\MyYoastApiClient\Model\LoginDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersLoginPostAsync($loginDto) + public function loginControllerGenerateAccessTokenAsync($body) { - return $this->apiCustomersLoginPostAsyncWithHttpInfo($loginDto) + return $this->loginControllerGenerateAccessTokenAsyncWithHttpInfo($body) ->then( function ($response) { return $response[0]; @@ -200,19 +199,19 @@ function ($response) { } /** - * Operation apiCustomersLoginPostAsyncWithHttpInfo + * Operation loginControllerGenerateAccessTokenAsyncWithHttpInfo * * Log in a user on MyYoast. * - * @param \Yoast\MyYoastApiClient\Model\LoginDto $loginDto (required) + * @param \Yoast\MyYoastApiClient\Model\LoginDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersLoginPostAsyncWithHttpInfo($loginDto) + public function loginControllerGenerateAccessTokenAsyncWithHttpInfo($body) { $returnType = '\Yoast\MyYoastApiClient\Model\AccessToken'; - $request = $this->apiCustomersLoginPostRequest($loginDto); + $request = $this->loginControllerGenerateAccessTokenRequest($body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -252,19 +251,19 @@ function ($exception) { } /** - * Create request for operation 'apiCustomersLoginPost' + * Create request for operation 'loginControllerGenerateAccessToken' * - * @param \Yoast\MyYoastApiClient\Model\LoginDto $loginDto (required) + * @param \Yoast\MyYoastApiClient\Model\LoginDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCustomersLoginPostRequest($loginDto) + protected function loginControllerGenerateAccessTokenRequest($body) { - // verify the required parameter 'loginDto' is set - if ($loginDto === null || (is_array($loginDto) && count($loginDto) === 0)) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $loginDto when calling apiCustomersLoginPost' + 'Missing the required parameter $body when calling loginControllerGenerateAccessToken' ); } @@ -279,8 +278,8 @@ protected function apiCustomersLoginPostRequest($loginDto) // body params $_tempBody = null; - if (isset($loginDto)) { - $_tempBody = $loginDto; + if (isset($body)) { + $_tempBody = $body; } if ($multipart) { @@ -298,16 +297,9 @@ protected function apiCustomersLoginPostRequest($loginDto) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -352,33 +344,33 @@ protected function apiCustomersLoginPostRequest($loginDto) } /** - * Operation apiCustomersLoginUserPost + * Operation loginControllerLoginUser * - * @param \Yoast\MyYoastApiClient\Model\LoginUserDto $loginUserDto loginUserDto (required) + * @param \Yoast\MyYoastApiClient\Model\LoginUserDto $body body (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return object */ - public function apiCustomersLoginUserPost($loginUserDto) + public function loginControllerLoginUser($body) { - list($response) = $this->apiCustomersLoginUserPostWithHttpInfo($loginUserDto); + list($response) = $this->loginControllerLoginUserWithHttpInfo($body); return $response; } /** - * Operation apiCustomersLoginUserPostWithHttpInfo + * Operation loginControllerLoginUserWithHttpInfo * - * @param \Yoast\MyYoastApiClient\Model\LoginUserDto $loginUserDto (required) + * @param \Yoast\MyYoastApiClient\Model\LoginUserDto $body (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of object, HTTP status code, HTTP response headers (array of strings) */ - public function apiCustomersLoginUserPostWithHttpInfo($loginUserDto) + public function loginControllerLoginUserWithHttpInfo($body) { $returnType = 'object'; - $request = $this->apiCustomersLoginUserPostRequest($loginUserDto); + $request = $this->loginControllerLoginUserRequest($body); try { $options = $this->createHttpClientOption(); @@ -413,7 +405,7 @@ public function apiCustomersLoginUserPostWithHttpInfo($loginUserDto) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -440,18 +432,18 @@ public function apiCustomersLoginUserPostWithHttpInfo($loginUserDto) } /** - * Operation apiCustomersLoginUserPostAsync + * Operation loginControllerLoginUserAsync * * * - * @param \Yoast\MyYoastApiClient\Model\LoginUserDto $loginUserDto (required) + * @param \Yoast\MyYoastApiClient\Model\LoginUserDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersLoginUserPostAsync($loginUserDto) + public function loginControllerLoginUserAsync($body) { - return $this->apiCustomersLoginUserPostAsyncWithHttpInfo($loginUserDto) + return $this->loginControllerLoginUserAsyncWithHttpInfo($body) ->then( function ($response) { return $response[0]; @@ -460,19 +452,19 @@ function ($response) { } /** - * Operation apiCustomersLoginUserPostAsyncWithHttpInfo + * Operation loginControllerLoginUserAsyncWithHttpInfo * * * - * @param \Yoast\MyYoastApiClient\Model\LoginUserDto $loginUserDto (required) + * @param \Yoast\MyYoastApiClient\Model\LoginUserDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersLoginUserPostAsyncWithHttpInfo($loginUserDto) + public function loginControllerLoginUserAsyncWithHttpInfo($body) { $returnType = 'object'; - $request = $this->apiCustomersLoginUserPostRequest($loginUserDto); + $request = $this->loginControllerLoginUserRequest($body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -512,19 +504,19 @@ function ($exception) { } /** - * Create request for operation 'apiCustomersLoginUserPost' + * Create request for operation 'loginControllerLoginUser' * - * @param \Yoast\MyYoastApiClient\Model\LoginUserDto $loginUserDto (required) + * @param \Yoast\MyYoastApiClient\Model\LoginUserDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCustomersLoginUserPostRequest($loginUserDto) + protected function loginControllerLoginUserRequest($body) { - // verify the required parameter 'loginUserDto' is set - if ($loginUserDto === null || (is_array($loginUserDto) && count($loginUserDto) === 0)) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $loginUserDto when calling apiCustomersLoginUserPost' + 'Missing the required parameter $body when calling loginControllerLoginUser' ); } @@ -539,8 +531,8 @@ protected function apiCustomersLoginUserPostRequest($loginUserDto) // body params $_tempBody = null; - if (isset($loginUserDto)) { - $_tempBody = $loginUserDto; + if (isset($body)) { + $_tempBody = $body; } if ($multipart) { @@ -558,16 +550,9 @@ protected function apiCustomersLoginUserPostRequest($loginUserDto) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -612,37 +597,37 @@ protected function apiCustomersLoginUserPostRequest($loginUserDto) } /** - * Operation apiCustomersLogoutUserPost + * Operation loginControllerLogoutUser * * Logout the user on Yoast.com. * - * @param \Yoast\MyYoastApiClient\Model\LogoutUserBodyDto $logoutUserBodyDto logoutUserBodyDto (required) + * @param \Yoast\MyYoastApiClient\Model\LogoutUserBodyDto $body body (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return object */ - public function apiCustomersLogoutUserPost($logoutUserBodyDto) + public function loginControllerLogoutUser($body) { - list($response) = $this->apiCustomersLogoutUserPostWithHttpInfo($logoutUserBodyDto); + list($response) = $this->loginControllerLogoutUserWithHttpInfo($body); return $response; } /** - * Operation apiCustomersLogoutUserPostWithHttpInfo + * Operation loginControllerLogoutUserWithHttpInfo * * Logout the user on Yoast.com. * - * @param \Yoast\MyYoastApiClient\Model\LogoutUserBodyDto $logoutUserBodyDto (required) + * @param \Yoast\MyYoastApiClient\Model\LogoutUserBodyDto $body (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of object, HTTP status code, HTTP response headers (array of strings) */ - public function apiCustomersLogoutUserPostWithHttpInfo($logoutUserBodyDto) + public function loginControllerLogoutUserWithHttpInfo($body) { $returnType = 'object'; - $request = $this->apiCustomersLogoutUserPostRequest($logoutUserBodyDto); + $request = $this->loginControllerLogoutUserRequest($body); try { $options = $this->createHttpClientOption(); @@ -677,7 +662,7 @@ public function apiCustomersLogoutUserPostWithHttpInfo($logoutUserBodyDto) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -704,18 +689,18 @@ public function apiCustomersLogoutUserPostWithHttpInfo($logoutUserBodyDto) } /** - * Operation apiCustomersLogoutUserPostAsync + * Operation loginControllerLogoutUserAsync * * Logout the user on Yoast.com. * - * @param \Yoast\MyYoastApiClient\Model\LogoutUserBodyDto $logoutUserBodyDto (required) + * @param \Yoast\MyYoastApiClient\Model\LogoutUserBodyDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersLogoutUserPostAsync($logoutUserBodyDto) + public function loginControllerLogoutUserAsync($body) { - return $this->apiCustomersLogoutUserPostAsyncWithHttpInfo($logoutUserBodyDto) + return $this->loginControllerLogoutUserAsyncWithHttpInfo($body) ->then( function ($response) { return $response[0]; @@ -724,19 +709,19 @@ function ($response) { } /** - * Operation apiCustomersLogoutUserPostAsyncWithHttpInfo + * Operation loginControllerLogoutUserAsyncWithHttpInfo * * Logout the user on Yoast.com. * - * @param \Yoast\MyYoastApiClient\Model\LogoutUserBodyDto $logoutUserBodyDto (required) + * @param \Yoast\MyYoastApiClient\Model\LogoutUserBodyDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersLogoutUserPostAsyncWithHttpInfo($logoutUserBodyDto) + public function loginControllerLogoutUserAsyncWithHttpInfo($body) { $returnType = 'object'; - $request = $this->apiCustomersLogoutUserPostRequest($logoutUserBodyDto); + $request = $this->loginControllerLogoutUserRequest($body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -776,19 +761,19 @@ function ($exception) { } /** - * Create request for operation 'apiCustomersLogoutUserPost' + * Create request for operation 'loginControllerLogoutUser' * - * @param \Yoast\MyYoastApiClient\Model\LogoutUserBodyDto $logoutUserBodyDto (required) + * @param \Yoast\MyYoastApiClient\Model\LogoutUserBodyDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCustomersLogoutUserPostRequest($logoutUserBodyDto) + protected function loginControllerLogoutUserRequest($body) { - // verify the required parameter 'logoutUserBodyDto' is set - if ($logoutUserBodyDto === null || (is_array($logoutUserBodyDto) && count($logoutUserBodyDto) === 0)) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $logoutUserBodyDto when calling apiCustomersLogoutUserPost' + 'Missing the required parameter $body when calling loginControllerLogoutUser' ); } @@ -803,8 +788,8 @@ protected function apiCustomersLogoutUserPostRequest($logoutUserBodyDto) // body params $_tempBody = null; - if (isset($logoutUserBodyDto)) { - $_tempBody = $logoutUserBodyDto; + if (isset($body)) { + $_tempBody = $body; } if ($multipart) { @@ -822,16 +807,9 @@ protected function apiCustomersLogoutUserPostRequest($logoutUserBodyDto) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -876,30 +854,31 @@ protected function apiCustomersLogoutUserPostRequest($logoutUserBodyDto) } /** - * Operation authYoastCallbackGet + * Operation loginControllerRemoveAccessToken * * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return object */ - public function authYoastCallbackGet() + public function loginControllerRemoveAccessToken() { - $this->authYoastCallbackGetWithHttpInfo(); + list($response) = $this->loginControllerRemoveAccessTokenWithHttpInfo(); + return $response; } /** - * Operation authYoastCallbackGetWithHttpInfo + * Operation loginControllerRemoveAccessTokenWithHttpInfo * * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of object, HTTP status code, HTTP response headers (array of strings) */ - public function authYoastCallbackGetWithHttpInfo() + public function loginControllerRemoveAccessTokenWithHttpInfo() { - $returnType = ''; - $request = $this->authYoastCallbackGetRequest(); + $returnType = 'object'; + $request = $this->loginControllerRemoveAccessTokenRequest(); try { $options = $this->createHttpClientOption(); @@ -929,17 +908,39 @@ public function authYoastCallbackGetWithHttpInfo() ); } - return [null, $statusCode, $response->getHeaders()]; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if (!in_array($returnType, ['string','integer','bool'])) { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; } catch (ApiException $e) { switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } } /** - * Operation authYoastCallbackGetAsync + * Operation loginControllerRemoveAccessTokenAsync * * * @@ -947,9 +948,9 @@ public function authYoastCallbackGetWithHttpInfo() * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function authYoastCallbackGetAsync() + public function loginControllerRemoveAccessTokenAsync() { - return $this->authYoastCallbackGetAsyncWithHttpInfo() + return $this->loginControllerRemoveAccessTokenAsyncWithHttpInfo() ->then( function ($response) { return $response[0]; @@ -958,7 +959,7 @@ function ($response) { } /** - * Operation authYoastCallbackGetAsyncWithHttpInfo + * Operation loginControllerRemoveAccessTokenAsyncWithHttpInfo * * * @@ -966,16 +967,30 @@ function ($response) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function authYoastCallbackGetAsyncWithHttpInfo() + public function loginControllerRemoveAccessTokenAsyncWithHttpInfo() { - $returnType = ''; - $request = $this->authYoastCallbackGetRequest(); + $returnType = 'object'; + $request = $this->loginControllerRemoveAccessTokenRequest(); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -995,16 +1010,16 @@ function ($exception) { } /** - * Create request for operation 'authYoastCallbackGet' + * Create request for operation 'loginControllerRemoveAccessToken' * * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function authYoastCallbackGetRequest() + protected function loginControllerRemoveAccessTokenRequest() { - $resourcePath = '/auth/yoast/callback'; + $resourcePath = '/logout'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1023,7 +1038,7 @@ protected function authYoastCallbackGetRequest() } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -1031,16 +1046,9 @@ protected function authYoastCallbackGetRequest() if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -1063,6 +1071,10 @@ protected function authYoastCallbackGetRequest() } } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1085,30 +1097,30 @@ protected function authYoastCallbackGetRequest() } /** - * Operation authYoastGet + * Operation yoastComOpenIdControllerYoastComCallback * * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function authYoastGet() + public function yoastComOpenIdControllerYoastComCallback() { - $this->authYoastGetWithHttpInfo(); + $this->yoastComOpenIdControllerYoastComCallbackWithHttpInfo(); } /** - * Operation authYoastGetWithHttpInfo + * Operation yoastComOpenIdControllerYoastComCallbackWithHttpInfo * * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function authYoastGetWithHttpInfo() + public function yoastComOpenIdControllerYoastComCallbackWithHttpInfo() { $returnType = ''; - $request = $this->authYoastGetRequest(); + $request = $this->yoastComOpenIdControllerYoastComCallbackRequest(); try { $options = $this->createHttpClientOption(); @@ -1148,7 +1160,7 @@ public function authYoastGetWithHttpInfo() } /** - * Operation authYoastGetAsync + * Operation yoastComOpenIdControllerYoastComCallbackAsync * * * @@ -1156,9 +1168,9 @@ public function authYoastGetWithHttpInfo() * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function authYoastGetAsync() + public function yoastComOpenIdControllerYoastComCallbackAsync() { - return $this->authYoastGetAsyncWithHttpInfo() + return $this->yoastComOpenIdControllerYoastComCallbackAsyncWithHttpInfo() ->then( function ($response) { return $response[0]; @@ -1167,7 +1179,7 @@ function ($response) { } /** - * Operation authYoastGetAsyncWithHttpInfo + * Operation yoastComOpenIdControllerYoastComCallbackAsyncWithHttpInfo * * * @@ -1175,10 +1187,10 @@ function ($response) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function authYoastGetAsyncWithHttpInfo() + public function yoastComOpenIdControllerYoastComCallbackAsyncWithHttpInfo() { $returnType = ''; - $request = $this->authYoastGetRequest(); + $request = $this->yoastComOpenIdControllerYoastComCallbackRequest(); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1204,16 +1216,16 @@ function ($exception) { } /** - * Create request for operation 'authYoastGet' + * Create request for operation 'yoastComOpenIdControllerYoastComCallback' * * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function authYoastGetRequest() + protected function yoastComOpenIdControllerYoastComCallbackRequest() { - $resourcePath = '/auth/yoast'; + $resourcePath = '/auth/yoast/callback'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1227,12 +1239,12 @@ protected function authYoastGetRequest() if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + [] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + [], + [] ); } @@ -1240,16 +1252,9 @@ protected function authYoastGetRequest() if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -1294,30 +1299,30 @@ protected function authYoastGetRequest() } /** - * Operation logoutGet + * Operation yoastComOpenIdControllerYoastComLogin * * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function logoutGet() + public function yoastComOpenIdControllerYoastComLogin() { - $this->logoutGetWithHttpInfo(); + $this->yoastComOpenIdControllerYoastComLoginWithHttpInfo(); } /** - * Operation logoutGetWithHttpInfo + * Operation yoastComOpenIdControllerYoastComLoginWithHttpInfo * * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function logoutGetWithHttpInfo() + public function yoastComOpenIdControllerYoastComLoginWithHttpInfo() { $returnType = ''; - $request = $this->logoutGetRequest(); + $request = $this->yoastComOpenIdControllerYoastComLoginRequest(); try { $options = $this->createHttpClientOption(); @@ -1357,7 +1362,7 @@ public function logoutGetWithHttpInfo() } /** - * Operation logoutGetAsync + * Operation yoastComOpenIdControllerYoastComLoginAsync * * * @@ -1365,9 +1370,9 @@ public function logoutGetWithHttpInfo() * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function logoutGetAsync() + public function yoastComOpenIdControllerYoastComLoginAsync() { - return $this->logoutGetAsyncWithHttpInfo() + return $this->yoastComOpenIdControllerYoastComLoginAsyncWithHttpInfo() ->then( function ($response) { return $response[0]; @@ -1376,7 +1381,7 @@ function ($response) { } /** - * Operation logoutGetAsyncWithHttpInfo + * Operation yoastComOpenIdControllerYoastComLoginAsyncWithHttpInfo * * * @@ -1384,10 +1389,10 @@ function ($response) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function logoutGetAsyncWithHttpInfo() + public function yoastComOpenIdControllerYoastComLoginAsyncWithHttpInfo() { $returnType = ''; - $request = $this->logoutGetRequest(); + $request = $this->yoastComOpenIdControllerYoastComLoginRequest(); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1413,16 +1418,16 @@ function ($exception) { } /** - * Create request for operation 'logoutGet' + * Create request for operation 'yoastComOpenIdControllerYoastComLogin' * * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function logoutGetRequest() + protected function yoastComOpenIdControllerYoastComLoginRequest() { - $resourcePath = '/logout'; + $resourcePath = '/auth/yoast'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1436,12 +1441,12 @@ protected function logoutGetRequest() if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + [] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + [], + [] ); } @@ -1449,16 +1454,9 @@ protected function logoutGetRequest() if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -1481,11 +1479,6 @@ protected function logoutGetRequest() } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } $defaultHeaders = []; if ($this->config->getUserAgent()) { diff --git a/src/Api/BlacklistApi.php b/src/Api/BlacklistApi.php index da2e050..12e76a9 100644 --- a/src/Api/BlacklistApi.php +++ b/src/Api/BlacklistApi.php @@ -17,9 +17,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -88,37 +87,37 @@ public function getConfig() } /** - * Operation apiBlacklistGet + * Operation blacklistControllerCreateOne * - * Gets blacklisted sites + * Creates a blacklisted site * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param \Yoast\MyYoastApiClient\Model\CreateBlacklistSiteDto $body body (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\Blacklist[] + * @return \Yoast\MyYoastApiClient\Model\Blacklist */ - public function apiBlacklistGet($filter = null) + public function blacklistControllerCreateOne($body) { - list($response) = $this->apiBlacklistGetWithHttpInfo($filter); + list($response) = $this->blacklistControllerCreateOneWithHttpInfo($body); return $response; } /** - * Operation apiBlacklistGetWithHttpInfo + * Operation blacklistControllerCreateOneWithHttpInfo * - * Gets blacklisted sites + * Creates a blacklisted site * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param \Yoast\MyYoastApiClient\Model\CreateBlacklistSiteDto $body (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Yoast\MyYoastApiClient\Model\Blacklist[], HTTP status code, HTTP response headers (array of strings) + * @return array of \Yoast\MyYoastApiClient\Model\Blacklist, HTTP status code, HTTP response headers (array of strings) */ - public function apiBlacklistGetWithHttpInfo($filter = null) + public function blacklistControllerCreateOneWithHttpInfo($body) { - $returnType = '\Yoast\MyYoastApiClient\Model\Blacklist[]'; - $request = $this->apiBlacklistGetRequest($filter); + $returnType = '\Yoast\MyYoastApiClient\Model\Blacklist'; + $request = $this->blacklistControllerCreateOneRequest($body); try { $options = $this->createHttpClientOption(); @@ -153,7 +152,7 @@ public function apiBlacklistGetWithHttpInfo($filter = null) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -169,7 +168,7 @@ public function apiBlacklistGetWithHttpInfo($filter = null) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Yoast\MyYoastApiClient\Model\Blacklist[]', + '\Yoast\MyYoastApiClient\Model\Blacklist', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -180,18 +179,18 @@ public function apiBlacklistGetWithHttpInfo($filter = null) } /** - * Operation apiBlacklistGetAsync + * Operation blacklistControllerCreateOneAsync * - * Gets blacklisted sites + * Creates a blacklisted site * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param \Yoast\MyYoastApiClient\Model\CreateBlacklistSiteDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiBlacklistGetAsync($filter = null) + public function blacklistControllerCreateOneAsync($body) { - return $this->apiBlacklistGetAsyncWithHttpInfo($filter) + return $this->blacklistControllerCreateOneAsyncWithHttpInfo($body) ->then( function ($response) { return $response[0]; @@ -200,19 +199,19 @@ function ($response) { } /** - * Operation apiBlacklistGetAsyncWithHttpInfo + * Operation blacklistControllerCreateOneAsyncWithHttpInfo * - * Gets blacklisted sites + * Creates a blacklisted site * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param \Yoast\MyYoastApiClient\Model\CreateBlacklistSiteDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiBlacklistGetAsyncWithHttpInfo($filter = null) + public function blacklistControllerCreateOneAsyncWithHttpInfo($body) { - $returnType = '\Yoast\MyYoastApiClient\Model\Blacklist[]'; - $request = $this->apiBlacklistGetRequest($filter); + $returnType = '\Yoast\MyYoastApiClient\Model\Blacklist'; + $request = $this->blacklistControllerCreateOneRequest($body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -252,15 +251,21 @@ function ($exception) { } /** - * Create request for operation 'apiBlacklistGet' + * Create request for operation 'blacklistControllerCreateOne' * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param \Yoast\MyYoastApiClient\Model\CreateBlacklistSiteDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiBlacklistGetRequest($filter = null) + protected function blacklistControllerCreateOneRequest($body) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling blacklistControllerCreateOne' + ); + } $resourcePath = '/api/Blacklist'; $formParams = []; @@ -269,14 +274,13 @@ protected function apiBlacklistGetRequest($filter = null) $httpBody = ''; $multipart = false; - // query params - if ($filter !== null) { - $queryParams['filter'] = ObjectSerializer::toQueryValue($filter); - } // body params $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -293,16 +297,9 @@ protected function apiBlacklistGetRequest($filter = null) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -325,11 +322,10 @@ protected function apiBlacklistGetRequest($filter = null) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -344,7 +340,7 @@ protected function apiBlacklistGetRequest($filter = null) $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'GET', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -352,7 +348,7 @@ protected function apiBlacklistGetRequest($filter = null) } /** - * Operation apiBlacklistIdDelete + * Operation blacklistControllerDeleteOne * * Remove a site from the blacklist * @@ -360,16 +356,16 @@ protected function apiBlacklistGetRequest($filter = null) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return string + * @return \Yoast\MyYoastApiClient\Model\DeleteResult */ - public function apiBlacklistIdDelete($id) + public function blacklistControllerDeleteOne($id) { - list($response) = $this->apiBlacklistIdDeleteWithHttpInfo($id); + list($response) = $this->blacklistControllerDeleteOneWithHttpInfo($id); return $response; } /** - * Operation apiBlacklistIdDeleteWithHttpInfo + * Operation blacklistControllerDeleteOneWithHttpInfo * * Remove a site from the blacklist * @@ -377,12 +373,12 @@ public function apiBlacklistIdDelete($id) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of string, HTTP status code, HTTP response headers (array of strings) + * @return array of \Yoast\MyYoastApiClient\Model\DeleteResult, HTTP status code, HTTP response headers (array of strings) */ - public function apiBlacklistIdDeleteWithHttpInfo($id) + public function blacklistControllerDeleteOneWithHttpInfo($id) { - $returnType = 'string'; - $request = $this->apiBlacklistIdDeleteRequest($id); + $returnType = '\Yoast\MyYoastApiClient\Model\DeleteResult'; + $request = $this->blacklistControllerDeleteOneRequest($id); try { $options = $this->createHttpClientOption(); @@ -417,7 +413,7 @@ public function apiBlacklistIdDeleteWithHttpInfo($id) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -433,7 +429,7 @@ public function apiBlacklistIdDeleteWithHttpInfo($id) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - 'string', + '\Yoast\MyYoastApiClient\Model\DeleteResult', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -444,7 +440,7 @@ public function apiBlacklistIdDeleteWithHttpInfo($id) } /** - * Operation apiBlacklistIdDeleteAsync + * Operation blacklistControllerDeleteOneAsync * * Remove a site from the blacklist * @@ -453,9 +449,9 @@ public function apiBlacklistIdDeleteWithHttpInfo($id) * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiBlacklistIdDeleteAsync($id) + public function blacklistControllerDeleteOneAsync($id) { - return $this->apiBlacklistIdDeleteAsyncWithHttpInfo($id) + return $this->blacklistControllerDeleteOneAsyncWithHttpInfo($id) ->then( function ($response) { return $response[0]; @@ -464,7 +460,7 @@ function ($response) { } /** - * Operation apiBlacklistIdDeleteAsyncWithHttpInfo + * Operation blacklistControllerDeleteOneAsyncWithHttpInfo * * Remove a site from the blacklist * @@ -473,10 +469,10 @@ function ($response) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiBlacklistIdDeleteAsyncWithHttpInfo($id) + public function blacklistControllerDeleteOneAsyncWithHttpInfo($id) { - $returnType = 'string'; - $request = $this->apiBlacklistIdDeleteRequest($id); + $returnType = '\Yoast\MyYoastApiClient\Model\DeleteResult'; + $request = $this->blacklistControllerDeleteOneRequest($id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -516,19 +512,19 @@ function ($exception) { } /** - * Create request for operation 'apiBlacklistIdDelete' + * Create request for operation 'blacklistControllerDeleteOne' * * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiBlacklistIdDeleteRequest($id) + protected function blacklistControllerDeleteOneRequest($id) { // 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 apiBlacklistIdDelete' + 'Missing the required parameter $id when calling blacklistControllerDeleteOne' ); } @@ -559,7 +555,7 @@ protected function apiBlacklistIdDeleteRequest($id) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -567,16 +563,9 @@ protected function apiBlacklistIdDeleteRequest($id) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -599,11 +588,10 @@ protected function apiBlacklistIdDeleteRequest($id) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -626,37 +614,37 @@ protected function apiBlacklistIdDeleteRequest($id) } /** - * Operation apiBlacklistPost + * Operation blacklistControllerGetMany * - * Creates a blacklisted site + * Gets blacklisted sites * - * @param \Yoast\MyYoastApiClient\Model\CreateBlacklistSiteDto $createBlacklistSiteDto createBlacklistSiteDto (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return string + * @return \Yoast\MyYoastApiClient\Model\Blacklist[] */ - public function apiBlacklistPost($createBlacklistSiteDto) + public function blacklistControllerGetMany($filter = null) { - list($response) = $this->apiBlacklistPostWithHttpInfo($createBlacklistSiteDto); + list($response) = $this->blacklistControllerGetManyWithHttpInfo($filter); return $response; } /** - * Operation apiBlacklistPostWithHttpInfo + * Operation blacklistControllerGetManyWithHttpInfo * - * Creates a blacklisted site + * Gets blacklisted sites * - * @param \Yoast\MyYoastApiClient\Model\CreateBlacklistSiteDto $createBlacklistSiteDto (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of string, HTTP status code, HTTP response headers (array of strings) + * @return array of \Yoast\MyYoastApiClient\Model\Blacklist[], HTTP status code, HTTP response headers (array of strings) */ - public function apiBlacklistPostWithHttpInfo($createBlacklistSiteDto) + public function blacklistControllerGetManyWithHttpInfo($filter = null) { - $returnType = 'string'; - $request = $this->apiBlacklistPostRequest($createBlacklistSiteDto); + $returnType = '\Yoast\MyYoastApiClient\Model\Blacklist[]'; + $request = $this->blacklistControllerGetManyRequest($filter); try { $options = $this->createHttpClientOption(); @@ -691,7 +679,7 @@ public function apiBlacklistPostWithHttpInfo($createBlacklistSiteDto) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -707,7 +695,7 @@ public function apiBlacklistPostWithHttpInfo($createBlacklistSiteDto) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - 'string', + '\Yoast\MyYoastApiClient\Model\Blacklist[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -718,18 +706,18 @@ public function apiBlacklistPostWithHttpInfo($createBlacklistSiteDto) } /** - * Operation apiBlacklistPostAsync + * Operation blacklistControllerGetManyAsync * - * Creates a blacklisted site + * Gets blacklisted sites * - * @param \Yoast\MyYoastApiClient\Model\CreateBlacklistSiteDto $createBlacklistSiteDto (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiBlacklistPostAsync($createBlacklistSiteDto) + public function blacklistControllerGetManyAsync($filter = null) { - return $this->apiBlacklistPostAsyncWithHttpInfo($createBlacklistSiteDto) + return $this->blacklistControllerGetManyAsyncWithHttpInfo($filter) ->then( function ($response) { return $response[0]; @@ -738,19 +726,19 @@ function ($response) { } /** - * Operation apiBlacklistPostAsyncWithHttpInfo + * Operation blacklistControllerGetManyAsyncWithHttpInfo * - * Creates a blacklisted site + * Gets blacklisted sites * - * @param \Yoast\MyYoastApiClient\Model\CreateBlacklistSiteDto $createBlacklistSiteDto (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiBlacklistPostAsyncWithHttpInfo($createBlacklistSiteDto) + public function blacklistControllerGetManyAsyncWithHttpInfo($filter = null) { - $returnType = 'string'; - $request = $this->apiBlacklistPostRequest($createBlacklistSiteDto); + $returnType = '\Yoast\MyYoastApiClient\Model\Blacklist[]'; + $request = $this->blacklistControllerGetManyRequest($filter); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -790,21 +778,15 @@ function ($exception) { } /** - * Create request for operation 'apiBlacklistPost' + * Create request for operation 'blacklistControllerGetMany' * - * @param \Yoast\MyYoastApiClient\Model\CreateBlacklistSiteDto $createBlacklistSiteDto (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiBlacklistPostRequest($createBlacklistSiteDto) + protected function blacklistControllerGetManyRequest($filter = null) { - // verify the required parameter 'createBlacklistSiteDto' is set - if ($createBlacklistSiteDto === null || (is_array($createBlacklistSiteDto) && count($createBlacklistSiteDto) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $createBlacklistSiteDto when calling apiBlacklistPost' - ); - } $resourcePath = '/api/Blacklist'; $formParams = []; @@ -813,13 +795,14 @@ protected function apiBlacklistPostRequest($createBlacklistSiteDto) $httpBody = ''; $multipart = false; + // query params + if ($filter !== null) { + $queryParams['filter'] = ObjectSerializer::toQueryValue($filter, null); + } // body params $_tempBody = null; - if (isset($createBlacklistSiteDto)) { - $_tempBody = $createBlacklistSiteDto; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -828,7 +811,7 @@ protected function apiBlacklistPostRequest($createBlacklistSiteDto) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -836,16 +819,265 @@ protected function apiBlacklistPostRequest($createBlacklistSiteDto) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation blacklistControllerGetManyPaged + * + * Gets blacklisted sites + * + * @param object $filter Used for filtering/joining the results. (optional) + * + * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Yoast\MyYoastApiClient\Model\Blacklist[] + */ + public function blacklistControllerGetManyPaged($filter = null) + { + list($response) = $this->blacklistControllerGetManyPagedWithHttpInfo($filter); + return $response; + } + + /** + * Operation blacklistControllerGetManyPagedWithHttpInfo + * + * Gets blacklisted sites + * + * @param object $filter Used for filtering/joining the results. (optional) + * + * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Yoast\MyYoastApiClient\Model\Blacklist[], HTTP status code, HTTP response headers (array of strings) + */ + public function blacklistControllerGetManyPagedWithHttpInfo($filter = null) + { + $returnType = '\Yoast\MyYoastApiClient\Model\Blacklist[]'; + $request = $this->blacklistControllerGetManyPagedRequest($filter); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if (!in_array($returnType, ['string','integer','bool'])) { + $content = json_decode($content); } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Yoast\MyYoastApiClient\Model\Blacklist[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation blacklistControllerGetManyPagedAsync + * + * Gets blacklisted sites + * + * @param object $filter Used for filtering/joining the results. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function blacklistControllerGetManyPagedAsync($filter = null) + { + return $this->blacklistControllerGetManyPagedAsyncWithHttpInfo($filter) + ->then( + function ($response) { + return $response[0]; } + ); + } + + /** + * Operation blacklistControllerGetManyPagedAsyncWithHttpInfo + * + * Gets blacklisted sites + * + * @param object $filter Used for filtering/joining the results. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function blacklistControllerGetManyPagedAsyncWithHttpInfo($filter = null) + { + $returnType = '\Yoast\MyYoastApiClient\Model\Blacklist[]'; + $request = $this->blacklistControllerGetManyPagedRequest($filter); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + 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(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'blacklistControllerGetManyPaged' + * + * @param object $filter Used for filtering/joining the results. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function blacklistControllerGetManyPagedRequest($filter = null) + { + + $resourcePath = '/api/Blacklist/paged'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($filter !== null) { + $queryParams['filter'] = ObjectSerializer::toQueryValue($filter, null); + } + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -868,11 +1100,10 @@ protected function apiBlacklistPostRequest($createBlacklistSiteDto) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -887,7 +1118,7 @@ protected function apiBlacklistPostRequest($createBlacklistSiteDto) $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody diff --git a/src/Api/CloudflareApi.php b/src/Api/CloudflareApi.php index 64485c5..7676b3e 100644 --- a/src/Api/CloudflareApi.php +++ b/src/Api/CloudflareApi.php @@ -17,9 +17,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -88,37 +87,37 @@ public function getConfig() } /** - * Operation apiCloudflareKvRegisteredDomainsPurgePost + * Operation cloudflareControllerPurgeKVStore * * Purge kv pairs from the registered domains key value store in Cloudflare * - * @param \Yoast\MyYoastApiClient\Model\PurgeKVRequestDto $purgeKVRequestDto purgeKVRequestDto (required) + * @param \Yoast\MyYoastApiClient\Model\PurgeKVRequestDto $body body (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return object[] */ - public function apiCloudflareKvRegisteredDomainsPurgePost($purgeKVRequestDto) + public function cloudflareControllerPurgeKVStore($body) { - list($response) = $this->apiCloudflareKvRegisteredDomainsPurgePostWithHttpInfo($purgeKVRequestDto); + list($response) = $this->cloudflareControllerPurgeKVStoreWithHttpInfo($body); return $response; } /** - * Operation apiCloudflareKvRegisteredDomainsPurgePostWithHttpInfo + * Operation cloudflareControllerPurgeKVStoreWithHttpInfo * * Purge kv pairs from the registered domains key value store in Cloudflare * - * @param \Yoast\MyYoastApiClient\Model\PurgeKVRequestDto $purgeKVRequestDto (required) + * @param \Yoast\MyYoastApiClient\Model\PurgeKVRequestDto $body (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of object[], HTTP status code, HTTP response headers (array of strings) */ - public function apiCloudflareKvRegisteredDomainsPurgePostWithHttpInfo($purgeKVRequestDto) + public function cloudflareControllerPurgeKVStoreWithHttpInfo($body) { $returnType = 'object[]'; - $request = $this->apiCloudflareKvRegisteredDomainsPurgePostRequest($purgeKVRequestDto); + $request = $this->cloudflareControllerPurgeKVStoreRequest($body); try { $options = $this->createHttpClientOption(); @@ -153,7 +152,7 @@ public function apiCloudflareKvRegisteredDomainsPurgePostWithHttpInfo($purgeKVRe $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -180,18 +179,18 @@ public function apiCloudflareKvRegisteredDomainsPurgePostWithHttpInfo($purgeKVRe } /** - * Operation apiCloudflareKvRegisteredDomainsPurgePostAsync + * Operation cloudflareControllerPurgeKVStoreAsync * * Purge kv pairs from the registered domains key value store in Cloudflare * - * @param \Yoast\MyYoastApiClient\Model\PurgeKVRequestDto $purgeKVRequestDto (required) + * @param \Yoast\MyYoastApiClient\Model\PurgeKVRequestDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCloudflareKvRegisteredDomainsPurgePostAsync($purgeKVRequestDto) + public function cloudflareControllerPurgeKVStoreAsync($body) { - return $this->apiCloudflareKvRegisteredDomainsPurgePostAsyncWithHttpInfo($purgeKVRequestDto) + return $this->cloudflareControllerPurgeKVStoreAsyncWithHttpInfo($body) ->then( function ($response) { return $response[0]; @@ -200,19 +199,19 @@ function ($response) { } /** - * Operation apiCloudflareKvRegisteredDomainsPurgePostAsyncWithHttpInfo + * Operation cloudflareControllerPurgeKVStoreAsyncWithHttpInfo * * Purge kv pairs from the registered domains key value store in Cloudflare * - * @param \Yoast\MyYoastApiClient\Model\PurgeKVRequestDto $purgeKVRequestDto (required) + * @param \Yoast\MyYoastApiClient\Model\PurgeKVRequestDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCloudflareKvRegisteredDomainsPurgePostAsyncWithHttpInfo($purgeKVRequestDto) + public function cloudflareControllerPurgeKVStoreAsyncWithHttpInfo($body) { $returnType = 'object[]'; - $request = $this->apiCloudflareKvRegisteredDomainsPurgePostRequest($purgeKVRequestDto); + $request = $this->cloudflareControllerPurgeKVStoreRequest($body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -252,19 +251,19 @@ function ($exception) { } /** - * Create request for operation 'apiCloudflareKvRegisteredDomainsPurgePost' + * Create request for operation 'cloudflareControllerPurgeKVStore' * - * @param \Yoast\MyYoastApiClient\Model\PurgeKVRequestDto $purgeKVRequestDto (required) + * @param \Yoast\MyYoastApiClient\Model\PurgeKVRequestDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCloudflareKvRegisteredDomainsPurgePostRequest($purgeKVRequestDto) + protected function cloudflareControllerPurgeKVStoreRequest($body) { - // verify the required parameter 'purgeKVRequestDto' is set - if ($purgeKVRequestDto === null || (is_array($purgeKVRequestDto) && count($purgeKVRequestDto) === 0)) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $purgeKVRequestDto when calling apiCloudflareKvRegisteredDomainsPurgePost' + 'Missing the required parameter $body when calling cloudflareControllerPurgeKVStore' ); } @@ -279,8 +278,8 @@ protected function apiCloudflareKvRegisteredDomainsPurgePostRequest($purgeKVRequ // body params $_tempBody = null; - if (isset($purgeKVRequestDto)) { - $_tempBody = $purgeKVRequestDto; + if (isset($body)) { + $_tempBody = $body; } if ($multipart) { @@ -298,16 +297,9 @@ protected function apiCloudflareKvRegisteredDomainsPurgePostRequest($purgeKVRequ if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -330,11 +322,10 @@ protected function apiCloudflareKvRegisteredDomainsPurgePostRequest($purgeKVRequ } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -357,37 +348,37 @@ protected function apiCloudflareKvRegisteredDomainsPurgePostRequest($purgeKVRequ } /** - * Operation apiCloudflareKvRegisteredDomainsUpdateAllPost + * Operation cloudflareControllerUpdateAll * * Update sites in the registered domains key value store in Cloudflare * - * @param \Yoast\MyYoastApiClient\Model\UpdateAllKVRequestDto $updateAllKVRequestDto updateAllKVRequestDto (required) + * @param \Yoast\MyYoastApiClient\Model\UpdateAllKVRequestDto $body body (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return object */ - public function apiCloudflareKvRegisteredDomainsUpdateAllPost($updateAllKVRequestDto) + public function cloudflareControllerUpdateAll($body) { - list($response) = $this->apiCloudflareKvRegisteredDomainsUpdateAllPostWithHttpInfo($updateAllKVRequestDto); + list($response) = $this->cloudflareControllerUpdateAllWithHttpInfo($body); return $response; } /** - * Operation apiCloudflareKvRegisteredDomainsUpdateAllPostWithHttpInfo + * Operation cloudflareControllerUpdateAllWithHttpInfo * * Update sites in the registered domains key value store in Cloudflare * - * @param \Yoast\MyYoastApiClient\Model\UpdateAllKVRequestDto $updateAllKVRequestDto (required) + * @param \Yoast\MyYoastApiClient\Model\UpdateAllKVRequestDto $body (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of object, HTTP status code, HTTP response headers (array of strings) */ - public function apiCloudflareKvRegisteredDomainsUpdateAllPostWithHttpInfo($updateAllKVRequestDto) + public function cloudflareControllerUpdateAllWithHttpInfo($body) { $returnType = 'object'; - $request = $this->apiCloudflareKvRegisteredDomainsUpdateAllPostRequest($updateAllKVRequestDto); + $request = $this->cloudflareControllerUpdateAllRequest($body); try { $options = $this->createHttpClientOption(); @@ -422,7 +413,7 @@ public function apiCloudflareKvRegisteredDomainsUpdateAllPostWithHttpInfo($updat $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -449,18 +440,18 @@ public function apiCloudflareKvRegisteredDomainsUpdateAllPostWithHttpInfo($updat } /** - * Operation apiCloudflareKvRegisteredDomainsUpdateAllPostAsync + * Operation cloudflareControllerUpdateAllAsync * * Update sites in the registered domains key value store in Cloudflare * - * @param \Yoast\MyYoastApiClient\Model\UpdateAllKVRequestDto $updateAllKVRequestDto (required) + * @param \Yoast\MyYoastApiClient\Model\UpdateAllKVRequestDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCloudflareKvRegisteredDomainsUpdateAllPostAsync($updateAllKVRequestDto) + public function cloudflareControllerUpdateAllAsync($body) { - return $this->apiCloudflareKvRegisteredDomainsUpdateAllPostAsyncWithHttpInfo($updateAllKVRequestDto) + return $this->cloudflareControllerUpdateAllAsyncWithHttpInfo($body) ->then( function ($response) { return $response[0]; @@ -469,19 +460,19 @@ function ($response) { } /** - * Operation apiCloudflareKvRegisteredDomainsUpdateAllPostAsyncWithHttpInfo + * Operation cloudflareControllerUpdateAllAsyncWithHttpInfo * * Update sites in the registered domains key value store in Cloudflare * - * @param \Yoast\MyYoastApiClient\Model\UpdateAllKVRequestDto $updateAllKVRequestDto (required) + * @param \Yoast\MyYoastApiClient\Model\UpdateAllKVRequestDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCloudflareKvRegisteredDomainsUpdateAllPostAsyncWithHttpInfo($updateAllKVRequestDto) + public function cloudflareControllerUpdateAllAsyncWithHttpInfo($body) { $returnType = 'object'; - $request = $this->apiCloudflareKvRegisteredDomainsUpdateAllPostRequest($updateAllKVRequestDto); + $request = $this->cloudflareControllerUpdateAllRequest($body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -521,19 +512,19 @@ function ($exception) { } /** - * Create request for operation 'apiCloudflareKvRegisteredDomainsUpdateAllPost' + * Create request for operation 'cloudflareControllerUpdateAll' * - * @param \Yoast\MyYoastApiClient\Model\UpdateAllKVRequestDto $updateAllKVRequestDto (required) + * @param \Yoast\MyYoastApiClient\Model\UpdateAllKVRequestDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCloudflareKvRegisteredDomainsUpdateAllPostRequest($updateAllKVRequestDto) + protected function cloudflareControllerUpdateAllRequest($body) { - // verify the required parameter 'updateAllKVRequestDto' is set - if ($updateAllKVRequestDto === null || (is_array($updateAllKVRequestDto) && count($updateAllKVRequestDto) === 0)) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $updateAllKVRequestDto when calling apiCloudflareKvRegisteredDomainsUpdateAllPost' + 'Missing the required parameter $body when calling cloudflareControllerUpdateAll' ); } @@ -548,8 +539,8 @@ protected function apiCloudflareKvRegisteredDomainsUpdateAllPostRequest($updateA // body params $_tempBody = null; - if (isset($updateAllKVRequestDto)) { - $_tempBody = $updateAllKVRequestDto; + if (isset($body)) { + $_tempBody = $body; } if ($multipart) { @@ -567,16 +558,9 @@ protected function apiCloudflareKvRegisteredDomainsUpdateAllPostRequest($updateA if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -599,11 +583,10 @@ protected function apiCloudflareKvRegisteredDomainsUpdateAllPostRequest($updateA } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { diff --git a/src/Api/ComposerTokenApi.php b/src/Api/ComposerTokenApi.php index 12a4f9e..472bd75 100644 --- a/src/Api/ComposerTokenApi.php +++ b/src/Api/ComposerTokenApi.php @@ -17,9 +17,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -88,37 +87,37 @@ public function getConfig() } /** - * Operation apiComposerTokensGeneratePost + * Operation composerTokenControllerDisable * - * Generates a Composer token + * Disable a composer token * - * @param \Yoast\MyYoastApiClient\Model\GenerateDto $generateDto generateDto (required) + * @param string $id id (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Yoast\MyYoastApiClient\Model\ComposerToken */ - public function apiComposerTokensGeneratePost($generateDto) + public function composerTokenControllerDisable($id) { - list($response) = $this->apiComposerTokensGeneratePostWithHttpInfo($generateDto); + list($response) = $this->composerTokenControllerDisableWithHttpInfo($id); return $response; } /** - * Operation apiComposerTokensGeneratePostWithHttpInfo + * Operation composerTokenControllerDisableWithHttpInfo * - * Generates a Composer token + * Disable a composer token * - * @param \Yoast\MyYoastApiClient\Model\GenerateDto $generateDto (required) + * @param string $id (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Yoast\MyYoastApiClient\Model\ComposerToken, HTTP status code, HTTP response headers (array of strings) */ - public function apiComposerTokensGeneratePostWithHttpInfo($generateDto) + public function composerTokenControllerDisableWithHttpInfo($id) { $returnType = '\Yoast\MyYoastApiClient\Model\ComposerToken'; - $request = $this->apiComposerTokensGeneratePostRequest($generateDto); + $request = $this->composerTokenControllerDisableRequest($id); try { $options = $this->createHttpClientOption(); @@ -153,7 +152,7 @@ public function apiComposerTokensGeneratePostWithHttpInfo($generateDto) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -166,7 +165,7 @@ public function apiComposerTokensGeneratePostWithHttpInfo($generateDto) } catch (ApiException $e) { switch ($e->getCode()) { - case 201: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Yoast\MyYoastApiClient\Model\ComposerToken', @@ -180,18 +179,18 @@ public function apiComposerTokensGeneratePostWithHttpInfo($generateDto) } /** - * Operation apiComposerTokensGeneratePostAsync + * Operation composerTokenControllerDisableAsync * - * Generates a Composer token + * Disable a composer token * - * @param \Yoast\MyYoastApiClient\Model\GenerateDto $generateDto (required) + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiComposerTokensGeneratePostAsync($generateDto) + public function composerTokenControllerDisableAsync($id) { - return $this->apiComposerTokensGeneratePostAsyncWithHttpInfo($generateDto) + return $this->composerTokenControllerDisableAsyncWithHttpInfo($id) ->then( function ($response) { return $response[0]; @@ -200,19 +199,19 @@ function ($response) { } /** - * Operation apiComposerTokensGeneratePostAsyncWithHttpInfo + * Operation composerTokenControllerDisableAsyncWithHttpInfo * - * Generates a Composer token + * Disable a composer token * - * @param \Yoast\MyYoastApiClient\Model\GenerateDto $generateDto (required) + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiComposerTokensGeneratePostAsyncWithHttpInfo($generateDto) + public function composerTokenControllerDisableAsyncWithHttpInfo($id) { $returnType = '\Yoast\MyYoastApiClient\Model\ComposerToken'; - $request = $this->apiComposerTokensGeneratePostRequest($generateDto); + $request = $this->composerTokenControllerDisableRequest($id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -252,23 +251,23 @@ function ($exception) { } /** - * Create request for operation 'apiComposerTokensGeneratePost' + * Create request for operation 'composerTokenControllerDisable' * - * @param \Yoast\MyYoastApiClient\Model\GenerateDto $generateDto (required) + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiComposerTokensGeneratePostRequest($generateDto) + protected function composerTokenControllerDisableRequest($id) { - // verify the required parameter 'generateDto' is set - if ($generateDto === null || (is_array($generateDto) && count($generateDto) === 0)) { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $generateDto when calling apiComposerTokensGeneratePost' + 'Missing the required parameter $id when calling composerTokenControllerDisable' ); } - $resourcePath = '/api/ComposerTokens/generate'; + $resourcePath = '/api/ComposerTokens/{id}/delete'; $formParams = []; $queryParams = []; $headerParams = []; @@ -276,12 +275,17 @@ protected function apiComposerTokensGeneratePostRequest($generateDto) $multipart = false; + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } // body params $_tempBody = null; - if (isset($generateDto)) { - $_tempBody = $generateDto; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -290,7 +294,7 @@ protected function apiComposerTokensGeneratePostRequest($generateDto) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -298,16 +302,9 @@ protected function apiComposerTokensGeneratePostRequest($generateDto) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -330,11 +327,10 @@ protected function apiComposerTokensGeneratePostRequest($generateDto) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -357,37 +353,37 @@ protected function apiComposerTokensGeneratePostRequest($generateDto) } /** - * Operation apiComposerTokensIdDeletePost + * Operation composerTokenControllerGenerate * - * Disable a composer token + * Generates a Composer token * - * @param string $id id (required) + * @param \Yoast\MyYoastApiClient\Model\GenerateDto $body body (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Yoast\MyYoastApiClient\Model\ComposerToken */ - public function apiComposerTokensIdDeletePost($id) + public function composerTokenControllerGenerate($body) { - list($response) = $this->apiComposerTokensIdDeletePostWithHttpInfo($id); + list($response) = $this->composerTokenControllerGenerateWithHttpInfo($body); return $response; } /** - * Operation apiComposerTokensIdDeletePostWithHttpInfo + * Operation composerTokenControllerGenerateWithHttpInfo * - * Disable a composer token + * Generates a Composer token * - * @param string $id (required) + * @param \Yoast\MyYoastApiClient\Model\GenerateDto $body (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Yoast\MyYoastApiClient\Model\ComposerToken, HTTP status code, HTTP response headers (array of strings) */ - public function apiComposerTokensIdDeletePostWithHttpInfo($id) + public function composerTokenControllerGenerateWithHttpInfo($body) { $returnType = '\Yoast\MyYoastApiClient\Model\ComposerToken'; - $request = $this->apiComposerTokensIdDeletePostRequest($id); + $request = $this->composerTokenControllerGenerateRequest($body); try { $options = $this->createHttpClientOption(); @@ -422,7 +418,7 @@ public function apiComposerTokensIdDeletePostWithHttpInfo($id) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -435,7 +431,7 @@ public function apiComposerTokensIdDeletePostWithHttpInfo($id) } catch (ApiException $e) { switch ($e->getCode()) { - case 200: + case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Yoast\MyYoastApiClient\Model\ComposerToken', @@ -449,18 +445,18 @@ public function apiComposerTokensIdDeletePostWithHttpInfo($id) } /** - * Operation apiComposerTokensIdDeletePostAsync + * Operation composerTokenControllerGenerateAsync * - * Disable a composer token + * Generates a Composer token * - * @param string $id (required) + * @param \Yoast\MyYoastApiClient\Model\GenerateDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiComposerTokensIdDeletePostAsync($id) + public function composerTokenControllerGenerateAsync($body) { - return $this->apiComposerTokensIdDeletePostAsyncWithHttpInfo($id) + return $this->composerTokenControllerGenerateAsyncWithHttpInfo($body) ->then( function ($response) { return $response[0]; @@ -469,19 +465,19 @@ function ($response) { } /** - * Operation apiComposerTokensIdDeletePostAsyncWithHttpInfo + * Operation composerTokenControllerGenerateAsyncWithHttpInfo * - * Disable a composer token + * Generates a Composer token * - * @param string $id (required) + * @param \Yoast\MyYoastApiClient\Model\GenerateDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiComposerTokensIdDeletePostAsyncWithHttpInfo($id) + public function composerTokenControllerGenerateAsyncWithHttpInfo($body) { $returnType = '\Yoast\MyYoastApiClient\Model\ComposerToken'; - $request = $this->apiComposerTokensIdDeletePostRequest($id); + $request = $this->composerTokenControllerGenerateRequest($body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -521,23 +517,23 @@ function ($exception) { } /** - * Create request for operation 'apiComposerTokensIdDeletePost' + * Create request for operation 'composerTokenControllerGenerate' * - * @param string $id (required) + * @param \Yoast\MyYoastApiClient\Model\GenerateDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiComposerTokensIdDeletePostRequest($id) + protected function composerTokenControllerGenerateRequest($body) { - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling apiComposerTokensIdDeletePost' + 'Missing the required parameter $body when calling composerTokenControllerGenerate' ); } - $resourcePath = '/api/ComposerTokens/{id}/delete'; + $resourcePath = '/api/ComposerTokens/generate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -545,17 +541,12 @@ protected function apiComposerTokensIdDeletePostRequest($id) $multipart = false; - // path params - if ($id !== null) { - $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), - $resourcePath - ); - } // body params $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -572,16 +563,9 @@ protected function apiComposerTokensIdDeletePostRequest($id) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -604,11 +588,10 @@ protected function apiComposerTokensIdDeletePostRequest($id) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -631,39 +614,39 @@ protected function apiComposerTokensIdDeletePostRequest($id) } /** - * Operation apiComposerTokensIdRenamePost + * Operation composerTokenControllerRename * * Renames a Composer token * - * @param \Yoast\MyYoastApiClient\Model\RenameBodyDto $renameBodyDto renameBodyDto (required) + * @param \Yoast\MyYoastApiClient\Model\RenameBodyDto $body body (required) * @param string $id id (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Yoast\MyYoastApiClient\Model\ComposerToken */ - public function apiComposerTokensIdRenamePost($renameBodyDto, $id) + public function composerTokenControllerRename($body, $id) { - list($response) = $this->apiComposerTokensIdRenamePostWithHttpInfo($renameBodyDto, $id); + list($response) = $this->composerTokenControllerRenameWithHttpInfo($body, $id); return $response; } /** - * Operation apiComposerTokensIdRenamePostWithHttpInfo + * Operation composerTokenControllerRenameWithHttpInfo * * Renames a Composer token * - * @param \Yoast\MyYoastApiClient\Model\RenameBodyDto $renameBodyDto (required) + * @param \Yoast\MyYoastApiClient\Model\RenameBodyDto $body (required) * @param string $id (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Yoast\MyYoastApiClient\Model\ComposerToken, HTTP status code, HTTP response headers (array of strings) */ - public function apiComposerTokensIdRenamePostWithHttpInfo($renameBodyDto, $id) + public function composerTokenControllerRenameWithHttpInfo($body, $id) { $returnType = '\Yoast\MyYoastApiClient\Model\ComposerToken'; - $request = $this->apiComposerTokensIdRenamePostRequest($renameBodyDto, $id); + $request = $this->composerTokenControllerRenameRequest($body, $id); try { $options = $this->createHttpClientOption(); @@ -698,7 +681,7 @@ public function apiComposerTokensIdRenamePostWithHttpInfo($renameBodyDto, $id) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -725,19 +708,19 @@ public function apiComposerTokensIdRenamePostWithHttpInfo($renameBodyDto, $id) } /** - * Operation apiComposerTokensIdRenamePostAsync + * Operation composerTokenControllerRenameAsync * * Renames a Composer token * - * @param \Yoast\MyYoastApiClient\Model\RenameBodyDto $renameBodyDto (required) + * @param \Yoast\MyYoastApiClient\Model\RenameBodyDto $body (required) * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiComposerTokensIdRenamePostAsync($renameBodyDto, $id) + public function composerTokenControllerRenameAsync($body, $id) { - return $this->apiComposerTokensIdRenamePostAsyncWithHttpInfo($renameBodyDto, $id) + return $this->composerTokenControllerRenameAsyncWithHttpInfo($body, $id) ->then( function ($response) { return $response[0]; @@ -746,20 +729,20 @@ function ($response) { } /** - * Operation apiComposerTokensIdRenamePostAsyncWithHttpInfo + * Operation composerTokenControllerRenameAsyncWithHttpInfo * * Renames a Composer token * - * @param \Yoast\MyYoastApiClient\Model\RenameBodyDto $renameBodyDto (required) + * @param \Yoast\MyYoastApiClient\Model\RenameBodyDto $body (required) * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiComposerTokensIdRenamePostAsyncWithHttpInfo($renameBodyDto, $id) + public function composerTokenControllerRenameAsyncWithHttpInfo($body, $id) { $returnType = '\Yoast\MyYoastApiClient\Model\ComposerToken'; - $request = $this->apiComposerTokensIdRenamePostRequest($renameBodyDto, $id); + $request = $this->composerTokenControllerRenameRequest($body, $id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -799,26 +782,26 @@ function ($exception) { } /** - * Create request for operation 'apiComposerTokensIdRenamePost' + * Create request for operation 'composerTokenControllerRename' * - * @param \Yoast\MyYoastApiClient\Model\RenameBodyDto $renameBodyDto (required) + * @param \Yoast\MyYoastApiClient\Model\RenameBodyDto $body (required) * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiComposerTokensIdRenamePostRequest($renameBodyDto, $id) + protected function composerTokenControllerRenameRequest($body, $id) { - // verify the required parameter 'renameBodyDto' is set - if ($renameBodyDto === null || (is_array($renameBodyDto) && count($renameBodyDto) === 0)) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $renameBodyDto when calling apiComposerTokensIdRenamePost' + 'Missing the required parameter $body when calling composerTokenControllerRename' ); } // 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 apiComposerTokensIdRenamePost' + 'Missing the required parameter $id when calling composerTokenControllerRename' ); } @@ -841,8 +824,8 @@ protected function apiComposerTokensIdRenamePostRequest($renameBodyDto, $id) // body params $_tempBody = null; - if (isset($renameBodyDto)) { - $_tempBody = $renameBodyDto; + if (isset($body)) { + $_tempBody = $body; } if ($multipart) { @@ -860,16 +843,9 @@ protected function apiComposerTokensIdRenamePostRequest($renameBodyDto, $id) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -892,11 +868,10 @@ protected function apiComposerTokensIdRenamePostRequest($renameBodyDto, $id) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { diff --git a/src/Api/CourseApi.php b/src/Api/CourseApi.php index eb24bd7..965f4fb 100644 --- a/src/Api/CourseApi.php +++ b/src/Api/CourseApi.php @@ -17,9 +17,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -88,37 +87,37 @@ public function getConfig() } /** - * Operation apiCoursesFromAcademyPut + * Operation courseControllerFromAcademy * * Upserts a course * - * @param \Yoast\MyYoastApiClient\Model\FromAcademyDto $fromAcademyDto fromAcademyDto (required) + * @param \Yoast\MyYoastApiClient\Model\FromAcademyDto $body body (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Yoast\MyYoastApiClient\Model\Course */ - public function apiCoursesFromAcademyPut($fromAcademyDto) + public function courseControllerFromAcademy($body) { - list($response) = $this->apiCoursesFromAcademyPutWithHttpInfo($fromAcademyDto); + list($response) = $this->courseControllerFromAcademyWithHttpInfo($body); return $response; } /** - * Operation apiCoursesFromAcademyPutWithHttpInfo + * Operation courseControllerFromAcademyWithHttpInfo * * Upserts a course * - * @param \Yoast\MyYoastApiClient\Model\FromAcademyDto $fromAcademyDto (required) + * @param \Yoast\MyYoastApiClient\Model\FromAcademyDto $body (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Yoast\MyYoastApiClient\Model\Course, HTTP status code, HTTP response headers (array of strings) */ - public function apiCoursesFromAcademyPutWithHttpInfo($fromAcademyDto) + public function courseControllerFromAcademyWithHttpInfo($body) { $returnType = '\Yoast\MyYoastApiClient\Model\Course'; - $request = $this->apiCoursesFromAcademyPutRequest($fromAcademyDto); + $request = $this->courseControllerFromAcademyRequest($body); try { $options = $this->createHttpClientOption(); @@ -153,7 +152,7 @@ public function apiCoursesFromAcademyPutWithHttpInfo($fromAcademyDto) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -180,18 +179,18 @@ public function apiCoursesFromAcademyPutWithHttpInfo($fromAcademyDto) } /** - * Operation apiCoursesFromAcademyPutAsync + * Operation courseControllerFromAcademyAsync * * Upserts a course * - * @param \Yoast\MyYoastApiClient\Model\FromAcademyDto $fromAcademyDto (required) + * @param \Yoast\MyYoastApiClient\Model\FromAcademyDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCoursesFromAcademyPutAsync($fromAcademyDto) + public function courseControllerFromAcademyAsync($body) { - return $this->apiCoursesFromAcademyPutAsyncWithHttpInfo($fromAcademyDto) + return $this->courseControllerFromAcademyAsyncWithHttpInfo($body) ->then( function ($response) { return $response[0]; @@ -200,19 +199,19 @@ function ($response) { } /** - * Operation apiCoursesFromAcademyPutAsyncWithHttpInfo + * Operation courseControllerFromAcademyAsyncWithHttpInfo * * Upserts a course * - * @param \Yoast\MyYoastApiClient\Model\FromAcademyDto $fromAcademyDto (required) + * @param \Yoast\MyYoastApiClient\Model\FromAcademyDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCoursesFromAcademyPutAsyncWithHttpInfo($fromAcademyDto) + public function courseControllerFromAcademyAsyncWithHttpInfo($body) { $returnType = '\Yoast\MyYoastApiClient\Model\Course'; - $request = $this->apiCoursesFromAcademyPutRequest($fromAcademyDto); + $request = $this->courseControllerFromAcademyRequest($body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -252,19 +251,19 @@ function ($exception) { } /** - * Create request for operation 'apiCoursesFromAcademyPut' + * Create request for operation 'courseControllerFromAcademy' * - * @param \Yoast\MyYoastApiClient\Model\FromAcademyDto $fromAcademyDto (required) + * @param \Yoast\MyYoastApiClient\Model\FromAcademyDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCoursesFromAcademyPutRequest($fromAcademyDto) + protected function courseControllerFromAcademyRequest($body) { - // verify the required parameter 'fromAcademyDto' is set - if ($fromAcademyDto === null || (is_array($fromAcademyDto) && count($fromAcademyDto) === 0)) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $fromAcademyDto when calling apiCoursesFromAcademyPut' + 'Missing the required parameter $body when calling courseControllerFromAcademy' ); } @@ -279,8 +278,8 @@ protected function apiCoursesFromAcademyPutRequest($fromAcademyDto) // body params $_tempBody = null; - if (isset($fromAcademyDto)) { - $_tempBody = $fromAcademyDto; + if (isset($body)) { + $_tempBody = $body; } if ($multipart) { @@ -298,16 +297,9 @@ protected function apiCoursesFromAcademyPutRequest($fromAcademyDto) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -330,11 +322,10 @@ protected function apiCoursesFromAcademyPutRequest($fromAcademyDto) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -357,37 +348,37 @@ protected function apiCoursesFromAcademyPutRequest($fromAcademyDto) } /** - * Operation apiCoursesGet + * Operation courseControllerGetMany * * Get courses * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Yoast\MyYoastApiClient\Model\Course[] */ - public function apiCoursesGet($filter = null) + public function courseControllerGetMany($filter = null) { - list($response) = $this->apiCoursesGetWithHttpInfo($filter); + list($response) = $this->courseControllerGetManyWithHttpInfo($filter); return $response; } /** - * Operation apiCoursesGetWithHttpInfo + * Operation courseControllerGetManyWithHttpInfo * * Get courses * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Yoast\MyYoastApiClient\Model\Course[], HTTP status code, HTTP response headers (array of strings) */ - public function apiCoursesGetWithHttpInfo($filter = null) + public function courseControllerGetManyWithHttpInfo($filter = null) { $returnType = '\Yoast\MyYoastApiClient\Model\Course[]'; - $request = $this->apiCoursesGetRequest($filter); + $request = $this->courseControllerGetManyRequest($filter); try { $options = $this->createHttpClientOption(); @@ -422,7 +413,7 @@ public function apiCoursesGetWithHttpInfo($filter = null) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -449,18 +440,18 @@ public function apiCoursesGetWithHttpInfo($filter = null) } /** - * Operation apiCoursesGetAsync + * Operation courseControllerGetManyAsync * * Get courses * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCoursesGetAsync($filter = null) + public function courseControllerGetManyAsync($filter = null) { - return $this->apiCoursesGetAsyncWithHttpInfo($filter) + return $this->courseControllerGetManyAsyncWithHttpInfo($filter) ->then( function ($response) { return $response[0]; @@ -469,19 +460,19 @@ function ($response) { } /** - * Operation apiCoursesGetAsyncWithHttpInfo + * Operation courseControllerGetManyAsyncWithHttpInfo * * Get courses * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCoursesGetAsyncWithHttpInfo($filter = null) + public function courseControllerGetManyAsyncWithHttpInfo($filter = null) { $returnType = '\Yoast\MyYoastApiClient\Model\Course[]'; - $request = $this->apiCoursesGetRequest($filter); + $request = $this->courseControllerGetManyRequest($filter); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -521,14 +512,14 @@ function ($exception) { } /** - * Create request for operation 'apiCoursesGet' + * Create request for operation 'courseControllerGetMany' * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCoursesGetRequest($filter = null) + protected function courseControllerGetManyRequest($filter = null) { $resourcePath = '/api/Courses'; @@ -540,7 +531,7 @@ protected function apiCoursesGetRequest($filter = null) // query params if ($filter !== null) { - $queryParams['filter'] = ObjectSerializer::toQueryValue($filter); + $queryParams['filter'] = ObjectSerializer::toQueryValue($filter, null); } @@ -554,7 +545,7 @@ protected function apiCoursesGetRequest($filter = null) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -562,16 +553,9 @@ protected function apiCoursesGetRequest($filter = null) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -594,11 +578,10 @@ protected function apiCoursesGetRequest($filter = null) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -621,7 +604,7 @@ protected function apiCoursesGetRequest($filter = null) } /** - * Operation apiCoursesIdGet + * Operation courseControllerGetOne * * @param string $id id (required) * @@ -629,13 +612,13 @@ protected function apiCoursesGetRequest($filter = null) * @throws \InvalidArgumentException * @return void */ - public function apiCoursesIdGet($id) + public function courseControllerGetOne($id) { - $this->apiCoursesIdGetWithHttpInfo($id); + $this->courseControllerGetOneWithHttpInfo($id); } /** - * Operation apiCoursesIdGetWithHttpInfo + * Operation courseControllerGetOneWithHttpInfo * * @param string $id (required) * @@ -643,10 +626,10 @@ public function apiCoursesIdGet($id) * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function apiCoursesIdGetWithHttpInfo($id) + public function courseControllerGetOneWithHttpInfo($id) { $returnType = ''; - $request = $this->apiCoursesIdGetRequest($id); + $request = $this->courseControllerGetOneRequest($id); try { $options = $this->createHttpClientOption(); @@ -686,7 +669,7 @@ public function apiCoursesIdGetWithHttpInfo($id) } /** - * Operation apiCoursesIdGetAsync + * Operation courseControllerGetOneAsync * * * @@ -695,9 +678,9 @@ public function apiCoursesIdGetWithHttpInfo($id) * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCoursesIdGetAsync($id) + public function courseControllerGetOneAsync($id) { - return $this->apiCoursesIdGetAsyncWithHttpInfo($id) + return $this->courseControllerGetOneAsyncWithHttpInfo($id) ->then( function ($response) { return $response[0]; @@ -706,7 +689,7 @@ function ($response) { } /** - * Operation apiCoursesIdGetAsyncWithHttpInfo + * Operation courseControllerGetOneAsyncWithHttpInfo * * * @@ -715,10 +698,10 @@ function ($response) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCoursesIdGetAsyncWithHttpInfo($id) + public function courseControllerGetOneAsyncWithHttpInfo($id) { $returnType = ''; - $request = $this->apiCoursesIdGetRequest($id); + $request = $this->courseControllerGetOneRequest($id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -744,19 +727,19 @@ function ($exception) { } /** - * Create request for operation 'apiCoursesIdGet' + * Create request for operation 'courseControllerGetOne' * * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCoursesIdGetRequest($id) + protected function courseControllerGetOneRequest($id) { // 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 apiCoursesIdGet' + 'Missing the required parameter $id when calling courseControllerGetOne' ); } @@ -782,12 +765,12 @@ protected function apiCoursesIdGetRequest($id) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + [] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + [], + [] ); } @@ -795,16 +778,9 @@ protected function apiCoursesIdGetRequest($id) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -827,11 +803,10 @@ protected function apiCoursesIdGetRequest($id) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { diff --git a/src/Api/CourseEnrollmentApi.php b/src/Api/CourseEnrollmentApi.php index 192b171..b435af5 100644 --- a/src/Api/CourseEnrollmentApi.php +++ b/src/Api/CourseEnrollmentApi.php @@ -17,9 +17,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -88,37 +87,37 @@ public function getConfig() } /** - * Operation apiCourseEnrollmentsBulkInvitePost + * Operation courseEnrollmentControllerBulkInvite * * Bulk invite for Course Enrollment. * - * @param \Yoast\MyYoastApiClient\Model\BulkInviteDto $bulkInviteDto bulkInviteDto (required) + * @param \Yoast\MyYoastApiClient\Model\BulkInviteDto $body body (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Yoast\MyYoastApiClient\Model\CourseEnrollment[] */ - public function apiCourseEnrollmentsBulkInvitePost($bulkInviteDto) + public function courseEnrollmentControllerBulkInvite($body) { - list($response) = $this->apiCourseEnrollmentsBulkInvitePostWithHttpInfo($bulkInviteDto); + list($response) = $this->courseEnrollmentControllerBulkInviteWithHttpInfo($body); return $response; } /** - * Operation apiCourseEnrollmentsBulkInvitePostWithHttpInfo + * Operation courseEnrollmentControllerBulkInviteWithHttpInfo * * Bulk invite for Course Enrollment. * - * @param \Yoast\MyYoastApiClient\Model\BulkInviteDto $bulkInviteDto (required) + * @param \Yoast\MyYoastApiClient\Model\BulkInviteDto $body (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Yoast\MyYoastApiClient\Model\CourseEnrollment[], HTTP status code, HTTP response headers (array of strings) */ - public function apiCourseEnrollmentsBulkInvitePostWithHttpInfo($bulkInviteDto) + public function courseEnrollmentControllerBulkInviteWithHttpInfo($body) { $returnType = '\Yoast\MyYoastApiClient\Model\CourseEnrollment[]'; - $request = $this->apiCourseEnrollmentsBulkInvitePostRequest($bulkInviteDto); + $request = $this->courseEnrollmentControllerBulkInviteRequest($body); try { $options = $this->createHttpClientOption(); @@ -153,7 +152,7 @@ public function apiCourseEnrollmentsBulkInvitePostWithHttpInfo($bulkInviteDto) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -180,18 +179,18 @@ public function apiCourseEnrollmentsBulkInvitePostWithHttpInfo($bulkInviteDto) } /** - * Operation apiCourseEnrollmentsBulkInvitePostAsync + * Operation courseEnrollmentControllerBulkInviteAsync * * Bulk invite for Course Enrollment. * - * @param \Yoast\MyYoastApiClient\Model\BulkInviteDto $bulkInviteDto (required) + * @param \Yoast\MyYoastApiClient\Model\BulkInviteDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCourseEnrollmentsBulkInvitePostAsync($bulkInviteDto) + public function courseEnrollmentControllerBulkInviteAsync($body) { - return $this->apiCourseEnrollmentsBulkInvitePostAsyncWithHttpInfo($bulkInviteDto) + return $this->courseEnrollmentControllerBulkInviteAsyncWithHttpInfo($body) ->then( function ($response) { return $response[0]; @@ -200,19 +199,19 @@ function ($response) { } /** - * Operation apiCourseEnrollmentsBulkInvitePostAsyncWithHttpInfo + * Operation courseEnrollmentControllerBulkInviteAsyncWithHttpInfo * * Bulk invite for Course Enrollment. * - * @param \Yoast\MyYoastApiClient\Model\BulkInviteDto $bulkInviteDto (required) + * @param \Yoast\MyYoastApiClient\Model\BulkInviteDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCourseEnrollmentsBulkInvitePostAsyncWithHttpInfo($bulkInviteDto) + public function courseEnrollmentControllerBulkInviteAsyncWithHttpInfo($body) { $returnType = '\Yoast\MyYoastApiClient\Model\CourseEnrollment[]'; - $request = $this->apiCourseEnrollmentsBulkInvitePostRequest($bulkInviteDto); + $request = $this->courseEnrollmentControllerBulkInviteRequest($body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -252,19 +251,19 @@ function ($exception) { } /** - * Create request for operation 'apiCourseEnrollmentsBulkInvitePost' + * Create request for operation 'courseEnrollmentControllerBulkInvite' * - * @param \Yoast\MyYoastApiClient\Model\BulkInviteDto $bulkInviteDto (required) + * @param \Yoast\MyYoastApiClient\Model\BulkInviteDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCourseEnrollmentsBulkInvitePostRequest($bulkInviteDto) + protected function courseEnrollmentControllerBulkInviteRequest($body) { - // verify the required parameter 'bulkInviteDto' is set - if ($bulkInviteDto === null || (is_array($bulkInviteDto) && count($bulkInviteDto) === 0)) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $bulkInviteDto when calling apiCourseEnrollmentsBulkInvitePost' + 'Missing the required parameter $body when calling courseEnrollmentControllerBulkInvite' ); } @@ -279,8 +278,8 @@ protected function apiCourseEnrollmentsBulkInvitePostRequest($bulkInviteDto) // body params $_tempBody = null; - if (isset($bulkInviteDto)) { - $_tempBody = $bulkInviteDto; + if (isset($body)) { + $_tempBody = $body; } if ($multipart) { @@ -298,16 +297,9 @@ protected function apiCourseEnrollmentsBulkInvitePostRequest($bulkInviteDto) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -330,11 +322,10 @@ protected function apiCourseEnrollmentsBulkInvitePostRequest($bulkInviteDto) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -357,36 +348,36 @@ protected function apiCourseEnrollmentsBulkInvitePostRequest($bulkInviteDto) } /** - * Operation apiCourseEnrollmentsFromAcademyPut + * Operation courseEnrollmentControllerFromAcademy * * Update a CourseEnrollment * - * @param \Yoast\MyYoastApiClient\Model\CourseEnrollmentFromAcademyDto $courseEnrollmentFromAcademyDto courseEnrollmentFromAcademyDto (required) + * @param \Yoast\MyYoastApiClient\Model\CourseEnrollmentFromAcademyDto $body body (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function apiCourseEnrollmentsFromAcademyPut($courseEnrollmentFromAcademyDto) + public function courseEnrollmentControllerFromAcademy($body) { - $this->apiCourseEnrollmentsFromAcademyPutWithHttpInfo($courseEnrollmentFromAcademyDto); + $this->courseEnrollmentControllerFromAcademyWithHttpInfo($body); } /** - * Operation apiCourseEnrollmentsFromAcademyPutWithHttpInfo + * Operation courseEnrollmentControllerFromAcademyWithHttpInfo * * Update a CourseEnrollment * - * @param \Yoast\MyYoastApiClient\Model\CourseEnrollmentFromAcademyDto $courseEnrollmentFromAcademyDto (required) + * @param \Yoast\MyYoastApiClient\Model\CourseEnrollmentFromAcademyDto $body (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function apiCourseEnrollmentsFromAcademyPutWithHttpInfo($courseEnrollmentFromAcademyDto) + public function courseEnrollmentControllerFromAcademyWithHttpInfo($body) { $returnType = ''; - $request = $this->apiCourseEnrollmentsFromAcademyPutRequest($courseEnrollmentFromAcademyDto); + $request = $this->courseEnrollmentControllerFromAcademyRequest($body); try { $options = $this->createHttpClientOption(); @@ -426,18 +417,18 @@ public function apiCourseEnrollmentsFromAcademyPutWithHttpInfo($courseEnrollment } /** - * Operation apiCourseEnrollmentsFromAcademyPutAsync + * Operation courseEnrollmentControllerFromAcademyAsync * * Update a CourseEnrollment * - * @param \Yoast\MyYoastApiClient\Model\CourseEnrollmentFromAcademyDto $courseEnrollmentFromAcademyDto (required) + * @param \Yoast\MyYoastApiClient\Model\CourseEnrollmentFromAcademyDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCourseEnrollmentsFromAcademyPutAsync($courseEnrollmentFromAcademyDto) + public function courseEnrollmentControllerFromAcademyAsync($body) { - return $this->apiCourseEnrollmentsFromAcademyPutAsyncWithHttpInfo($courseEnrollmentFromAcademyDto) + return $this->courseEnrollmentControllerFromAcademyAsyncWithHttpInfo($body) ->then( function ($response) { return $response[0]; @@ -446,19 +437,19 @@ function ($response) { } /** - * Operation apiCourseEnrollmentsFromAcademyPutAsyncWithHttpInfo + * Operation courseEnrollmentControllerFromAcademyAsyncWithHttpInfo * * Update a CourseEnrollment * - * @param \Yoast\MyYoastApiClient\Model\CourseEnrollmentFromAcademyDto $courseEnrollmentFromAcademyDto (required) + * @param \Yoast\MyYoastApiClient\Model\CourseEnrollmentFromAcademyDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCourseEnrollmentsFromAcademyPutAsyncWithHttpInfo($courseEnrollmentFromAcademyDto) + public function courseEnrollmentControllerFromAcademyAsyncWithHttpInfo($body) { $returnType = ''; - $request = $this->apiCourseEnrollmentsFromAcademyPutRequest($courseEnrollmentFromAcademyDto); + $request = $this->courseEnrollmentControllerFromAcademyRequest($body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -484,19 +475,19 @@ function ($exception) { } /** - * Create request for operation 'apiCourseEnrollmentsFromAcademyPut' + * Create request for operation 'courseEnrollmentControllerFromAcademy' * - * @param \Yoast\MyYoastApiClient\Model\CourseEnrollmentFromAcademyDto $courseEnrollmentFromAcademyDto (required) + * @param \Yoast\MyYoastApiClient\Model\CourseEnrollmentFromAcademyDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCourseEnrollmentsFromAcademyPutRequest($courseEnrollmentFromAcademyDto) + protected function courseEnrollmentControllerFromAcademyRequest($body) { - // verify the required parameter 'courseEnrollmentFromAcademyDto' is set - if ($courseEnrollmentFromAcademyDto === null || (is_array($courseEnrollmentFromAcademyDto) && count($courseEnrollmentFromAcademyDto) === 0)) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $courseEnrollmentFromAcademyDto when calling apiCourseEnrollmentsFromAcademyPut' + 'Missing the required parameter $body when calling courseEnrollmentControllerFromAcademy' ); } @@ -511,17 +502,17 @@ protected function apiCourseEnrollmentsFromAcademyPutRequest($courseEnrollmentFr // body params $_tempBody = null; - if (isset($courseEnrollmentFromAcademyDto)) { - $_tempBody = $courseEnrollmentFromAcademyDto; + if (isset($body)) { + $_tempBody = $body; } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + [] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + [], ['application/json'] ); } @@ -530,16 +521,9 @@ protected function apiCourseEnrollmentsFromAcademyPutRequest($courseEnrollmentFr if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -562,11 +546,10 @@ protected function apiCourseEnrollmentsFromAcademyPutRequest($courseEnrollmentFr } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -589,37 +572,39 @@ protected function apiCourseEnrollmentsFromAcademyPutRequest($courseEnrollmentFr } /** - * Operation apiCourseEnrollmentsGet + * Operation courseEnrollmentControllerGetLegacyExpiring * - * Get course enrollments + * Get legacy course enrollments that expire between two given dates * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param \DateTime $from from (required) + * @param \DateTime $until until (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Yoast\MyYoastApiClient\Model\CourseEnrollment[] */ - public function apiCourseEnrollmentsGet($filter = null) + public function courseEnrollmentControllerGetLegacyExpiring($from, $until) { - list($response) = $this->apiCourseEnrollmentsGetWithHttpInfo($filter); + list($response) = $this->courseEnrollmentControllerGetLegacyExpiringWithHttpInfo($from, $until); return $response; } /** - * Operation apiCourseEnrollmentsGetWithHttpInfo + * Operation courseEnrollmentControllerGetLegacyExpiringWithHttpInfo * - * Get course enrollments + * Get legacy course enrollments that expire between two given dates * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param \DateTime $from (required) + * @param \DateTime $until (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Yoast\MyYoastApiClient\Model\CourseEnrollment[], HTTP status code, HTTP response headers (array of strings) */ - public function apiCourseEnrollmentsGetWithHttpInfo($filter = null) + public function courseEnrollmentControllerGetLegacyExpiringWithHttpInfo($from, $until) { $returnType = '\Yoast\MyYoastApiClient\Model\CourseEnrollment[]'; - $request = $this->apiCourseEnrollmentsGetRequest($filter); + $request = $this->courseEnrollmentControllerGetLegacyExpiringRequest($from, $until); try { $options = $this->createHttpClientOption(); @@ -654,7 +639,7 @@ public function apiCourseEnrollmentsGetWithHttpInfo($filter = null) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -681,18 +666,19 @@ public function apiCourseEnrollmentsGetWithHttpInfo($filter = null) } /** - * Operation apiCourseEnrollmentsGetAsync + * Operation courseEnrollmentControllerGetLegacyExpiringAsync * - * Get course enrollments + * Get legacy course enrollments that expire between two given dates * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param \DateTime $from (required) + * @param \DateTime $until (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCourseEnrollmentsGetAsync($filter = null) + public function courseEnrollmentControllerGetLegacyExpiringAsync($from, $until) { - return $this->apiCourseEnrollmentsGetAsyncWithHttpInfo($filter) + return $this->courseEnrollmentControllerGetLegacyExpiringAsyncWithHttpInfo($from, $until) ->then( function ($response) { return $response[0]; @@ -701,19 +687,20 @@ function ($response) { } /** - * Operation apiCourseEnrollmentsGetAsyncWithHttpInfo + * Operation courseEnrollmentControllerGetLegacyExpiringAsyncWithHttpInfo * - * Get course enrollments + * Get legacy course enrollments that expire between two given dates * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param \DateTime $from (required) + * @param \DateTime $until (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCourseEnrollmentsGetAsyncWithHttpInfo($filter = null) + public function courseEnrollmentControllerGetLegacyExpiringAsyncWithHttpInfo($from, $until) { $returnType = '\Yoast\MyYoastApiClient\Model\CourseEnrollment[]'; - $request = $this->apiCourseEnrollmentsGetRequest($filter); + $request = $this->courseEnrollmentControllerGetLegacyExpiringRequest($from, $until); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -753,17 +740,30 @@ function ($exception) { } /** - * Create request for operation 'apiCourseEnrollmentsGet' + * Create request for operation 'courseEnrollmentControllerGetLegacyExpiring' * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param \DateTime $from (required) + * @param \DateTime $until (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCourseEnrollmentsGetRequest($filter = null) + protected function courseEnrollmentControllerGetLegacyExpiringRequest($from, $until) { + // verify the required parameter 'from' is set + if ($from === null || (is_array($from) && count($from) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $from when calling courseEnrollmentControllerGetLegacyExpiring' + ); + } + // verify the required parameter 'until' is set + if ($until === null || (is_array($until) && count($until) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $until when calling courseEnrollmentControllerGetLegacyExpiring' + ); + } - $resourcePath = '/api/CourseEnrollments'; + $resourcePath = '/api/CourseEnrollments/getLegacyExpiring'; $formParams = []; $queryParams = []; $headerParams = []; @@ -771,8 +771,12 @@ protected function apiCourseEnrollmentsGetRequest($filter = null) $multipart = false; // query params - if ($filter !== null) { - $queryParams['filter'] = ObjectSerializer::toQueryValue($filter); + if ($from !== null) { + $queryParams['from'] = ObjectSerializer::toQueryValue($from, 'date-time'); + } + // query params + if ($until !== null) { + $queryParams['until'] = ObjectSerializer::toQueryValue($until, 'date-time'); } @@ -786,7 +790,7 @@ protected function apiCourseEnrollmentsGetRequest($filter = null) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -794,16 +798,9 @@ protected function apiCourseEnrollmentsGetRequest($filter = null) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -826,11 +823,10 @@ protected function apiCourseEnrollmentsGetRequest($filter = null) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -853,39 +849,37 @@ protected function apiCourseEnrollmentsGetRequest($filter = null) } /** - * Operation apiCourseEnrollmentsGetLegacyExpiringGet + * Operation courseEnrollmentControllerGetMany * - * Get legacy course enrollments that expire between two given dates + * Get course enrollments * - * @param \DateTime $from from (required) - * @param \DateTime $until until (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Yoast\MyYoastApiClient\Model\CourseEnrollment[] */ - public function apiCourseEnrollmentsGetLegacyExpiringGet($from, $until) + public function courseEnrollmentControllerGetMany($filter = null) { - list($response) = $this->apiCourseEnrollmentsGetLegacyExpiringGetWithHttpInfo($from, $until); + list($response) = $this->courseEnrollmentControllerGetManyWithHttpInfo($filter); return $response; } /** - * Operation apiCourseEnrollmentsGetLegacyExpiringGetWithHttpInfo + * Operation courseEnrollmentControllerGetManyWithHttpInfo * - * Get legacy course enrollments that expire between two given dates + * Get course enrollments * - * @param \DateTime $from (required) - * @param \DateTime $until (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Yoast\MyYoastApiClient\Model\CourseEnrollment[], HTTP status code, HTTP response headers (array of strings) */ - public function apiCourseEnrollmentsGetLegacyExpiringGetWithHttpInfo($from, $until) + public function courseEnrollmentControllerGetManyWithHttpInfo($filter = null) { $returnType = '\Yoast\MyYoastApiClient\Model\CourseEnrollment[]'; - $request = $this->apiCourseEnrollmentsGetLegacyExpiringGetRequest($from, $until); + $request = $this->courseEnrollmentControllerGetManyRequest($filter); try { $options = $this->createHttpClientOption(); @@ -920,7 +914,7 @@ public function apiCourseEnrollmentsGetLegacyExpiringGetWithHttpInfo($from, $unt $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -947,19 +941,18 @@ public function apiCourseEnrollmentsGetLegacyExpiringGetWithHttpInfo($from, $unt } /** - * Operation apiCourseEnrollmentsGetLegacyExpiringGetAsync + * Operation courseEnrollmentControllerGetManyAsync * - * Get legacy course enrollments that expire between two given dates + * Get course enrollments * - * @param \DateTime $from (required) - * @param \DateTime $until (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCourseEnrollmentsGetLegacyExpiringGetAsync($from, $until) + public function courseEnrollmentControllerGetManyAsync($filter = null) { - return $this->apiCourseEnrollmentsGetLegacyExpiringGetAsyncWithHttpInfo($from, $until) + return $this->courseEnrollmentControllerGetManyAsyncWithHttpInfo($filter) ->then( function ($response) { return $response[0]; @@ -968,20 +961,19 @@ function ($response) { } /** - * Operation apiCourseEnrollmentsGetLegacyExpiringGetAsyncWithHttpInfo + * Operation courseEnrollmentControllerGetManyAsyncWithHttpInfo * - * Get legacy course enrollments that expire between two given dates + * Get course enrollments * - * @param \DateTime $from (required) - * @param \DateTime $until (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCourseEnrollmentsGetLegacyExpiringGetAsyncWithHttpInfo($from, $until) + public function courseEnrollmentControllerGetManyAsyncWithHttpInfo($filter = null) { $returnType = '\Yoast\MyYoastApiClient\Model\CourseEnrollment[]'; - $request = $this->apiCourseEnrollmentsGetLegacyExpiringGetRequest($from, $until); + $request = $this->courseEnrollmentControllerGetManyRequest($filter); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1021,30 +1013,17 @@ function ($exception) { } /** - * Create request for operation 'apiCourseEnrollmentsGetLegacyExpiringGet' + * Create request for operation 'courseEnrollmentControllerGetMany' * - * @param \DateTime $from (required) - * @param \DateTime $until (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCourseEnrollmentsGetLegacyExpiringGetRequest($from, $until) + protected function courseEnrollmentControllerGetManyRequest($filter = null) { - // verify the required parameter 'from' is set - if ($from === null || (is_array($from) && count($from) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $from when calling apiCourseEnrollmentsGetLegacyExpiringGet' - ); - } - // verify the required parameter 'until' is set - if ($until === null || (is_array($until) && count($until) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $until when calling apiCourseEnrollmentsGetLegacyExpiringGet' - ); - } - $resourcePath = '/api/CourseEnrollments/getLegacyExpiring'; + $resourcePath = '/api/CourseEnrollments'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1052,12 +1031,8 @@ protected function apiCourseEnrollmentsGetLegacyExpiringGetRequest($from, $until $multipart = false; // query params - if ($from !== null) { - $queryParams['from'] = ObjectSerializer::toQueryValue($from); - } - // query params - if ($until !== null) { - $queryParams['until'] = ObjectSerializer::toQueryValue($until); + if ($filter !== null) { + $queryParams['filter'] = ObjectSerializer::toQueryValue($filter, null); } @@ -1071,7 +1046,7 @@ protected function apiCourseEnrollmentsGetLegacyExpiringGetRequest($from, $until } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -1079,16 +1054,228 @@ protected function apiCourseEnrollmentsGetLegacyExpiringGetRequest($from, $until if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation courseEnrollmentControllerGetManyPaged + * + * Get customers + * + * @param object $filter Used for filtering/joining the results. (optional) + * + * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function courseEnrollmentControllerGetManyPaged($filter = null) + { + $this->courseEnrollmentControllerGetManyPagedWithHttpInfo($filter); + } + + /** + * Operation courseEnrollmentControllerGetManyPagedWithHttpInfo + * + * Get customers + * + * @param object $filter Used for filtering/joining the results. (optional) + * + * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function courseEnrollmentControllerGetManyPagedWithHttpInfo($filter = null) + { + $returnType = ''; + $request = $this->courseEnrollmentControllerGetManyPagedRequest($filter); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation courseEnrollmentControllerGetManyPagedAsync + * + * Get customers + * + * @param object $filter Used for filtering/joining the results. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function courseEnrollmentControllerGetManyPagedAsync($filter = null) + { + return $this->courseEnrollmentControllerGetManyPagedAsyncWithHttpInfo($filter) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation courseEnrollmentControllerGetManyPagedAsyncWithHttpInfo + * + * Get customers + * + * @param object $filter Used for filtering/joining the results. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function courseEnrollmentControllerGetManyPagedAsyncWithHttpInfo($filter = null) + { + $returnType = ''; + $request = $this->courseEnrollmentControllerGetManyPagedRequest($filter); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $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(), + $response->getBody() + ); } + ); + } + + /** + * Create request for operation 'courseEnrollmentControllerGetManyPaged' + * + * @param object $filter Used for filtering/joining the results. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function courseEnrollmentControllerGetManyPagedRequest($filter = null) + { + + $resourcePath = '/api/CourseEnrollments/paged'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($filter !== null) { + $queryParams['filter'] = ObjectSerializer::toQueryValue($filter, null); + } + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + [] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + [], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -1111,11 +1298,10 @@ protected function apiCourseEnrollmentsGetLegacyExpiringGetRequest($from, $until } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1138,39 +1324,39 @@ protected function apiCourseEnrollmentsGetLegacyExpiringGetRequest($from, $until } /** - * Operation apiCourseEnrollmentsIdGet + * Operation courseEnrollmentControllerGetOne * * Get a course enrollment * * @param string $id id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Yoast\MyYoastApiClient\Model\CourseEnrollment */ - public function apiCourseEnrollmentsIdGet($id, $filter = null) + public function courseEnrollmentControllerGetOne($id, $filter = null) { - list($response) = $this->apiCourseEnrollmentsIdGetWithHttpInfo($id, $filter); + list($response) = $this->courseEnrollmentControllerGetOneWithHttpInfo($id, $filter); return $response; } /** - * Operation apiCourseEnrollmentsIdGetWithHttpInfo + * Operation courseEnrollmentControllerGetOneWithHttpInfo * * Get a course enrollment * * @param string $id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Yoast\MyYoastApiClient\Model\CourseEnrollment, HTTP status code, HTTP response headers (array of strings) */ - public function apiCourseEnrollmentsIdGetWithHttpInfo($id, $filter = null) + public function courseEnrollmentControllerGetOneWithHttpInfo($id, $filter = null) { $returnType = '\Yoast\MyYoastApiClient\Model\CourseEnrollment'; - $request = $this->apiCourseEnrollmentsIdGetRequest($id, $filter); + $request = $this->courseEnrollmentControllerGetOneRequest($id, $filter); try { $options = $this->createHttpClientOption(); @@ -1205,7 +1391,7 @@ public function apiCourseEnrollmentsIdGetWithHttpInfo($id, $filter = null) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -1232,19 +1418,19 @@ public function apiCourseEnrollmentsIdGetWithHttpInfo($id, $filter = null) } /** - * Operation apiCourseEnrollmentsIdGetAsync + * Operation courseEnrollmentControllerGetOneAsync * * Get a course enrollment * * @param string $id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCourseEnrollmentsIdGetAsync($id, $filter = null) + public function courseEnrollmentControllerGetOneAsync($id, $filter = null) { - return $this->apiCourseEnrollmentsIdGetAsyncWithHttpInfo($id, $filter) + return $this->courseEnrollmentControllerGetOneAsyncWithHttpInfo($id, $filter) ->then( function ($response) { return $response[0]; @@ -1253,20 +1439,20 @@ function ($response) { } /** - * Operation apiCourseEnrollmentsIdGetAsyncWithHttpInfo + * Operation courseEnrollmentControllerGetOneAsyncWithHttpInfo * * Get a course enrollment * * @param string $id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCourseEnrollmentsIdGetAsyncWithHttpInfo($id, $filter = null) + public function courseEnrollmentControllerGetOneAsyncWithHttpInfo($id, $filter = null) { $returnType = '\Yoast\MyYoastApiClient\Model\CourseEnrollment'; - $request = $this->apiCourseEnrollmentsIdGetRequest($id, $filter); + $request = $this->courseEnrollmentControllerGetOneRequest($id, $filter); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1306,20 +1492,20 @@ function ($exception) { } /** - * Create request for operation 'apiCourseEnrollmentsIdGet' + * Create request for operation 'courseEnrollmentControllerGetOne' * * @param string $id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCourseEnrollmentsIdGetRequest($id, $filter = null) + protected function courseEnrollmentControllerGetOneRequest($id, $filter = null) { // 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 apiCourseEnrollmentsIdGet' + 'Missing the required parameter $id when calling courseEnrollmentControllerGetOne' ); } @@ -1332,7 +1518,7 @@ protected function apiCourseEnrollmentsIdGetRequest($id, $filter = null) // query params if ($filter !== null) { - $queryParams['filter'] = ObjectSerializer::toQueryValue($filter); + $queryParams['filter'] = ObjectSerializer::toQueryValue($filter, null); } // path params @@ -1354,7 +1540,7 @@ protected function apiCourseEnrollmentsIdGetRequest($id, $filter = null) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -1362,16 +1548,9 @@ protected function apiCourseEnrollmentsIdGetRequest($id, $filter = null) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -1394,11 +1573,10 @@ protected function apiCourseEnrollmentsIdGetRequest($id, $filter = null) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1421,39 +1599,39 @@ protected function apiCourseEnrollmentsIdGetRequest($id, $filter = null) } /** - * Operation apiCourseEnrollmentsIdInvitePost + * Operation courseEnrollmentControllerInvite * * Invite a customer * - * @param \Yoast\MyYoastApiClient\Model\InviteDto $inviteDto inviteDto (required) + * @param \Yoast\MyYoastApiClient\Model\InviteDto $body body (required) * @param string $id id (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Yoast\MyYoastApiClient\Model\CourseEnrollment */ - public function apiCourseEnrollmentsIdInvitePost($inviteDto, $id) + public function courseEnrollmentControllerInvite($body, $id) { - list($response) = $this->apiCourseEnrollmentsIdInvitePostWithHttpInfo($inviteDto, $id); + list($response) = $this->courseEnrollmentControllerInviteWithHttpInfo($body, $id); return $response; } /** - * Operation apiCourseEnrollmentsIdInvitePostWithHttpInfo + * Operation courseEnrollmentControllerInviteWithHttpInfo * * Invite a customer * - * @param \Yoast\MyYoastApiClient\Model\InviteDto $inviteDto (required) + * @param \Yoast\MyYoastApiClient\Model\InviteDto $body (required) * @param string $id (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Yoast\MyYoastApiClient\Model\CourseEnrollment, HTTP status code, HTTP response headers (array of strings) */ - public function apiCourseEnrollmentsIdInvitePostWithHttpInfo($inviteDto, $id) + public function courseEnrollmentControllerInviteWithHttpInfo($body, $id) { $returnType = '\Yoast\MyYoastApiClient\Model\CourseEnrollment'; - $request = $this->apiCourseEnrollmentsIdInvitePostRequest($inviteDto, $id); + $request = $this->courseEnrollmentControllerInviteRequest($body, $id); try { $options = $this->createHttpClientOption(); @@ -1488,7 +1666,7 @@ public function apiCourseEnrollmentsIdInvitePostWithHttpInfo($inviteDto, $id) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -1515,19 +1693,19 @@ public function apiCourseEnrollmentsIdInvitePostWithHttpInfo($inviteDto, $id) } /** - * Operation apiCourseEnrollmentsIdInvitePostAsync + * Operation courseEnrollmentControllerInviteAsync * * Invite a customer * - * @param \Yoast\MyYoastApiClient\Model\InviteDto $inviteDto (required) + * @param \Yoast\MyYoastApiClient\Model\InviteDto $body (required) * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCourseEnrollmentsIdInvitePostAsync($inviteDto, $id) + public function courseEnrollmentControllerInviteAsync($body, $id) { - return $this->apiCourseEnrollmentsIdInvitePostAsyncWithHttpInfo($inviteDto, $id) + return $this->courseEnrollmentControllerInviteAsyncWithHttpInfo($body, $id) ->then( function ($response) { return $response[0]; @@ -1536,20 +1714,20 @@ function ($response) { } /** - * Operation apiCourseEnrollmentsIdInvitePostAsyncWithHttpInfo + * Operation courseEnrollmentControllerInviteAsyncWithHttpInfo * * Invite a customer * - * @param \Yoast\MyYoastApiClient\Model\InviteDto $inviteDto (required) + * @param \Yoast\MyYoastApiClient\Model\InviteDto $body (required) * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCourseEnrollmentsIdInvitePostAsyncWithHttpInfo($inviteDto, $id) + public function courseEnrollmentControllerInviteAsyncWithHttpInfo($body, $id) { $returnType = '\Yoast\MyYoastApiClient\Model\CourseEnrollment'; - $request = $this->apiCourseEnrollmentsIdInvitePostRequest($inviteDto, $id); + $request = $this->courseEnrollmentControllerInviteRequest($body, $id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1589,26 +1767,26 @@ function ($exception) { } /** - * Create request for operation 'apiCourseEnrollmentsIdInvitePost' + * Create request for operation 'courseEnrollmentControllerInvite' * - * @param \Yoast\MyYoastApiClient\Model\InviteDto $inviteDto (required) + * @param \Yoast\MyYoastApiClient\Model\InviteDto $body (required) * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCourseEnrollmentsIdInvitePostRequest($inviteDto, $id) + protected function courseEnrollmentControllerInviteRequest($body, $id) { - // verify the required parameter 'inviteDto' is set - if ($inviteDto === null || (is_array($inviteDto) && count($inviteDto) === 0)) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $inviteDto when calling apiCourseEnrollmentsIdInvitePost' + 'Missing the required parameter $body when calling courseEnrollmentControllerInvite' ); } // 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 apiCourseEnrollmentsIdInvitePost' + 'Missing the required parameter $id when calling courseEnrollmentControllerInvite' ); } @@ -1631,8 +1809,8 @@ protected function apiCourseEnrollmentsIdInvitePostRequest($inviteDto, $id) // body params $_tempBody = null; - if (isset($inviteDto)) { - $_tempBody = $inviteDto; + if (isset($body)) { + $_tempBody = $body; } if ($multipart) { @@ -1650,16 +1828,9 @@ protected function apiCourseEnrollmentsIdInvitePostRequest($inviteDto, $id) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -1682,11 +1853,10 @@ protected function apiCourseEnrollmentsIdInvitePostRequest($inviteDto, $id) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1709,37 +1879,37 @@ protected function apiCourseEnrollmentsIdInvitePostRequest($inviteDto, $id) } /** - * Operation apiCourseEnrollmentsTransferPost + * Operation courseEnrollmentControllerTransfer * * Transfer course enrollments * - * @param \Yoast\MyYoastApiClient\Model\TransferDto $transferDto transferDto (required) + * @param \Yoast\MyYoastApiClient\Model\TransferDto $body body (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Yoast\MyYoastApiClient\Model\CourseEnrollment[] */ - public function apiCourseEnrollmentsTransferPost($transferDto) + public function courseEnrollmentControllerTransfer($body) { - list($response) = $this->apiCourseEnrollmentsTransferPostWithHttpInfo($transferDto); + list($response) = $this->courseEnrollmentControllerTransferWithHttpInfo($body); return $response; } /** - * Operation apiCourseEnrollmentsTransferPostWithHttpInfo + * Operation courseEnrollmentControllerTransferWithHttpInfo * * Transfer course enrollments * - * @param \Yoast\MyYoastApiClient\Model\TransferDto $transferDto (required) + * @param \Yoast\MyYoastApiClient\Model\TransferDto $body (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Yoast\MyYoastApiClient\Model\CourseEnrollment[], HTTP status code, HTTP response headers (array of strings) */ - public function apiCourseEnrollmentsTransferPostWithHttpInfo($transferDto) + public function courseEnrollmentControllerTransferWithHttpInfo($body) { $returnType = '\Yoast\MyYoastApiClient\Model\CourseEnrollment[]'; - $request = $this->apiCourseEnrollmentsTransferPostRequest($transferDto); + $request = $this->courseEnrollmentControllerTransferRequest($body); try { $options = $this->createHttpClientOption(); @@ -1774,7 +1944,7 @@ public function apiCourseEnrollmentsTransferPostWithHttpInfo($transferDto) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -1801,18 +1971,18 @@ public function apiCourseEnrollmentsTransferPostWithHttpInfo($transferDto) } /** - * Operation apiCourseEnrollmentsTransferPostAsync + * Operation courseEnrollmentControllerTransferAsync * * Transfer course enrollments * - * @param \Yoast\MyYoastApiClient\Model\TransferDto $transferDto (required) + * @param \Yoast\MyYoastApiClient\Model\TransferDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCourseEnrollmentsTransferPostAsync($transferDto) + public function courseEnrollmentControllerTransferAsync($body) { - return $this->apiCourseEnrollmentsTransferPostAsyncWithHttpInfo($transferDto) + return $this->courseEnrollmentControllerTransferAsyncWithHttpInfo($body) ->then( function ($response) { return $response[0]; @@ -1821,19 +1991,19 @@ function ($response) { } /** - * Operation apiCourseEnrollmentsTransferPostAsyncWithHttpInfo + * Operation courseEnrollmentControllerTransferAsyncWithHttpInfo * * Transfer course enrollments * - * @param \Yoast\MyYoastApiClient\Model\TransferDto $transferDto (required) + * @param \Yoast\MyYoastApiClient\Model\TransferDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCourseEnrollmentsTransferPostAsyncWithHttpInfo($transferDto) + public function courseEnrollmentControllerTransferAsyncWithHttpInfo($body) { $returnType = '\Yoast\MyYoastApiClient\Model\CourseEnrollment[]'; - $request = $this->apiCourseEnrollmentsTransferPostRequest($transferDto); + $request = $this->courseEnrollmentControllerTransferRequest($body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1873,19 +2043,19 @@ function ($exception) { } /** - * Create request for operation 'apiCourseEnrollmentsTransferPost' + * Create request for operation 'courseEnrollmentControllerTransfer' * - * @param \Yoast\MyYoastApiClient\Model\TransferDto $transferDto (required) + * @param \Yoast\MyYoastApiClient\Model\TransferDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCourseEnrollmentsTransferPostRequest($transferDto) + protected function courseEnrollmentControllerTransferRequest($body) { - // verify the required parameter 'transferDto' is set - if ($transferDto === null || (is_array($transferDto) && count($transferDto) === 0)) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $transferDto when calling apiCourseEnrollmentsTransferPost' + 'Missing the required parameter $body when calling courseEnrollmentControllerTransfer' ); } @@ -1900,8 +2070,8 @@ protected function apiCourseEnrollmentsTransferPostRequest($transferDto) // body params $_tempBody = null; - if (isset($transferDto)) { - $_tempBody = $transferDto; + if (isset($body)) { + $_tempBody = $body; } if ($multipart) { @@ -1919,16 +2089,9 @@ protected function apiCourseEnrollmentsTransferPostRequest($transferDto) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -1951,11 +2114,10 @@ protected function apiCourseEnrollmentsTransferPostRequest($transferDto) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { diff --git a/src/Api/CustomerApi.php b/src/Api/CustomerApi.php index 6a3b945..7f25b46 100644 --- a/src/Api/CustomerApi.php +++ b/src/Api/CustomerApi.php @@ -17,9 +17,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -88,37 +87,37 @@ public function getConfig() } /** - * Operation apiCustomersActivatePost + * Operation customerAccessTokenControllerCreateAccessToken * - * Activate the account of a user + * Create an access token for a user * - * @param \Yoast\MyYoastApiClient\Model\ActivateAccountDto $activateAccountDto activateAccountDto (required) + * @param string $id id (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return object + * @return \Yoast\MyYoastApiClient\Model\AccessToken */ - public function apiCustomersActivatePost($activateAccountDto) + public function customerAccessTokenControllerCreateAccessToken($id) { - list($response) = $this->apiCustomersActivatePostWithHttpInfo($activateAccountDto); + list($response) = $this->customerAccessTokenControllerCreateAccessTokenWithHttpInfo($id); return $response; } /** - * Operation apiCustomersActivatePostWithHttpInfo + * Operation customerAccessTokenControllerCreateAccessTokenWithHttpInfo * - * Activate the account of a user + * Create an access token for a user * - * @param \Yoast\MyYoastApiClient\Model\ActivateAccountDto $activateAccountDto (required) + * @param string $id (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of object, HTTP status code, HTTP response headers (array of strings) + * @return array of \Yoast\MyYoastApiClient\Model\AccessToken, HTTP status code, HTTP response headers (array of strings) */ - public function apiCustomersActivatePostWithHttpInfo($activateAccountDto) + public function customerAccessTokenControllerCreateAccessTokenWithHttpInfo($id) { - $returnType = 'object'; - $request = $this->apiCustomersActivatePostRequest($activateAccountDto); + $returnType = '\Yoast\MyYoastApiClient\Model\AccessToken'; + $request = $this->customerAccessTokenControllerCreateAccessTokenRequest($id); try { $options = $this->createHttpClientOption(); @@ -153,7 +152,7 @@ public function apiCustomersActivatePostWithHttpInfo($activateAccountDto) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -169,7 +168,7 @@ public function apiCustomersActivatePostWithHttpInfo($activateAccountDto) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - 'object', + '\Yoast\MyYoastApiClient\Model\AccessToken', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -180,18 +179,18 @@ public function apiCustomersActivatePostWithHttpInfo($activateAccountDto) } /** - * Operation apiCustomersActivatePostAsync + * Operation customerAccessTokenControllerCreateAccessTokenAsync * - * Activate the account of a user + * Create an access token for a user * - * @param \Yoast\MyYoastApiClient\Model\ActivateAccountDto $activateAccountDto (required) + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersActivatePostAsync($activateAccountDto) + public function customerAccessTokenControllerCreateAccessTokenAsync($id) { - return $this->apiCustomersActivatePostAsyncWithHttpInfo($activateAccountDto) + return $this->customerAccessTokenControllerCreateAccessTokenAsyncWithHttpInfo($id) ->then( function ($response) { return $response[0]; @@ -200,19 +199,19 @@ function ($response) { } /** - * Operation apiCustomersActivatePostAsyncWithHttpInfo + * Operation customerAccessTokenControllerCreateAccessTokenAsyncWithHttpInfo * - * Activate the account of a user + * Create an access token for a user * - * @param \Yoast\MyYoastApiClient\Model\ActivateAccountDto $activateAccountDto (required) + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersActivatePostAsyncWithHttpInfo($activateAccountDto) + public function customerAccessTokenControllerCreateAccessTokenAsyncWithHttpInfo($id) { - $returnType = 'object'; - $request = $this->apiCustomersActivatePostRequest($activateAccountDto); + $returnType = '\Yoast\MyYoastApiClient\Model\AccessToken'; + $request = $this->customerAccessTokenControllerCreateAccessTokenRequest($id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -252,23 +251,23 @@ function ($exception) { } /** - * Create request for operation 'apiCustomersActivatePost' + * Create request for operation 'customerAccessTokenControllerCreateAccessToken' * - * @param \Yoast\MyYoastApiClient\Model\ActivateAccountDto $activateAccountDto (required) + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCustomersActivatePostRequest($activateAccountDto) + protected function customerAccessTokenControllerCreateAccessTokenRequest($id) { - // verify the required parameter 'activateAccountDto' is set - if ($activateAccountDto === null || (is_array($activateAccountDto) && count($activateAccountDto) === 0)) { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $activateAccountDto when calling apiCustomersActivatePost' + 'Missing the required parameter $id when calling customerAccessTokenControllerCreateAccessToken' ); } - $resourcePath = '/api/Customers/activate'; + $resourcePath = '/api/Customers/{id}/accessTokens'; $formParams = []; $queryParams = []; $headerParams = []; @@ -276,12 +275,17 @@ protected function apiCustomersActivatePostRequest($activateAccountDto) $multipart = false; + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } // body params $_tempBody = null; - if (isset($activateAccountDto)) { - $_tempBody = $activateAccountDto; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -290,7 +294,7 @@ protected function apiCustomersActivatePostRequest($activateAccountDto) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -298,16 +302,9 @@ protected function apiCustomersActivatePostRequest($activateAccountDto) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -352,35 +349,37 @@ protected function apiCustomersActivatePostRequest($activateAccountDto) } /** - * Operation apiCustomersAllrolesGet + * Operation customerAuthControllerActivate * - * Get all existing roles with their ID. + * Activate the account of a user * + * @param \Yoast\MyYoastApiClient\Model\ActivateAccountDto $body body (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return object */ - public function apiCustomersAllrolesGet() + public function customerAuthControllerActivate($body) { - list($response) = $this->apiCustomersAllrolesGetWithHttpInfo(); + list($response) = $this->customerAuthControllerActivateWithHttpInfo($body); return $response; } /** - * Operation apiCustomersAllrolesGetWithHttpInfo + * Operation customerAuthControllerActivateWithHttpInfo * - * Get all existing roles with their ID. + * Activate the account of a user * + * @param \Yoast\MyYoastApiClient\Model\ActivateAccountDto $body (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of object, HTTP status code, HTTP response headers (array of strings) */ - public function apiCustomersAllrolesGetWithHttpInfo() + public function customerAuthControllerActivateWithHttpInfo($body) { $returnType = 'object'; - $request = $this->apiCustomersAllrolesGetRequest(); + $request = $this->customerAuthControllerActivateRequest($body); try { $options = $this->createHttpClientOption(); @@ -415,7 +414,7 @@ public function apiCustomersAllrolesGetWithHttpInfo() $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -442,17 +441,18 @@ public function apiCustomersAllrolesGetWithHttpInfo() } /** - * Operation apiCustomersAllrolesGetAsync + * Operation customerAuthControllerActivateAsync * - * Get all existing roles with their ID. + * Activate the account of a user * + * @param \Yoast\MyYoastApiClient\Model\ActivateAccountDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersAllrolesGetAsync() + public function customerAuthControllerActivateAsync($body) { - return $this->apiCustomersAllrolesGetAsyncWithHttpInfo() + return $this->customerAuthControllerActivateAsyncWithHttpInfo($body) ->then( function ($response) { return $response[0]; @@ -461,18 +461,19 @@ function ($response) { } /** - * Operation apiCustomersAllrolesGetAsyncWithHttpInfo + * Operation customerAuthControllerActivateAsyncWithHttpInfo * - * Get all existing roles with their ID. + * Activate the account of a user * + * @param \Yoast\MyYoastApiClient\Model\ActivateAccountDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersAllrolesGetAsyncWithHttpInfo() + public function customerAuthControllerActivateAsyncWithHttpInfo($body) { $returnType = 'object'; - $request = $this->apiCustomersAllrolesGetRequest(); + $request = $this->customerAuthControllerActivateRequest($body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -512,16 +513,23 @@ function ($exception) { } /** - * Create request for operation 'apiCustomersAllrolesGet' + * Create request for operation 'customerAuthControllerActivate' * + * @param \Yoast\MyYoastApiClient\Model\ActivateAccountDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCustomersAllrolesGetRequest() + protected function customerAuthControllerActivateRequest($body) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling customerAuthControllerActivate' + ); + } - $resourcePath = '/api/Customers/allroles'; + $resourcePath = '/api/Customers/activate'; $formParams = []; $queryParams = []; $headerParams = []; @@ -532,6 +540,9 @@ protected function apiCustomersAllrolesGetRequest() // body params $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -548,16 +559,9 @@ protected function apiCustomersAllrolesGetRequest() if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -580,11 +584,6 @@ protected function apiCustomersAllrolesGetRequest() } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -599,7 +598,7 @@ protected function apiCustomersAllrolesGetRequest() $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'GET', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -607,35 +606,39 @@ protected function apiCustomersAllrolesGetRequest() } /** - * Operation apiCustomersCurrentGet + * Operation customerAuthControllerChangePassword * - * Get the current customer + * Update a customer's password in WordPress * + * @param \Yoast\MyYoastApiClient\Model\ChangePasswordDto $body body (required) + * @param string $id id (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Yoast\MyYoastApiClient\Model\Customer */ - public function apiCustomersCurrentGet() + public function customerAuthControllerChangePassword($body, $id) { - list($response) = $this->apiCustomersCurrentGetWithHttpInfo(); + list($response) = $this->customerAuthControllerChangePasswordWithHttpInfo($body, $id); return $response; } /** - * Operation apiCustomersCurrentGetWithHttpInfo + * Operation customerAuthControllerChangePasswordWithHttpInfo * - * Get the current customer + * Update a customer's password in WordPress * + * @param \Yoast\MyYoastApiClient\Model\ChangePasswordDto $body (required) + * @param string $id (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Yoast\MyYoastApiClient\Model\Customer, HTTP status code, HTTP response headers (array of strings) */ - public function apiCustomersCurrentGetWithHttpInfo() + public function customerAuthControllerChangePasswordWithHttpInfo($body, $id) { $returnType = '\Yoast\MyYoastApiClient\Model\Customer'; - $request = $this->apiCustomersCurrentGetRequest(); + $request = $this->customerAuthControllerChangePasswordRequest($body, $id); try { $options = $this->createHttpClientOption(); @@ -670,7 +673,7 @@ public function apiCustomersCurrentGetWithHttpInfo() $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -697,17 +700,19 @@ public function apiCustomersCurrentGetWithHttpInfo() } /** - * Operation apiCustomersCurrentGetAsync + * Operation customerAuthControllerChangePasswordAsync * - * Get the current customer + * Update a customer's password in WordPress * + * @param \Yoast\MyYoastApiClient\Model\ChangePasswordDto $body (required) + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersCurrentGetAsync() + public function customerAuthControllerChangePasswordAsync($body, $id) { - return $this->apiCustomersCurrentGetAsyncWithHttpInfo() + return $this->customerAuthControllerChangePasswordAsyncWithHttpInfo($body, $id) ->then( function ($response) { return $response[0]; @@ -716,18 +721,20 @@ function ($response) { } /** - * Operation apiCustomersCurrentGetAsyncWithHttpInfo + * Operation customerAuthControllerChangePasswordAsyncWithHttpInfo * - * Get the current customer + * Update a customer's password in WordPress * + * @param \Yoast\MyYoastApiClient\Model\ChangePasswordDto $body (required) + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersCurrentGetAsyncWithHttpInfo() + public function customerAuthControllerChangePasswordAsyncWithHttpInfo($body, $id) { $returnType = '\Yoast\MyYoastApiClient\Model\Customer'; - $request = $this->apiCustomersCurrentGetRequest(); + $request = $this->customerAuthControllerChangePasswordRequest($body, $id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -767,16 +774,30 @@ function ($exception) { } /** - * Create request for operation 'apiCustomersCurrentGet' + * Create request for operation 'customerAuthControllerChangePassword' * + * @param \Yoast\MyYoastApiClient\Model\ChangePasswordDto $body (required) + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCustomersCurrentGetRequest() + protected function customerAuthControllerChangePasswordRequest($body, $id) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling customerAuthControllerChangePassword' + ); + } + // 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 customerAuthControllerChangePassword' + ); + } - $resourcePath = '/api/Customers/current'; + $resourcePath = '/api/Customers/{id}/password'; $formParams = []; $queryParams = []; $headerParams = []; @@ -784,9 +805,20 @@ protected function apiCustomersCurrentGetRequest() $multipart = false; + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } // body params $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -803,16 +835,9 @@ protected function apiCustomersCurrentGetRequest() if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -835,11 +860,10 @@ protected function apiCustomersCurrentGetRequest() } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -854,7 +878,7 @@ protected function apiCustomersCurrentGetRequest() $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'GET', + 'PATCH', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -862,37 +886,35 @@ protected function apiCustomersCurrentGetRequest() } /** - * Operation apiCustomersCustomerIdBuyerCourseEnrollmentsGet + * Operation customerAuthControllerGetNonce * - * Find Course Enrollments that a customer is buyer of + * Get a nonce from Yoast.com * - * @param string $customerId customerId (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\CourseEnrollment[] + * @return object */ - public function apiCustomersCustomerIdBuyerCourseEnrollmentsGet($customerId) + public function customerAuthControllerGetNonce() { - list($response) = $this->apiCustomersCustomerIdBuyerCourseEnrollmentsGetWithHttpInfo($customerId); + list($response) = $this->customerAuthControllerGetNonceWithHttpInfo(); return $response; } /** - * Operation apiCustomersCustomerIdBuyerCourseEnrollmentsGetWithHttpInfo + * Operation customerAuthControllerGetNonceWithHttpInfo * - * Find Course Enrollments that a customer is buyer of + * Get a nonce from Yoast.com * - * @param string $customerId (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Yoast\MyYoastApiClient\Model\CourseEnrollment[], HTTP status code, HTTP response headers (array of strings) + * @return array of object, HTTP status code, HTTP response headers (array of strings) */ - public function apiCustomersCustomerIdBuyerCourseEnrollmentsGetWithHttpInfo($customerId) + public function customerAuthControllerGetNonceWithHttpInfo() { - $returnType = '\Yoast\MyYoastApiClient\Model\CourseEnrollment[]'; - $request = $this->apiCustomersCustomerIdBuyerCourseEnrollmentsGetRequest($customerId); + $returnType = 'object'; + $request = $this->customerAuthControllerGetNonceRequest(); try { $options = $this->createHttpClientOption(); @@ -927,7 +949,7 @@ public function apiCustomersCustomerIdBuyerCourseEnrollmentsGetWithHttpInfo($cus $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -943,7 +965,7 @@ public function apiCustomersCustomerIdBuyerCourseEnrollmentsGetWithHttpInfo($cus case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Yoast\MyYoastApiClient\Model\CourseEnrollment[]', + 'object', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -954,18 +976,17 @@ public function apiCustomersCustomerIdBuyerCourseEnrollmentsGetWithHttpInfo($cus } /** - * Operation apiCustomersCustomerIdBuyerCourseEnrollmentsGetAsync + * Operation customerAuthControllerGetNonceAsync * - * Find Course Enrollments that a customer is buyer of + * Get a nonce from Yoast.com * - * @param string $customerId (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersCustomerIdBuyerCourseEnrollmentsGetAsync($customerId) + public function customerAuthControllerGetNonceAsync() { - return $this->apiCustomersCustomerIdBuyerCourseEnrollmentsGetAsyncWithHttpInfo($customerId) + return $this->customerAuthControllerGetNonceAsyncWithHttpInfo() ->then( function ($response) { return $response[0]; @@ -974,19 +995,18 @@ function ($response) { } /** - * Operation apiCustomersCustomerIdBuyerCourseEnrollmentsGetAsyncWithHttpInfo + * Operation customerAuthControllerGetNonceAsyncWithHttpInfo * - * Find Course Enrollments that a customer is buyer of + * Get a nonce from Yoast.com * - * @param string $customerId (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersCustomerIdBuyerCourseEnrollmentsGetAsyncWithHttpInfo($customerId) + public function customerAuthControllerGetNonceAsyncWithHttpInfo() { - $returnType = '\Yoast\MyYoastApiClient\Model\CourseEnrollment[]'; - $request = $this->apiCustomersCustomerIdBuyerCourseEnrollmentsGetRequest($customerId); + $returnType = 'object'; + $request = $this->customerAuthControllerGetNonceRequest(); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1026,23 +1046,16 @@ function ($exception) { } /** - * Create request for operation 'apiCustomersCustomerIdBuyerCourseEnrollmentsGet' + * Create request for operation 'customerAuthControllerGetNonce' * - * @param string $customerId (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCustomersCustomerIdBuyerCourseEnrollmentsGetRequest($customerId) + protected function customerAuthControllerGetNonceRequest() { - // verify the required parameter 'customerId' is set - if ($customerId === null || (is_array($customerId) && count($customerId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $customerId when calling apiCustomersCustomerIdBuyerCourseEnrollmentsGet' - ); - } - $resourcePath = '/api/Customers/{customerId}/buyerCourseEnrollments'; + $resourcePath = '/api/Customers/nonce'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1050,14 +1063,6 @@ protected function apiCustomersCustomerIdBuyerCourseEnrollmentsGetRequest($custo $multipart = false; - // path params - if ($customerId !== null) { - $resourcePath = str_replace( - '{' . 'customerId' . '}', - ObjectSerializer::toPathValue($customerId), - $resourcePath - ); - } // body params $_tempBody = null; @@ -1069,7 +1074,7 @@ protected function apiCustomersCustomerIdBuyerCourseEnrollmentsGetRequest($custo } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -1077,16 +1082,9 @@ protected function apiCustomersCustomerIdBuyerCourseEnrollmentsGetRequest($custo if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -1109,11 +1107,6 @@ protected function apiCustomersCustomerIdBuyerCourseEnrollmentsGetRequest($custo } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1136,39 +1129,37 @@ protected function apiCustomersCustomerIdBuyerCourseEnrollmentsGetRequest($custo } /** - * Operation apiCustomersCustomerIdComposerTokensGet + * Operation customerAuthControllerResetPassword * - * Get composer tokens + * Reset the user's password. * - * @param string $customerId customerId (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param \Yoast\MyYoastApiClient\Model\ResetPasswordDto $body body (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\ComposerToken[] + * @return \Yoast\MyYoastApiClient\Model\Customer */ - public function apiCustomersCustomerIdComposerTokensGet($customerId, $filter = null) + public function customerAuthControllerResetPassword($body) { - list($response) = $this->apiCustomersCustomerIdComposerTokensGetWithHttpInfo($customerId, $filter); + list($response) = $this->customerAuthControllerResetPasswordWithHttpInfo($body); return $response; } /** - * Operation apiCustomersCustomerIdComposerTokensGetWithHttpInfo + * Operation customerAuthControllerResetPasswordWithHttpInfo * - * Get composer tokens + * Reset the user's password. * - * @param string $customerId (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param \Yoast\MyYoastApiClient\Model\ResetPasswordDto $body (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Yoast\MyYoastApiClient\Model\ComposerToken[], HTTP status code, HTTP response headers (array of strings) + * @return array of \Yoast\MyYoastApiClient\Model\Customer, HTTP status code, HTTP response headers (array of strings) */ - public function apiCustomersCustomerIdComposerTokensGetWithHttpInfo($customerId, $filter = null) + public function customerAuthControllerResetPasswordWithHttpInfo($body) { - $returnType = '\Yoast\MyYoastApiClient\Model\ComposerToken[]'; - $request = $this->apiCustomersCustomerIdComposerTokensGetRequest($customerId, $filter); + $returnType = '\Yoast\MyYoastApiClient\Model\Customer'; + $request = $this->customerAuthControllerResetPasswordRequest($body); try { $options = $this->createHttpClientOption(); @@ -1203,7 +1194,7 @@ public function apiCustomersCustomerIdComposerTokensGetWithHttpInfo($customerId, $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -1219,7 +1210,7 @@ public function apiCustomersCustomerIdComposerTokensGetWithHttpInfo($customerId, case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Yoast\MyYoastApiClient\Model\ComposerToken[]', + '\Yoast\MyYoastApiClient\Model\Customer', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1230,19 +1221,18 @@ public function apiCustomersCustomerIdComposerTokensGetWithHttpInfo($customerId, } /** - * Operation apiCustomersCustomerIdComposerTokensGetAsync + * Operation customerAuthControllerResetPasswordAsync * - * Get composer tokens + * Reset the user's password. * - * @param string $customerId (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param \Yoast\MyYoastApiClient\Model\ResetPasswordDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersCustomerIdComposerTokensGetAsync($customerId, $filter = null) + public function customerAuthControllerResetPasswordAsync($body) { - return $this->apiCustomersCustomerIdComposerTokensGetAsyncWithHttpInfo($customerId, $filter) + return $this->customerAuthControllerResetPasswordAsyncWithHttpInfo($body) ->then( function ($response) { return $response[0]; @@ -1251,20 +1241,19 @@ function ($response) { } /** - * Operation apiCustomersCustomerIdComposerTokensGetAsyncWithHttpInfo + * Operation customerAuthControllerResetPasswordAsyncWithHttpInfo * - * Get composer tokens + * Reset the user's password. * - * @param string $customerId (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param \Yoast\MyYoastApiClient\Model\ResetPasswordDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersCustomerIdComposerTokensGetAsyncWithHttpInfo($customerId, $filter = null) + public function customerAuthControllerResetPasswordAsyncWithHttpInfo($body) { - $returnType = '\Yoast\MyYoastApiClient\Model\ComposerToken[]'; - $request = $this->apiCustomersCustomerIdComposerTokensGetRequest($customerId, $filter); + $returnType = '\Yoast\MyYoastApiClient\Model\Customer'; + $request = $this->customerAuthControllerResetPasswordRequest($body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1304,46 +1293,36 @@ function ($exception) { } /** - * Create request for operation 'apiCustomersCustomerIdComposerTokensGet' + * Create request for operation 'customerAuthControllerResetPassword' * - * @param string $customerId (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param \Yoast\MyYoastApiClient\Model\ResetPasswordDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCustomersCustomerIdComposerTokensGetRequest($customerId, $filter = null) + protected function customerAuthControllerResetPasswordRequest($body) { - // verify the required parameter 'customerId' is set - if ($customerId === null || (is_array($customerId) && count($customerId) === 0)) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $customerId when calling apiCustomersCustomerIdComposerTokensGet' + 'Missing the required parameter $body when calling customerAuthControllerResetPassword' ); } - $resourcePath = '/api/Customers/{customerId}/composerTokens'; + $resourcePath = '/api/Customers/resetPassword'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if ($filter !== null) { - $queryParams['filter'] = ObjectSerializer::toQueryValue($filter); - } - // path params - if ($customerId !== null) { - $resourcePath = str_replace( - '{' . 'customerId' . '}', - ObjectSerializer::toPathValue($customerId), - $resourcePath - ); - } // body params $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -1360,16 +1339,9 @@ protected function apiCustomersCustomerIdComposerTokensGetRequest($customerId, $ if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -1392,11 +1364,6 @@ protected function apiCustomersCustomerIdComposerTokensGetRequest($customerId, $ } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1411,7 +1378,7 @@ protected function apiCustomersCustomerIdComposerTokensGetRequest($customerId, $ $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'GET', + 'PATCH', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -1419,41 +1386,37 @@ protected function apiCustomersCustomerIdComposerTokensGetRequest($customerId, $ } /** - * Operation apiCustomersCustomerIdComposerTokensIdGet + * Operation customerAuthControllerSendResetPasswordEmail * - * Get a composer token + * Send a reset password email to the user. * - * @param string $customerId customerId (required) - * @param string $id id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param \Yoast\MyYoastApiClient\Model\SendResetPasswordEmailDto $body body (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\ComposerToken + * @return object */ - public function apiCustomersCustomerIdComposerTokensIdGet($customerId, $id, $filter = null) + public function customerAuthControllerSendResetPasswordEmail($body) { - list($response) = $this->apiCustomersCustomerIdComposerTokensIdGetWithHttpInfo($customerId, $id, $filter); + list($response) = $this->customerAuthControllerSendResetPasswordEmailWithHttpInfo($body); return $response; } /** - * Operation apiCustomersCustomerIdComposerTokensIdGetWithHttpInfo + * Operation customerAuthControllerSendResetPasswordEmailWithHttpInfo * - * Get a composer token + * Send a reset password email to the user. * - * @param string $customerId (required) - * @param string $id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param \Yoast\MyYoastApiClient\Model\SendResetPasswordEmailDto $body (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Yoast\MyYoastApiClient\Model\ComposerToken, HTTP status code, HTTP response headers (array of strings) + * @return array of object, HTTP status code, HTTP response headers (array of strings) */ - public function apiCustomersCustomerIdComposerTokensIdGetWithHttpInfo($customerId, $id, $filter = null) + public function customerAuthControllerSendResetPasswordEmailWithHttpInfo($body) { - $returnType = '\Yoast\MyYoastApiClient\Model\ComposerToken'; - $request = $this->apiCustomersCustomerIdComposerTokensIdGetRequest($customerId, $id, $filter); + $returnType = 'object'; + $request = $this->customerAuthControllerSendResetPasswordEmailRequest($body); try { $options = $this->createHttpClientOption(); @@ -1488,7 +1451,7 @@ public function apiCustomersCustomerIdComposerTokensIdGetWithHttpInfo($customerI $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -1504,7 +1467,7 @@ public function apiCustomersCustomerIdComposerTokensIdGetWithHttpInfo($customerI case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Yoast\MyYoastApiClient\Model\ComposerToken', + 'object', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1515,20 +1478,18 @@ public function apiCustomersCustomerIdComposerTokensIdGetWithHttpInfo($customerI } /** - * Operation apiCustomersCustomerIdComposerTokensIdGetAsync + * Operation customerAuthControllerSendResetPasswordEmailAsync * - * Get a composer token + * Send a reset password email to the user. * - * @param string $customerId (required) - * @param string $id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param \Yoast\MyYoastApiClient\Model\SendResetPasswordEmailDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersCustomerIdComposerTokensIdGetAsync($customerId, $id, $filter = null) + public function customerAuthControllerSendResetPasswordEmailAsync($body) { - return $this->apiCustomersCustomerIdComposerTokensIdGetAsyncWithHttpInfo($customerId, $id, $filter) + return $this->customerAuthControllerSendResetPasswordEmailAsyncWithHttpInfo($body) ->then( function ($response) { return $response[0]; @@ -1537,21 +1498,19 @@ function ($response) { } /** - * Operation apiCustomersCustomerIdComposerTokensIdGetAsyncWithHttpInfo + * Operation customerAuthControllerSendResetPasswordEmailAsyncWithHttpInfo * - * Get a composer token + * Send a reset password email to the user. * - * @param string $customerId (required) - * @param string $id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param \Yoast\MyYoastApiClient\Model\SendResetPasswordEmailDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersCustomerIdComposerTokensIdGetAsyncWithHttpInfo($customerId, $id, $filter = null) + public function customerAuthControllerSendResetPasswordEmailAsyncWithHttpInfo($body) { - $returnType = '\Yoast\MyYoastApiClient\Model\ComposerToken'; - $request = $this->apiCustomersCustomerIdComposerTokensIdGetRequest($customerId, $id, $filter); + $returnType = 'object'; + $request = $this->customerAuthControllerSendResetPasswordEmailRequest($body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1591,61 +1550,36 @@ function ($exception) { } /** - * Create request for operation 'apiCustomersCustomerIdComposerTokensIdGet' + * Create request for operation 'customerAuthControllerSendResetPasswordEmail' * - * @param string $customerId (required) - * @param string $id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param \Yoast\MyYoastApiClient\Model\SendResetPasswordEmailDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCustomersCustomerIdComposerTokensIdGetRequest($customerId, $id, $filter = null) + protected function customerAuthControllerSendResetPasswordEmailRequest($body) { - // verify the required parameter 'customerId' is set - if ($customerId === null || (is_array($customerId) && count($customerId) === 0)) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $customerId when calling apiCustomersCustomerIdComposerTokensIdGet' - ); - } - // 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 apiCustomersCustomerIdComposerTokensIdGet' + 'Missing the required parameter $body when calling customerAuthControllerSendResetPasswordEmail' ); } - $resourcePath = '/api/Customers/{customerId}/composerTokens/{id}'; + $resourcePath = '/api/Customers/sendResetPasswordEmail'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if ($filter !== null) { - $queryParams['filter'] = ObjectSerializer::toQueryValue($filter); - } - // path params - if ($customerId !== null) { - $resourcePath = str_replace( - '{' . 'customerId' . '}', - ObjectSerializer::toPathValue($customerId), - $resourcePath - ); - } - // path params - if ($id !== null) { - $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), - $resourcePath - ); - } // body params $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -1662,16 +1596,9 @@ protected function apiCustomersCustomerIdComposerTokensIdGetRequest($customerId, if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -1694,11 +1621,6 @@ protected function apiCustomersCustomerIdComposerTokensIdGetRequest($customerId, } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1713,7 +1635,7 @@ protected function apiCustomersCustomerIdComposerTokensIdGetRequest($customerId, $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'GET', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -1721,41 +1643,37 @@ protected function apiCustomersCustomerIdComposerTokensIdGetRequest($customerId, } /** - * Operation apiCustomersCustomerIdCourseEnrollmentsGet + * Operation customerAuthControllerSignup * - * Find Course Enrollments + * Signup a customer on yoast.com. * - * @param string $ownershipRelation ownershipRelation (required) - * @param string $customerId customerId (required) - * @param string $courseId courseId (optional) + * @param \Yoast\MyYoastApiClient\Model\SignupAccountDto $body body (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\CourseEnrollment[] + * @return object */ - public function apiCustomersCustomerIdCourseEnrollmentsGet($ownershipRelation, $customerId, $courseId = null) + public function customerAuthControllerSignup($body) { - list($response) = $this->apiCustomersCustomerIdCourseEnrollmentsGetWithHttpInfo($ownershipRelation, $customerId, $courseId); + list($response) = $this->customerAuthControllerSignupWithHttpInfo($body); return $response; } /** - * Operation apiCustomersCustomerIdCourseEnrollmentsGetWithHttpInfo + * Operation customerAuthControllerSignupWithHttpInfo * - * Find Course Enrollments + * Signup a customer on yoast.com. * - * @param string $ownershipRelation (required) - * @param string $customerId (required) - * @param string $courseId (optional) + * @param \Yoast\MyYoastApiClient\Model\SignupAccountDto $body (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Yoast\MyYoastApiClient\Model\CourseEnrollment[], HTTP status code, HTTP response headers (array of strings) + * @return array of object, HTTP status code, HTTP response headers (array of strings) */ - public function apiCustomersCustomerIdCourseEnrollmentsGetWithHttpInfo($ownershipRelation, $customerId, $courseId = null) + public function customerAuthControllerSignupWithHttpInfo($body) { - $returnType = '\Yoast\MyYoastApiClient\Model\CourseEnrollment[]'; - $request = $this->apiCustomersCustomerIdCourseEnrollmentsGetRequest($ownershipRelation, $customerId, $courseId); + $returnType = 'object'; + $request = $this->customerAuthControllerSignupRequest($body); try { $options = $this->createHttpClientOption(); @@ -1790,7 +1708,7 @@ public function apiCustomersCustomerIdCourseEnrollmentsGetWithHttpInfo($ownershi $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -1806,7 +1724,7 @@ public function apiCustomersCustomerIdCourseEnrollmentsGetWithHttpInfo($ownershi case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Yoast\MyYoastApiClient\Model\CourseEnrollment[]', + 'object', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1817,20 +1735,18 @@ public function apiCustomersCustomerIdCourseEnrollmentsGetWithHttpInfo($ownershi } /** - * Operation apiCustomersCustomerIdCourseEnrollmentsGetAsync + * Operation customerAuthControllerSignupAsync * - * Find Course Enrollments + * Signup a customer on yoast.com. * - * @param string $ownershipRelation (required) - * @param string $customerId (required) - * @param string $courseId (optional) + * @param \Yoast\MyYoastApiClient\Model\SignupAccountDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersCustomerIdCourseEnrollmentsGetAsync($ownershipRelation, $customerId, $courseId = null) + public function customerAuthControllerSignupAsync($body) { - return $this->apiCustomersCustomerIdCourseEnrollmentsGetAsyncWithHttpInfo($ownershipRelation, $customerId, $courseId) + return $this->customerAuthControllerSignupAsyncWithHttpInfo($body) ->then( function ($response) { return $response[0]; @@ -1839,21 +1755,19 @@ function ($response) { } /** - * Operation apiCustomersCustomerIdCourseEnrollmentsGetAsyncWithHttpInfo + * Operation customerAuthControllerSignupAsyncWithHttpInfo * - * Find Course Enrollments + * Signup a customer on yoast.com. * - * @param string $ownershipRelation (required) - * @param string $customerId (required) - * @param string $courseId (optional) + * @param \Yoast\MyYoastApiClient\Model\SignupAccountDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersCustomerIdCourseEnrollmentsGetAsyncWithHttpInfo($ownershipRelation, $customerId, $courseId = null) + public function customerAuthControllerSignupAsyncWithHttpInfo($body) { - $returnType = '\Yoast\MyYoastApiClient\Model\CourseEnrollment[]'; - $request = $this->apiCustomersCustomerIdCourseEnrollmentsGetRequest($ownershipRelation, $customerId, $courseId); + $returnType = 'object'; + $request = $this->customerAuthControllerSignupRequest($body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1893,57 +1807,36 @@ function ($exception) { } /** - * Create request for operation 'apiCustomersCustomerIdCourseEnrollmentsGet' + * Create request for operation 'customerAuthControllerSignup' * - * @param string $ownershipRelation (required) - * @param string $customerId (required) - * @param string $courseId (optional) + * @param \Yoast\MyYoastApiClient\Model\SignupAccountDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCustomersCustomerIdCourseEnrollmentsGetRequest($ownershipRelation, $customerId, $courseId = null) + protected function customerAuthControllerSignupRequest($body) { - // verify the required parameter 'ownershipRelation' is set - if ($ownershipRelation === null || (is_array($ownershipRelation) && count($ownershipRelation) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $ownershipRelation when calling apiCustomersCustomerIdCourseEnrollmentsGet' - ); - } - // verify the required parameter 'customerId' is set - if ($customerId === null || (is_array($customerId) && count($customerId) === 0)) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $customerId when calling apiCustomersCustomerIdCourseEnrollmentsGet' + 'Missing the required parameter $body when calling customerAuthControllerSignup' ); } - $resourcePath = '/api/Customers/{customerId}/courseEnrollments'; + $resourcePath = '/api/Customers/signup'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if ($ownershipRelation !== null) { - $queryParams['ownershipRelation'] = ObjectSerializer::toQueryValue($ownershipRelation); - } - // query params - if ($courseId !== null) { - $queryParams['courseId'] = ObjectSerializer::toQueryValue($courseId); - } - // path params - if ($customerId !== null) { - $resourcePath = str_replace( - '{' . 'customerId' . '}', - ObjectSerializer::toPathValue($customerId), - $resourcePath - ); - } // body params $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -1960,16 +1853,9 @@ protected function apiCustomersCustomerIdCourseEnrollmentsGetRequest($ownershipR if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -1992,11 +1878,6 @@ protected function apiCustomersCustomerIdCourseEnrollmentsGetRequest($ownershipR } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -2011,7 +1892,7 @@ protected function apiCustomersCustomerIdCourseEnrollmentsGetRequest($ownershipR $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'GET', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -2019,39 +1900,39 @@ protected function apiCustomersCustomerIdCourseEnrollmentsGetRequest($ownershipR } /** - * Operation apiCustomersCustomerIdIdentitiesGet + * Operation customerComposerTokenControllerGetMany * - * Get user identities + * Get composer tokens * * @param string $customerId customerId (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\UserIdentity[] + * @return \Yoast\MyYoastApiClient\Model\ComposerToken[] */ - public function apiCustomersCustomerIdIdentitiesGet($customerId, $filter = null) + public function customerComposerTokenControllerGetMany($customerId, $filter = null) { - list($response) = $this->apiCustomersCustomerIdIdentitiesGetWithHttpInfo($customerId, $filter); + list($response) = $this->customerComposerTokenControllerGetManyWithHttpInfo($customerId, $filter); return $response; } /** - * Operation apiCustomersCustomerIdIdentitiesGetWithHttpInfo + * Operation customerComposerTokenControllerGetManyWithHttpInfo * - * Get user identities + * Get composer tokens * * @param string $customerId (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Yoast\MyYoastApiClient\Model\UserIdentity[], HTTP status code, HTTP response headers (array of strings) + * @return array of \Yoast\MyYoastApiClient\Model\ComposerToken[], HTTP status code, HTTP response headers (array of strings) */ - public function apiCustomersCustomerIdIdentitiesGetWithHttpInfo($customerId, $filter = null) + public function customerComposerTokenControllerGetManyWithHttpInfo($customerId, $filter = null) { - $returnType = '\Yoast\MyYoastApiClient\Model\UserIdentity[]'; - $request = $this->apiCustomersCustomerIdIdentitiesGetRequest($customerId, $filter); + $returnType = '\Yoast\MyYoastApiClient\Model\ComposerToken[]'; + $request = $this->customerComposerTokenControllerGetManyRequest($customerId, $filter); try { $options = $this->createHttpClientOption(); @@ -2086,7 +1967,7 @@ public function apiCustomersCustomerIdIdentitiesGetWithHttpInfo($customerId, $fi $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -2102,7 +1983,7 @@ public function apiCustomersCustomerIdIdentitiesGetWithHttpInfo($customerId, $fi case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Yoast\MyYoastApiClient\Model\UserIdentity[]', + '\Yoast\MyYoastApiClient\Model\ComposerToken[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -2113,19 +1994,19 @@ public function apiCustomersCustomerIdIdentitiesGetWithHttpInfo($customerId, $fi } /** - * Operation apiCustomersCustomerIdIdentitiesGetAsync + * Operation customerComposerTokenControllerGetManyAsync * - * Get user identities + * Get composer tokens * * @param string $customerId (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersCustomerIdIdentitiesGetAsync($customerId, $filter = null) + public function customerComposerTokenControllerGetManyAsync($customerId, $filter = null) { - return $this->apiCustomersCustomerIdIdentitiesGetAsyncWithHttpInfo($customerId, $filter) + return $this->customerComposerTokenControllerGetManyAsyncWithHttpInfo($customerId, $filter) ->then( function ($response) { return $response[0]; @@ -2134,20 +2015,20 @@ function ($response) { } /** - * Operation apiCustomersCustomerIdIdentitiesGetAsyncWithHttpInfo + * Operation customerComposerTokenControllerGetManyAsyncWithHttpInfo * - * Get user identities + * Get composer tokens * * @param string $customerId (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersCustomerIdIdentitiesGetAsyncWithHttpInfo($customerId, $filter = null) + public function customerComposerTokenControllerGetManyAsyncWithHttpInfo($customerId, $filter = null) { - $returnType = '\Yoast\MyYoastApiClient\Model\UserIdentity[]'; - $request = $this->apiCustomersCustomerIdIdentitiesGetRequest($customerId, $filter); + $returnType = '\Yoast\MyYoastApiClient\Model\ComposerToken[]'; + $request = $this->customerComposerTokenControllerGetManyRequest($customerId, $filter); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2187,24 +2068,24 @@ function ($exception) { } /** - * Create request for operation 'apiCustomersCustomerIdIdentitiesGet' + * Create request for operation 'customerComposerTokenControllerGetMany' * * @param string $customerId (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCustomersCustomerIdIdentitiesGetRequest($customerId, $filter = null) + protected function customerComposerTokenControllerGetManyRequest($customerId, $filter = null) { // verify the required parameter 'customerId' is set if ($customerId === null || (is_array($customerId) && count($customerId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $customerId when calling apiCustomersCustomerIdIdentitiesGet' + 'Missing the required parameter $customerId when calling customerComposerTokenControllerGetMany' ); } - $resourcePath = '/api/Customers/{customerId}/identities'; + $resourcePath = '/api/Customers/{customerId}/composerTokens'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2213,7 +2094,7 @@ protected function apiCustomersCustomerIdIdentitiesGetRequest($customerId, $filt // query params if ($filter !== null) { - $queryParams['filter'] = ObjectSerializer::toQueryValue($filter); + $queryParams['filter'] = ObjectSerializer::toQueryValue($filter, null); } // path params @@ -2235,7 +2116,7 @@ protected function apiCustomersCustomerIdIdentitiesGetRequest($customerId, $filt } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -2243,16 +2124,9 @@ protected function apiCustomersCustomerIdIdentitiesGetRequest($customerId, $filt if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -2275,11 +2149,10 @@ protected function apiCustomersCustomerIdIdentitiesGetRequest($customerId, $filt } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -2302,37 +2175,41 @@ protected function apiCustomersCustomerIdIdentitiesGetRequest($customerId, $filt } /** - * Operation apiCustomersCustomerIdNewsletterDelete + * Operation customerComposerTokenControllerGetOne * - * Unsubscribe from the newsletter + * Get a composer token * * @param string $customerId customerId (required) + * @param string $id id (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return object + * @return \Yoast\MyYoastApiClient\Model\ComposerToken */ - public function apiCustomersCustomerIdNewsletterDelete($customerId) + public function customerComposerTokenControllerGetOne($customerId, $id, $filter = null) { - list($response) = $this->apiCustomersCustomerIdNewsletterDeleteWithHttpInfo($customerId); + list($response) = $this->customerComposerTokenControllerGetOneWithHttpInfo($customerId, $id, $filter); return $response; } /** - * Operation apiCustomersCustomerIdNewsletterDeleteWithHttpInfo + * Operation customerComposerTokenControllerGetOneWithHttpInfo * - * Unsubscribe from the newsletter + * Get a composer token * * @param string $customerId (required) + * @param string $id (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of object, HTTP status code, HTTP response headers (array of strings) + * @return array of \Yoast\MyYoastApiClient\Model\ComposerToken, HTTP status code, HTTP response headers (array of strings) */ - public function apiCustomersCustomerIdNewsletterDeleteWithHttpInfo($customerId) + public function customerComposerTokenControllerGetOneWithHttpInfo($customerId, $id, $filter = null) { - $returnType = 'object'; - $request = $this->apiCustomersCustomerIdNewsletterDeleteRequest($customerId); + $returnType = '\Yoast\MyYoastApiClient\Model\ComposerToken'; + $request = $this->customerComposerTokenControllerGetOneRequest($customerId, $id, $filter); try { $options = $this->createHttpClientOption(); @@ -2367,7 +2244,7 @@ public function apiCustomersCustomerIdNewsletterDeleteWithHttpInfo($customerId) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -2383,7 +2260,7 @@ public function apiCustomersCustomerIdNewsletterDeleteWithHttpInfo($customerId) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - 'object', + '\Yoast\MyYoastApiClient\Model\ComposerToken', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -2394,18 +2271,20 @@ public function apiCustomersCustomerIdNewsletterDeleteWithHttpInfo($customerId) } /** - * Operation apiCustomersCustomerIdNewsletterDeleteAsync + * Operation customerComposerTokenControllerGetOneAsync * - * Unsubscribe from the newsletter + * Get a composer token * * @param string $customerId (required) + * @param string $id (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersCustomerIdNewsletterDeleteAsync($customerId) + public function customerComposerTokenControllerGetOneAsync($customerId, $id, $filter = null) { - return $this->apiCustomersCustomerIdNewsletterDeleteAsyncWithHttpInfo($customerId) + return $this->customerComposerTokenControllerGetOneAsyncWithHttpInfo($customerId, $id, $filter) ->then( function ($response) { return $response[0]; @@ -2414,19 +2293,21 @@ function ($response) { } /** - * Operation apiCustomersCustomerIdNewsletterDeleteAsyncWithHttpInfo + * Operation customerComposerTokenControllerGetOneAsyncWithHttpInfo * - * Unsubscribe from the newsletter + * Get a composer token * * @param string $customerId (required) + * @param string $id (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersCustomerIdNewsletterDeleteAsyncWithHttpInfo($customerId) + public function customerComposerTokenControllerGetOneAsyncWithHttpInfo($customerId, $id, $filter = null) { - $returnType = 'object'; - $request = $this->apiCustomersCustomerIdNewsletterDeleteRequest($customerId); + $returnType = '\Yoast\MyYoastApiClient\Model\ComposerToken'; + $request = $this->customerComposerTokenControllerGetOneRequest($customerId, $id, $filter); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2466,29 +2347,41 @@ function ($exception) { } /** - * Create request for operation 'apiCustomersCustomerIdNewsletterDelete' + * Create request for operation 'customerComposerTokenControllerGetOne' * * @param string $customerId (required) + * @param string $id (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCustomersCustomerIdNewsletterDeleteRequest($customerId) + protected function customerComposerTokenControllerGetOneRequest($customerId, $id, $filter = null) { // verify the required parameter 'customerId' is set if ($customerId === null || (is_array($customerId) && count($customerId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $customerId when calling apiCustomersCustomerIdNewsletterDelete' + 'Missing the required parameter $customerId when calling customerComposerTokenControllerGetOne' + ); + } + // 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 customerComposerTokenControllerGetOne' ); } - $resourcePath = '/api/Customers/{customerId}/newsletter'; + $resourcePath = '/api/Customers/{customerId}/composerTokens/{id}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + if ($filter !== null) { + $queryParams['filter'] = ObjectSerializer::toQueryValue($filter, null); + } // path params if ($customerId !== null) { @@ -2498,6 +2391,14 @@ protected function apiCustomersCustomerIdNewsletterDeleteRequest($customerId) $resourcePath ); } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } // body params $_tempBody = null; @@ -2509,7 +2410,7 @@ protected function apiCustomersCustomerIdNewsletterDeleteRequest($customerId) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -2517,16 +2418,9 @@ protected function apiCustomersCustomerIdNewsletterDeleteRequest($customerId) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -2549,11 +2443,10 @@ protected function apiCustomersCustomerIdNewsletterDeleteRequest($customerId) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -2568,7 +2461,7 @@ protected function apiCustomersCustomerIdNewsletterDeleteRequest($customerId) $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'DELETE', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -2576,37 +2469,35 @@ protected function apiCustomersCustomerIdNewsletterDeleteRequest($customerId) } /** - * Operation apiCustomersCustomerIdNewsletterGet + * Operation customerControllerCurrent * - * Newsletter subscription status + * Get the current customer * - * @param string $customerId customerId (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return object + * @return \Yoast\MyYoastApiClient\Model\Customer */ - public function apiCustomersCustomerIdNewsletterGet($customerId) + public function customerControllerCurrent() { - list($response) = $this->apiCustomersCustomerIdNewsletterGetWithHttpInfo($customerId); + list($response) = $this->customerControllerCurrentWithHttpInfo(); return $response; } /** - * Operation apiCustomersCustomerIdNewsletterGetWithHttpInfo + * Operation customerControllerCurrentWithHttpInfo * - * Newsletter subscription status + * Get the current customer * - * @param string $customerId (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of object, HTTP status code, HTTP response headers (array of strings) + * @return array of \Yoast\MyYoastApiClient\Model\Customer, HTTP status code, HTTP response headers (array of strings) */ - public function apiCustomersCustomerIdNewsletterGetWithHttpInfo($customerId) + public function customerControllerCurrentWithHttpInfo() { - $returnType = 'object'; - $request = $this->apiCustomersCustomerIdNewsletterGetRequest($customerId); + $returnType = '\Yoast\MyYoastApiClient\Model\Customer'; + $request = $this->customerControllerCurrentRequest(); try { $options = $this->createHttpClientOption(); @@ -2641,7 +2532,7 @@ public function apiCustomersCustomerIdNewsletterGetWithHttpInfo($customerId) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -2657,7 +2548,7 @@ public function apiCustomersCustomerIdNewsletterGetWithHttpInfo($customerId) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - 'object', + '\Yoast\MyYoastApiClient\Model\Customer', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -2668,18 +2559,17 @@ public function apiCustomersCustomerIdNewsletterGetWithHttpInfo($customerId) } /** - * Operation apiCustomersCustomerIdNewsletterGetAsync + * Operation customerControllerCurrentAsync * - * Newsletter subscription status + * Get the current customer * - * @param string $customerId (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersCustomerIdNewsletterGetAsync($customerId) + public function customerControllerCurrentAsync() { - return $this->apiCustomersCustomerIdNewsletterGetAsyncWithHttpInfo($customerId) + return $this->customerControllerCurrentAsyncWithHttpInfo() ->then( function ($response) { return $response[0]; @@ -2688,19 +2578,18 @@ function ($response) { } /** - * Operation apiCustomersCustomerIdNewsletterGetAsyncWithHttpInfo + * Operation customerControllerCurrentAsyncWithHttpInfo * - * Newsletter subscription status + * Get the current customer * - * @param string $customerId (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersCustomerIdNewsletterGetAsyncWithHttpInfo($customerId) + public function customerControllerCurrentAsyncWithHttpInfo() { - $returnType = 'object'; - $request = $this->apiCustomersCustomerIdNewsletterGetRequest($customerId); + $returnType = '\Yoast\MyYoastApiClient\Model\Customer'; + $request = $this->customerControllerCurrentRequest(); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2740,23 +2629,16 @@ function ($exception) { } /** - * Create request for operation 'apiCustomersCustomerIdNewsletterGet' + * Create request for operation 'customerControllerCurrent' * - * @param string $customerId (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCustomersCustomerIdNewsletterGetRequest($customerId) + protected function customerControllerCurrentRequest() { - // verify the required parameter 'customerId' is set - if ($customerId === null || (is_array($customerId) && count($customerId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $customerId when calling apiCustomersCustomerIdNewsletterGet' - ); - } - $resourcePath = '/api/Customers/{customerId}/newsletter'; + $resourcePath = '/api/Customers/current'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2764,14 +2646,6 @@ protected function apiCustomersCustomerIdNewsletterGetRequest($customerId) $multipart = false; - // path params - if ($customerId !== null) { - $resourcePath = str_replace( - '{' . 'customerId' . '}', - ObjectSerializer::toPathValue($customerId), - $resourcePath - ); - } // body params $_tempBody = null; @@ -2783,7 +2657,7 @@ protected function apiCustomersCustomerIdNewsletterGetRequest($customerId) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -2791,16 +2665,9 @@ protected function apiCustomersCustomerIdNewsletterGetRequest($customerId) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -2823,11 +2690,10 @@ protected function apiCustomersCustomerIdNewsletterGetRequest($customerId) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -2850,37 +2716,37 @@ protected function apiCustomersCustomerIdNewsletterGetRequest($customerId) } /** - * Operation apiCustomersCustomerIdNewsletterPost + * Operation customerControllerDownloadProfile * - * Subscribe to the newsletter + * Download profile. * - * @param string $customerId customerId (required) + * @param string $id id (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return object + * @return \Yoast\MyYoastApiClient\Model\JSZip */ - public function apiCustomersCustomerIdNewsletterPost($customerId) + public function customerControllerDownloadProfile($id) { - list($response) = $this->apiCustomersCustomerIdNewsletterPostWithHttpInfo($customerId); + list($response) = $this->customerControllerDownloadProfileWithHttpInfo($id); return $response; } /** - * Operation apiCustomersCustomerIdNewsletterPostWithHttpInfo + * Operation customerControllerDownloadProfileWithHttpInfo * - * Subscribe to the newsletter + * Download profile. * - * @param string $customerId (required) + * @param string $id (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of object, HTTP status code, HTTP response headers (array of strings) + * @return array of \Yoast\MyYoastApiClient\Model\JSZip, HTTP status code, HTTP response headers (array of strings) */ - public function apiCustomersCustomerIdNewsletterPostWithHttpInfo($customerId) + public function customerControllerDownloadProfileWithHttpInfo($id) { - $returnType = 'object'; - $request = $this->apiCustomersCustomerIdNewsletterPostRequest($customerId); + $returnType = '\Yoast\MyYoastApiClient\Model\JSZip'; + $request = $this->customerControllerDownloadProfileRequest($id); try { $options = $this->createHttpClientOption(); @@ -2915,7 +2781,7 @@ public function apiCustomersCustomerIdNewsletterPostWithHttpInfo($customerId) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -2928,10 +2794,10 @@ public function apiCustomersCustomerIdNewsletterPostWithHttpInfo($customerId) } catch (ApiException $e) { switch ($e->getCode()) { - case 201: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - 'object', + '\Yoast\MyYoastApiClient\Model\JSZip', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -2942,18 +2808,18 @@ public function apiCustomersCustomerIdNewsletterPostWithHttpInfo($customerId) } /** - * Operation apiCustomersCustomerIdNewsletterPostAsync + * Operation customerControllerDownloadProfileAsync * - * Subscribe to the newsletter + * Download profile. * - * @param string $customerId (required) + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersCustomerIdNewsletterPostAsync($customerId) + public function customerControllerDownloadProfileAsync($id) { - return $this->apiCustomersCustomerIdNewsletterPostAsyncWithHttpInfo($customerId) + return $this->customerControllerDownloadProfileAsyncWithHttpInfo($id) ->then( function ($response) { return $response[0]; @@ -2962,19 +2828,19 @@ function ($response) { } /** - * Operation apiCustomersCustomerIdNewsletterPostAsyncWithHttpInfo + * Operation customerControllerDownloadProfileAsyncWithHttpInfo * - * Subscribe to the newsletter + * Download profile. * - * @param string $customerId (required) + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersCustomerIdNewsletterPostAsyncWithHttpInfo($customerId) + public function customerControllerDownloadProfileAsyncWithHttpInfo($id) { - $returnType = 'object'; - $request = $this->apiCustomersCustomerIdNewsletterPostRequest($customerId); + $returnType = '\Yoast\MyYoastApiClient\Model\JSZip'; + $request = $this->customerControllerDownloadProfileRequest($id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3014,23 +2880,23 @@ function ($exception) { } /** - * Create request for operation 'apiCustomersCustomerIdNewsletterPost' + * Create request for operation 'customerControllerDownloadProfile' * - * @param string $customerId (required) + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCustomersCustomerIdNewsletterPostRequest($customerId) + protected function customerControllerDownloadProfileRequest($id) { - // verify the required parameter 'customerId' is set - if ($customerId === null || (is_array($customerId) && count($customerId) === 0)) { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $customerId when calling apiCustomersCustomerIdNewsletterPost' + 'Missing the required parameter $id when calling customerControllerDownloadProfile' ); } - $resourcePath = '/api/Customers/{customerId}/newsletter'; + $resourcePath = '/api/Customers/{id}/download'; $formParams = []; $queryParams = []; $headerParams = []; @@ -3039,10 +2905,10 @@ protected function apiCustomersCustomerIdNewsletterPostRequest($customerId) // path params - if ($customerId !== null) { + if ($id !== null) { $resourcePath = str_replace( - '{' . 'customerId' . '}', - ObjectSerializer::toPathValue($customerId), + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), $resourcePath ); } @@ -3057,7 +2923,7 @@ protected function apiCustomersCustomerIdNewsletterPostRequest($customerId) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -3065,16 +2931,9 @@ protected function apiCustomersCustomerIdNewsletterPostRequest($customerId) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -3097,11 +2956,10 @@ protected function apiCustomersCustomerIdNewsletterPostRequest($customerId) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -3116,7 +2974,7 @@ protected function apiCustomersCustomerIdNewsletterPostRequest($customerId) $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -3124,39 +2982,37 @@ protected function apiCustomersCustomerIdNewsletterPostRequest($customerId) } /** - * Operation apiCustomersCustomerIdOrdersGet + * Operation customerControllerEnable * - * Get orders + * Enables the customer with the given ID * - * @param string $customerId customerId (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param string $id id (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\Order[] + * @return object */ - public function apiCustomersCustomerIdOrdersGet($customerId, $filter = null) + public function customerControllerEnable($id) { - list($response) = $this->apiCustomersCustomerIdOrdersGetWithHttpInfo($customerId, $filter); + list($response) = $this->customerControllerEnableWithHttpInfo($id); return $response; } /** - * Operation apiCustomersCustomerIdOrdersGetWithHttpInfo + * Operation customerControllerEnableWithHttpInfo * - * Get orders + * Enables the customer with the given ID * - * @param string $customerId (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param string $id (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Yoast\MyYoastApiClient\Model\Order[], HTTP status code, HTTP response headers (array of strings) + * @return array of object, HTTP status code, HTTP response headers (array of strings) */ - public function apiCustomersCustomerIdOrdersGetWithHttpInfo($customerId, $filter = null) + public function customerControllerEnableWithHttpInfo($id) { - $returnType = '\Yoast\MyYoastApiClient\Model\Order[]'; - $request = $this->apiCustomersCustomerIdOrdersGetRequest($customerId, $filter); + $returnType = 'object'; + $request = $this->customerControllerEnableRequest($id); try { $options = $this->createHttpClientOption(); @@ -3191,7 +3047,7 @@ public function apiCustomersCustomerIdOrdersGetWithHttpInfo($customerId, $filter $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -3207,7 +3063,7 @@ public function apiCustomersCustomerIdOrdersGetWithHttpInfo($customerId, $filter case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Yoast\MyYoastApiClient\Model\Order[]', + 'object', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -3218,19 +3074,18 @@ public function apiCustomersCustomerIdOrdersGetWithHttpInfo($customerId, $filter } /** - * Operation apiCustomersCustomerIdOrdersGetAsync + * Operation customerControllerEnableAsync * - * Get orders + * Enables the customer with the given ID * - * @param string $customerId (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersCustomerIdOrdersGetAsync($customerId, $filter = null) + public function customerControllerEnableAsync($id) { - return $this->apiCustomersCustomerIdOrdersGetAsyncWithHttpInfo($customerId, $filter) + return $this->customerControllerEnableAsyncWithHttpInfo($id) ->then( function ($response) { return $response[0]; @@ -3239,20 +3094,19 @@ function ($response) { } /** - * Operation apiCustomersCustomerIdOrdersGetAsyncWithHttpInfo + * Operation customerControllerEnableAsyncWithHttpInfo * - * Get orders + * Enables the customer with the given ID * - * @param string $customerId (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersCustomerIdOrdersGetAsyncWithHttpInfo($customerId, $filter = null) + public function customerControllerEnableAsyncWithHttpInfo($id) { - $returnType = '\Yoast\MyYoastApiClient\Model\Order[]'; - $request = $this->apiCustomersCustomerIdOrdersGetRequest($customerId, $filter); + $returnType = 'object'; + $request = $this->customerControllerEnableRequest($id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3292,40 +3146,35 @@ function ($exception) { } /** - * Create request for operation 'apiCustomersCustomerIdOrdersGet' + * Create request for operation 'customerControllerEnable' * - * @param string $customerId (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCustomersCustomerIdOrdersGetRequest($customerId, $filter = null) + protected function customerControllerEnableRequest($id) { - // verify the required parameter 'customerId' is set - if ($customerId === null || (is_array($customerId) && count($customerId) === 0)) { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $customerId when calling apiCustomersCustomerIdOrdersGet' + 'Missing the required parameter $id when calling customerControllerEnable' ); } - $resourcePath = '/api/Customers/{customerId}/orders'; + $resourcePath = '/api/Customers/{id}/enable'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if ($filter !== null) { - $queryParams['filter'] = ObjectSerializer::toQueryValue($filter); - } // path params - if ($customerId !== null) { + if ($id !== null) { $resourcePath = str_replace( - '{' . 'customerId' . '}', - ObjectSerializer::toPathValue($customerId), + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), $resourcePath ); } @@ -3340,7 +3189,7 @@ protected function apiCustomersCustomerIdOrdersGetRequest($customerId, $filter = } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -3348,16 +3197,9 @@ protected function apiCustomersCustomerIdOrdersGetRequest($customerId, $filter = if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -3380,11 +3222,10 @@ protected function apiCustomersCustomerIdOrdersGetRequest($customerId, $filter = } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -3399,7 +3240,7 @@ protected function apiCustomersCustomerIdOrdersGetRequest($customerId, $filter = $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'GET', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -3407,41 +3248,35 @@ protected function apiCustomersCustomerIdOrdersGetRequest($customerId, $filter = } /** - * Operation apiCustomersCustomerIdOrdersIdGet + * Operation customerControllerGetAllRoles * - * Get a order + * Get all existing roles with their ID. * - * @param string $customerId customerId (required) - * @param string $id id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\Order + * @return object */ - public function apiCustomersCustomerIdOrdersIdGet($customerId, $id, $filter = null) + public function customerControllerGetAllRoles() { - list($response) = $this->apiCustomersCustomerIdOrdersIdGetWithHttpInfo($customerId, $id, $filter); + list($response) = $this->customerControllerGetAllRolesWithHttpInfo(); return $response; } /** - * Operation apiCustomersCustomerIdOrdersIdGetWithHttpInfo + * Operation customerControllerGetAllRolesWithHttpInfo * - * Get a order + * Get all existing roles with their ID. * - * @param string $customerId (required) - * @param string $id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Yoast\MyYoastApiClient\Model\Order, HTTP status code, HTTP response headers (array of strings) + * @return array of object, HTTP status code, HTTP response headers (array of strings) */ - public function apiCustomersCustomerIdOrdersIdGetWithHttpInfo($customerId, $id, $filter = null) + public function customerControllerGetAllRolesWithHttpInfo() { - $returnType = '\Yoast\MyYoastApiClient\Model\Order'; - $request = $this->apiCustomersCustomerIdOrdersIdGetRequest($customerId, $id, $filter); + $returnType = 'object'; + $request = $this->customerControllerGetAllRolesRequest(); try { $options = $this->createHttpClientOption(); @@ -3476,7 +3311,7 @@ public function apiCustomersCustomerIdOrdersIdGetWithHttpInfo($customerId, $id, $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -3492,7 +3327,7 @@ public function apiCustomersCustomerIdOrdersIdGetWithHttpInfo($customerId, $id, case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Yoast\MyYoastApiClient\Model\Order', + 'object', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -3503,20 +3338,17 @@ public function apiCustomersCustomerIdOrdersIdGetWithHttpInfo($customerId, $id, } /** - * Operation apiCustomersCustomerIdOrdersIdGetAsync + * Operation customerControllerGetAllRolesAsync * - * Get a order + * Get all existing roles with their ID. * - * @param string $customerId (required) - * @param string $id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersCustomerIdOrdersIdGetAsync($customerId, $id, $filter = null) + public function customerControllerGetAllRolesAsync() { - return $this->apiCustomersCustomerIdOrdersIdGetAsyncWithHttpInfo($customerId, $id, $filter) + return $this->customerControllerGetAllRolesAsyncWithHttpInfo() ->then( function ($response) { return $response[0]; @@ -3525,21 +3357,18 @@ function ($response) { } /** - * Operation apiCustomersCustomerIdOrdersIdGetAsyncWithHttpInfo + * Operation customerControllerGetAllRolesAsyncWithHttpInfo * - * Get a order + * Get all existing roles with their ID. * - * @param string $customerId (required) - * @param string $id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersCustomerIdOrdersIdGetAsyncWithHttpInfo($customerId, $id, $filter = null) + public function customerControllerGetAllRolesAsyncWithHttpInfo() { - $returnType = '\Yoast\MyYoastApiClient\Model\Order'; - $request = $this->apiCustomersCustomerIdOrdersIdGetRequest($customerId, $id, $filter); + $returnType = 'object'; + $request = $this->customerControllerGetAllRolesRequest(); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3579,58 +3408,23 @@ function ($exception) { } /** - * Create request for operation 'apiCustomersCustomerIdOrdersIdGet' + * Create request for operation 'customerControllerGetAllRoles' * - * @param string $customerId (required) - * @param string $id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCustomersCustomerIdOrdersIdGetRequest($customerId, $id, $filter = null) + protected function customerControllerGetAllRolesRequest() { - // verify the required parameter 'customerId' is set - if ($customerId === null || (is_array($customerId) && count($customerId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $customerId when calling apiCustomersCustomerIdOrdersIdGet' - ); - } - // 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 apiCustomersCustomerIdOrdersIdGet' - ); - } - $resourcePath = '/api/Customers/{customerId}/orders/{id}'; + $resourcePath = '/api/Customers/allroles'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if ($filter !== null) { - $queryParams['filter'] = ObjectSerializer::toQueryValue($filter); - } - // path params - if ($customerId !== null) { - $resourcePath = str_replace( - '{' . 'customerId' . '}', - ObjectSerializer::toPathValue($customerId), - $resourcePath - ); - } - // path params - if ($id !== null) { - $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), - $resourcePath - ); - } // body params $_tempBody = null; @@ -3642,7 +3436,7 @@ protected function apiCustomersCustomerIdOrdersIdGetRequest($customerId, $id, $f } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -3650,16 +3444,9 @@ protected function apiCustomersCustomerIdOrdersIdGetRequest($customerId, $id, $f if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -3682,11 +3469,10 @@ protected function apiCustomersCustomerIdOrdersIdGetRequest($customerId, $id, $f } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -3709,39 +3495,35 @@ protected function apiCustomersCustomerIdOrdersIdGetRequest($customerId, $id, $f } /** - * Operation apiCustomersCustomerIdSitesGet + * Operation customerControllerGetCustomersWithRole * - * Get sites + * Get the ids of all customers with at least one role. * - * @param string $customerId customerId (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\Site[] + * @return string[] */ - public function apiCustomersCustomerIdSitesGet($customerId, $filter = null) + public function customerControllerGetCustomersWithRole() { - list($response) = $this->apiCustomersCustomerIdSitesGetWithHttpInfo($customerId, $filter); + list($response) = $this->customerControllerGetCustomersWithRoleWithHttpInfo(); return $response; } /** - * Operation apiCustomersCustomerIdSitesGetWithHttpInfo + * Operation customerControllerGetCustomersWithRoleWithHttpInfo * - * Get sites + * Get the ids of all customers with at least one role. * - * @param string $customerId (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Yoast\MyYoastApiClient\Model\Site[], HTTP status code, HTTP response headers (array of strings) + * @return array of string[], HTTP status code, HTTP response headers (array of strings) */ - public function apiCustomersCustomerIdSitesGetWithHttpInfo($customerId, $filter = null) + public function customerControllerGetCustomersWithRoleWithHttpInfo() { - $returnType = '\Yoast\MyYoastApiClient\Model\Site[]'; - $request = $this->apiCustomersCustomerIdSitesGetRequest($customerId, $filter); + $returnType = 'string[]'; + $request = $this->customerControllerGetCustomersWithRoleRequest(); try { $options = $this->createHttpClientOption(); @@ -3776,7 +3558,7 @@ public function apiCustomersCustomerIdSitesGetWithHttpInfo($customerId, $filter $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -3792,7 +3574,7 @@ public function apiCustomersCustomerIdSitesGetWithHttpInfo($customerId, $filter case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Yoast\MyYoastApiClient\Model\Site[]', + 'string[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -3803,19 +3585,17 @@ public function apiCustomersCustomerIdSitesGetWithHttpInfo($customerId, $filter } /** - * Operation apiCustomersCustomerIdSitesGetAsync + * Operation customerControllerGetCustomersWithRoleAsync * - * Get sites + * Get the ids of all customers with at least one role. * - * @param string $customerId (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersCustomerIdSitesGetAsync($customerId, $filter = null) + public function customerControllerGetCustomersWithRoleAsync() { - return $this->apiCustomersCustomerIdSitesGetAsyncWithHttpInfo($customerId, $filter) + return $this->customerControllerGetCustomersWithRoleAsyncWithHttpInfo() ->then( function ($response) { return $response[0]; @@ -3824,20 +3604,18 @@ function ($response) { } /** - * Operation apiCustomersCustomerIdSitesGetAsyncWithHttpInfo + * Operation customerControllerGetCustomersWithRoleAsyncWithHttpInfo * - * Get sites + * Get the ids of all customers with at least one role. * - * @param string $customerId (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersCustomerIdSitesGetAsyncWithHttpInfo($customerId, $filter = null) + public function customerControllerGetCustomersWithRoleAsyncWithHttpInfo() { - $returnType = '\Yoast\MyYoastApiClient\Model\Site[]'; - $request = $this->apiCustomersCustomerIdSitesGetRequest($customerId, $filter); + $returnType = 'string[]'; + $request = $this->customerControllerGetCustomersWithRoleRequest(); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3877,43 +3655,23 @@ function ($exception) { } /** - * Create request for operation 'apiCustomersCustomerIdSitesGet' + * Create request for operation 'customerControllerGetCustomersWithRole' * - * @param string $customerId (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCustomersCustomerIdSitesGetRequest($customerId, $filter = null) + protected function customerControllerGetCustomersWithRoleRequest() { - // verify the required parameter 'customerId' is set - if ($customerId === null || (is_array($customerId) && count($customerId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $customerId when calling apiCustomersCustomerIdSitesGet' - ); - } - $resourcePath = '/api/Customers/{customerId}/sites'; + $resourcePath = '/api/Customers/rolemapping-ids'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if ($filter !== null) { - $queryParams['filter'] = ObjectSerializer::toQueryValue($filter); - } - // path params - if ($customerId !== null) { - $resourcePath = str_replace( - '{' . 'customerId' . '}', - ObjectSerializer::toPathValue($customerId), - $resourcePath - ); - } // body params $_tempBody = null; @@ -3925,7 +3683,7 @@ protected function apiCustomersCustomerIdSitesGetRequest($customerId, $filter = } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -3933,16 +3691,9 @@ protected function apiCustomersCustomerIdSitesGetRequest($customerId, $filter = if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -3965,11 +3716,10 @@ protected function apiCustomersCustomerIdSitesGetRequest($customerId, $filter = } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -3992,41 +3742,37 @@ protected function apiCustomersCustomerIdSitesGetRequest($customerId, $filter = } /** - * Operation apiCustomersCustomerIdSitesIdGet + * Operation customerControllerGetMany * - * Get a site + * Get customers * - * @param string $customerId customerId (required) - * @param string $id id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\Site + * @return \Yoast\MyYoastApiClient\Model\Customer[] */ - public function apiCustomersCustomerIdSitesIdGet($customerId, $id, $filter = null) + public function customerControllerGetMany($filter = null) { - list($response) = $this->apiCustomersCustomerIdSitesIdGetWithHttpInfo($customerId, $id, $filter); + list($response) = $this->customerControllerGetManyWithHttpInfo($filter); return $response; } /** - * Operation apiCustomersCustomerIdSitesIdGetWithHttpInfo + * Operation customerControllerGetManyWithHttpInfo * - * Get a site + * Get customers * - * @param string $customerId (required) - * @param string $id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Yoast\MyYoastApiClient\Model\Site, HTTP status code, HTTP response headers (array of strings) + * @return array of \Yoast\MyYoastApiClient\Model\Customer[], HTTP status code, HTTP response headers (array of strings) */ - public function apiCustomersCustomerIdSitesIdGetWithHttpInfo($customerId, $id, $filter = null) + public function customerControllerGetManyWithHttpInfo($filter = null) { - $returnType = '\Yoast\MyYoastApiClient\Model\Site'; - $request = $this->apiCustomersCustomerIdSitesIdGetRequest($customerId, $id, $filter); + $returnType = '\Yoast\MyYoastApiClient\Model\Customer[]'; + $request = $this->customerControllerGetManyRequest($filter); try { $options = $this->createHttpClientOption(); @@ -4061,7 +3807,7 @@ public function apiCustomersCustomerIdSitesIdGetWithHttpInfo($customerId, $id, $ $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -4077,7 +3823,7 @@ public function apiCustomersCustomerIdSitesIdGetWithHttpInfo($customerId, $id, $ case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Yoast\MyYoastApiClient\Model\Site', + '\Yoast\MyYoastApiClient\Model\Customer[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -4088,20 +3834,18 @@ public function apiCustomersCustomerIdSitesIdGetWithHttpInfo($customerId, $id, $ } /** - * Operation apiCustomersCustomerIdSitesIdGetAsync + * Operation customerControllerGetManyAsync * - * Get a site + * Get customers * - * @param string $customerId (required) - * @param string $id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersCustomerIdSitesIdGetAsync($customerId, $id, $filter = null) + public function customerControllerGetManyAsync($filter = null) { - return $this->apiCustomersCustomerIdSitesIdGetAsyncWithHttpInfo($customerId, $id, $filter) + return $this->customerControllerGetManyAsyncWithHttpInfo($filter) ->then( function ($response) { return $response[0]; @@ -4110,21 +3854,19 @@ function ($response) { } /** - * Operation apiCustomersCustomerIdSitesIdGetAsyncWithHttpInfo + * Operation customerControllerGetManyAsyncWithHttpInfo * - * Get a site + * Get customers * - * @param string $customerId (required) - * @param string $id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersCustomerIdSitesIdGetAsyncWithHttpInfo($customerId, $id, $filter = null) + public function customerControllerGetManyAsyncWithHttpInfo($filter = null) { - $returnType = '\Yoast\MyYoastApiClient\Model\Site'; - $request = $this->apiCustomersCustomerIdSitesIdGetRequest($customerId, $id, $filter); + $returnType = '\Yoast\MyYoastApiClient\Model\Customer[]'; + $request = $this->customerControllerGetManyRequest($filter); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4164,31 +3906,17 @@ function ($exception) { } /** - * Create request for operation 'apiCustomersCustomerIdSitesIdGet' + * Create request for operation 'customerControllerGetMany' * - * @param string $customerId (required) - * @param string $id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCustomersCustomerIdSitesIdGetRequest($customerId, $id, $filter = null) + protected function customerControllerGetManyRequest($filter = null) { - // verify the required parameter 'customerId' is set - if ($customerId === null || (is_array($customerId) && count($customerId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $customerId when calling apiCustomersCustomerIdSitesIdGet' - ); - } - // 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 apiCustomersCustomerIdSitesIdGet' - ); - } - $resourcePath = '/api/Customers/{customerId}/sites/{id}'; + $resourcePath = '/api/Customers'; $formParams = []; $queryParams = []; $headerParams = []; @@ -4197,25 +3925,9 @@ protected function apiCustomersCustomerIdSitesIdGetRequest($customerId, $id, $fi // query params if ($filter !== null) { - $queryParams['filter'] = ObjectSerializer::toQueryValue($filter); + $queryParams['filter'] = ObjectSerializer::toQueryValue($filter, null); } - // path params - if ($customerId !== null) { - $resourcePath = str_replace( - '{' . 'customerId' . '}', - ObjectSerializer::toPathValue($customerId), - $resourcePath - ); - } - // path params - if ($id !== null) { - $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), - $resourcePath - ); - } // body params $_tempBody = null; @@ -4227,7 +3939,7 @@ protected function apiCustomersCustomerIdSitesIdGetRequest($customerId, $id, $fi } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -4235,16 +3947,9 @@ protected function apiCustomersCustomerIdSitesIdGetRequest($customerId, $id, $fi if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -4267,11 +3972,10 @@ protected function apiCustomersCustomerIdSitesIdGetRequest($customerId, $id, $fi } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -4294,39 +3998,37 @@ protected function apiCustomersCustomerIdSitesIdGetRequest($customerId, $id, $fi } /** - * Operation apiCustomersCustomerIdSitesPost + * Operation customerControllerGetManyPaged * - * Create a site for a user + * Get customers * - * @param \Yoast\MyYoastApiClient\Model\CreateSiteBodyDto $createSiteBodyDto createSiteBodyDto (required) - * @param string $customerId customerId (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\Site + * @return object */ - public function apiCustomersCustomerIdSitesPost($createSiteBodyDto, $customerId) + public function customerControllerGetManyPaged($filter = null) { - list($response) = $this->apiCustomersCustomerIdSitesPostWithHttpInfo($createSiteBodyDto, $customerId); + list($response) = $this->customerControllerGetManyPagedWithHttpInfo($filter); return $response; } /** - * Operation apiCustomersCustomerIdSitesPostWithHttpInfo + * Operation customerControllerGetManyPagedWithHttpInfo * - * Create a site for a user + * Get customers * - * @param \Yoast\MyYoastApiClient\Model\CreateSiteBodyDto $createSiteBodyDto (required) - * @param string $customerId (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Yoast\MyYoastApiClient\Model\Site, HTTP status code, HTTP response headers (array of strings) + * @return array of object, HTTP status code, HTTP response headers (array of strings) */ - public function apiCustomersCustomerIdSitesPostWithHttpInfo($createSiteBodyDto, $customerId) + public function customerControllerGetManyPagedWithHttpInfo($filter = null) { - $returnType = '\Yoast\MyYoastApiClient\Model\Site'; - $request = $this->apiCustomersCustomerIdSitesPostRequest($createSiteBodyDto, $customerId); + $returnType = 'object'; + $request = $this->customerControllerGetManyPagedRequest($filter); try { $options = $this->createHttpClientOption(); @@ -4361,7 +4063,7 @@ public function apiCustomersCustomerIdSitesPostWithHttpInfo($createSiteBodyDto, $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -4377,7 +4079,7 @@ public function apiCustomersCustomerIdSitesPostWithHttpInfo($createSiteBodyDto, case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Yoast\MyYoastApiClient\Model\Site', + 'object', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -4388,19 +4090,18 @@ public function apiCustomersCustomerIdSitesPostWithHttpInfo($createSiteBodyDto, } /** - * Operation apiCustomersCustomerIdSitesPostAsync + * Operation customerControllerGetManyPagedAsync * - * Create a site for a user + * Get customers * - * @param \Yoast\MyYoastApiClient\Model\CreateSiteBodyDto $createSiteBodyDto (required) - * @param string $customerId (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersCustomerIdSitesPostAsync($createSiteBodyDto, $customerId) + public function customerControllerGetManyPagedAsync($filter = null) { - return $this->apiCustomersCustomerIdSitesPostAsyncWithHttpInfo($createSiteBodyDto, $customerId) + return $this->customerControllerGetManyPagedAsyncWithHttpInfo($filter) ->then( function ($response) { return $response[0]; @@ -4409,20 +4110,19 @@ function ($response) { } /** - * Operation apiCustomersCustomerIdSitesPostAsyncWithHttpInfo + * Operation customerControllerGetManyPagedAsyncWithHttpInfo * - * Create a site for a user + * Get customers * - * @param \Yoast\MyYoastApiClient\Model\CreateSiteBodyDto $createSiteBodyDto (required) - * @param string $customerId (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersCustomerIdSitesPostAsyncWithHttpInfo($createSiteBodyDto, $customerId) + public function customerControllerGetManyPagedAsyncWithHttpInfo($filter = null) { - $returnType = '\Yoast\MyYoastApiClient\Model\Site'; - $request = $this->apiCustomersCustomerIdSitesPostRequest($createSiteBodyDto, $customerId); + $returnType = 'object'; + $request = $this->customerControllerGetManyPagedRequest($filter); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4462,51 +4162,31 @@ function ($exception) { } /** - * Create request for operation 'apiCustomersCustomerIdSitesPost' + * Create request for operation 'customerControllerGetManyPaged' * - * @param \Yoast\MyYoastApiClient\Model\CreateSiteBodyDto $createSiteBodyDto (required) - * @param string $customerId (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCustomersCustomerIdSitesPostRequest($createSiteBodyDto, $customerId) + protected function customerControllerGetManyPagedRequest($filter = null) { - // verify the required parameter 'createSiteBodyDto' is set - if ($createSiteBodyDto === null || (is_array($createSiteBodyDto) && count($createSiteBodyDto) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $createSiteBodyDto when calling apiCustomersCustomerIdSitesPost' - ); - } - // verify the required parameter 'customerId' is set - if ($customerId === null || (is_array($customerId) && count($customerId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $customerId when calling apiCustomersCustomerIdSitesPost' - ); - } - $resourcePath = '/api/Customers/{customerId}/sites'; + $resourcePath = '/api/Customers/paged'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - - // path params - if ($customerId !== null) { - $resourcePath = str_replace( - '{' . 'customerId' . '}', - ObjectSerializer::toPathValue($customerId), - $resourcePath - ); + // query params + if ($filter !== null) { + $queryParams['filter'] = ObjectSerializer::toQueryValue($filter, null); } + // body params $_tempBody = null; - if (isset($createSiteBodyDto)) { - $_tempBody = $createSiteBodyDto; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -4515,7 +4195,7 @@ protected function apiCustomersCustomerIdSitesPostRequest($createSiteBodyDto, $c } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -4523,16 +4203,9 @@ protected function apiCustomersCustomerIdSitesPostRequest($createSiteBodyDto, $c if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -4555,11 +4228,10 @@ protected function apiCustomersCustomerIdSitesPostRequest($createSiteBodyDto, $c } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -4574,7 +4246,7 @@ protected function apiCustomersCustomerIdSitesPostRequest($createSiteBodyDto, $c $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -4582,37 +4254,39 @@ protected function apiCustomersCustomerIdSitesPostRequest($createSiteBodyDto, $c } /** - * Operation apiCustomersCustomerIdStudentCourseEnrollmentsGet + * Operation customerControllerGetOne * - * Find Course Enrollments that a customer is student in + * Get a customer * - * @param string $customerId customerId (required) + * @param string $id id (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\CourseEnrollment[] + * @return \Yoast\MyYoastApiClient\Model\Customer */ - public function apiCustomersCustomerIdStudentCourseEnrollmentsGet($customerId) + public function customerControllerGetOne($id, $filter = null) { - list($response) = $this->apiCustomersCustomerIdStudentCourseEnrollmentsGetWithHttpInfo($customerId); + list($response) = $this->customerControllerGetOneWithHttpInfo($id, $filter); return $response; } /** - * Operation apiCustomersCustomerIdStudentCourseEnrollmentsGetWithHttpInfo + * Operation customerControllerGetOneWithHttpInfo * - * Find Course Enrollments that a customer is student in + * Get a customer * - * @param string $customerId (required) + * @param string $id (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Yoast\MyYoastApiClient\Model\CourseEnrollment[], HTTP status code, HTTP response headers (array of strings) + * @return array of \Yoast\MyYoastApiClient\Model\Customer, HTTP status code, HTTP response headers (array of strings) */ - public function apiCustomersCustomerIdStudentCourseEnrollmentsGetWithHttpInfo($customerId) + public function customerControllerGetOneWithHttpInfo($id, $filter = null) { - $returnType = '\Yoast\MyYoastApiClient\Model\CourseEnrollment[]'; - $request = $this->apiCustomersCustomerIdStudentCourseEnrollmentsGetRequest($customerId); + $returnType = '\Yoast\MyYoastApiClient\Model\Customer'; + $request = $this->customerControllerGetOneRequest($id, $filter); try { $options = $this->createHttpClientOption(); @@ -4647,7 +4321,7 @@ public function apiCustomersCustomerIdStudentCourseEnrollmentsGetWithHttpInfo($c $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -4663,7 +4337,7 @@ public function apiCustomersCustomerIdStudentCourseEnrollmentsGetWithHttpInfo($c case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Yoast\MyYoastApiClient\Model\CourseEnrollment[]', + '\Yoast\MyYoastApiClient\Model\Customer', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -4674,18 +4348,19 @@ public function apiCustomersCustomerIdStudentCourseEnrollmentsGetWithHttpInfo($c } /** - * Operation apiCustomersCustomerIdStudentCourseEnrollmentsGetAsync + * Operation customerControllerGetOneAsync * - * Find Course Enrollments that a customer is student in + * Get a customer * - * @param string $customerId (required) + * @param string $id (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersCustomerIdStudentCourseEnrollmentsGetAsync($customerId) + public function customerControllerGetOneAsync($id, $filter = null) { - return $this->apiCustomersCustomerIdStudentCourseEnrollmentsGetAsyncWithHttpInfo($customerId) + return $this->customerControllerGetOneAsyncWithHttpInfo($id, $filter) ->then( function ($response) { return $response[0]; @@ -4694,19 +4369,20 @@ function ($response) { } /** - * Operation apiCustomersCustomerIdStudentCourseEnrollmentsGetAsyncWithHttpInfo + * Operation customerControllerGetOneAsyncWithHttpInfo * - * Find Course Enrollments that a customer is student in + * Get a customer * - * @param string $customerId (required) + * @param string $id (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersCustomerIdStudentCourseEnrollmentsGetAsyncWithHttpInfo($customerId) + public function customerControllerGetOneAsyncWithHttpInfo($id, $filter = null) { - $returnType = '\Yoast\MyYoastApiClient\Model\CourseEnrollment[]'; - $request = $this->apiCustomersCustomerIdStudentCourseEnrollmentsGetRequest($customerId); + $returnType = '\Yoast\MyYoastApiClient\Model\Customer'; + $request = $this->customerControllerGetOneRequest($id, $filter); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4746,35 +4422,40 @@ function ($exception) { } /** - * Create request for operation 'apiCustomersCustomerIdStudentCourseEnrollmentsGet' + * Create request for operation 'customerControllerGetOne' * - * @param string $customerId (required) + * @param string $id (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCustomersCustomerIdStudentCourseEnrollmentsGetRequest($customerId) + protected function customerControllerGetOneRequest($id, $filter = null) { - // verify the required parameter 'customerId' is set - if ($customerId === null || (is_array($customerId) && count($customerId) === 0)) { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $customerId when calling apiCustomersCustomerIdStudentCourseEnrollmentsGet' + 'Missing the required parameter $id when calling customerControllerGetOne' ); } - $resourcePath = '/api/Customers/{customerId}/studentCourseEnrollments'; + $resourcePath = '/api/Customers/{id}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + if ($filter !== null) { + $queryParams['filter'] = ObjectSerializer::toQueryValue($filter, null); + } // path params - if ($customerId !== null) { + if ($id !== null) { $resourcePath = str_replace( - '{' . 'customerId' . '}', - ObjectSerializer::toPathValue($customerId), + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), $resourcePath ); } @@ -4789,7 +4470,7 @@ protected function apiCustomersCustomerIdStudentCourseEnrollmentsGetRequest($cus } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -4797,16 +4478,9 @@ protected function apiCustomersCustomerIdStudentCourseEnrollmentsGetRequest($cus if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -4829,11 +4503,10 @@ protected function apiCustomersCustomerIdStudentCourseEnrollmentsGetRequest($cus } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -4856,39 +4529,39 @@ protected function apiCustomersCustomerIdStudentCourseEnrollmentsGetRequest($cus } /** - * Operation apiCustomersCustomerIdSubscriptionsGet + * Operation customerControllerPatchProfile * - * Get subscriptions + * Update a customer to WordPress * - * @param string $customerId customerId (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param \Yoast\MyYoastApiClient\Model\UpdateUserToWordpressDto $body body (required) + * @param string $id id (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\Subscription[] + * @return \Yoast\MyYoastApiClient\Model\Customer */ - public function apiCustomersCustomerIdSubscriptionsGet($customerId, $filter = null) + public function customerControllerPatchProfile($body, $id) { - list($response) = $this->apiCustomersCustomerIdSubscriptionsGetWithHttpInfo($customerId, $filter); + list($response) = $this->customerControllerPatchProfileWithHttpInfo($body, $id); return $response; } /** - * Operation apiCustomersCustomerIdSubscriptionsGetWithHttpInfo + * Operation customerControllerPatchProfileWithHttpInfo * - * Get subscriptions + * Update a customer to WordPress * - * @param string $customerId (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param \Yoast\MyYoastApiClient\Model\UpdateUserToWordpressDto $body (required) + * @param string $id (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Yoast\MyYoastApiClient\Model\Subscription[], HTTP status code, HTTP response headers (array of strings) + * @return array of \Yoast\MyYoastApiClient\Model\Customer, HTTP status code, HTTP response headers (array of strings) */ - public function apiCustomersCustomerIdSubscriptionsGetWithHttpInfo($customerId, $filter = null) + public function customerControllerPatchProfileWithHttpInfo($body, $id) { - $returnType = '\Yoast\MyYoastApiClient\Model\Subscription[]'; - $request = $this->apiCustomersCustomerIdSubscriptionsGetRequest($customerId, $filter); + $returnType = '\Yoast\MyYoastApiClient\Model\Customer'; + $request = $this->customerControllerPatchProfileRequest($body, $id); try { $options = $this->createHttpClientOption(); @@ -4923,7 +4596,7 @@ public function apiCustomersCustomerIdSubscriptionsGetWithHttpInfo($customerId, $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -4939,7 +4612,7 @@ public function apiCustomersCustomerIdSubscriptionsGetWithHttpInfo($customerId, case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Yoast\MyYoastApiClient\Model\Subscription[]', + '\Yoast\MyYoastApiClient\Model\Customer', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -4950,19 +4623,19 @@ public function apiCustomersCustomerIdSubscriptionsGetWithHttpInfo($customerId, } /** - * Operation apiCustomersCustomerIdSubscriptionsGetAsync + * Operation customerControllerPatchProfileAsync * - * Get subscriptions + * Update a customer to WordPress * - * @param string $customerId (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param \Yoast\MyYoastApiClient\Model\UpdateUserToWordpressDto $body (required) + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersCustomerIdSubscriptionsGetAsync($customerId, $filter = null) + public function customerControllerPatchProfileAsync($body, $id) { - return $this->apiCustomersCustomerIdSubscriptionsGetAsyncWithHttpInfo($customerId, $filter) + return $this->customerControllerPatchProfileAsyncWithHttpInfo($body, $id) ->then( function ($response) { return $response[0]; @@ -4971,20 +4644,20 @@ function ($response) { } /** - * Operation apiCustomersCustomerIdSubscriptionsGetAsyncWithHttpInfo + * Operation customerControllerPatchProfileAsyncWithHttpInfo * - * Get subscriptions + * Update a customer to WordPress * - * @param string $customerId (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param \Yoast\MyYoastApiClient\Model\UpdateUserToWordpressDto $body (required) + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersCustomerIdSubscriptionsGetAsyncWithHttpInfo($customerId, $filter = null) + public function customerControllerPatchProfileAsyncWithHttpInfo($body, $id) { - $returnType = '\Yoast\MyYoastApiClient\Model\Subscription[]'; - $request = $this->apiCustomersCustomerIdSubscriptionsGetRequest($customerId, $filter); + $returnType = '\Yoast\MyYoastApiClient\Model\Customer'; + $request = $this->customerControllerPatchProfileRequest($body, $id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5024,46 +4697,51 @@ function ($exception) { } /** - * Create request for operation 'apiCustomersCustomerIdSubscriptionsGet' + * Create request for operation 'customerControllerPatchProfile' * - * @param string $customerId (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param \Yoast\MyYoastApiClient\Model\UpdateUserToWordpressDto $body (required) + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCustomersCustomerIdSubscriptionsGetRequest($customerId, $filter = null) + protected function customerControllerPatchProfileRequest($body, $id) { - // verify the required parameter 'customerId' is set - if ($customerId === null || (is_array($customerId) && count($customerId) === 0)) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling customerControllerPatchProfile' + ); + } + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $customerId when calling apiCustomersCustomerIdSubscriptionsGet' + 'Missing the required parameter $id when calling customerControllerPatchProfile' ); } - $resourcePath = '/api/Customers/{customerId}/subscriptions'; + $resourcePath = '/api/Customers/{id}/profile'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if ($filter !== null) { - $queryParams['filter'] = ObjectSerializer::toQueryValue($filter); - } // path params - if ($customerId !== null) { + if ($id !== null) { $resourcePath = str_replace( - '{' . 'customerId' . '}', - ObjectSerializer::toPathValue($customerId), + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), $resourcePath ); } // body params $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -5080,16 +4758,9 @@ protected function apiCustomersCustomerIdSubscriptionsGetRequest($customerId, $f if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -5112,11 +4783,10 @@ protected function apiCustomersCustomerIdSubscriptionsGetRequest($customerId, $f } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -5131,7 +4801,7 @@ protected function apiCustomersCustomerIdSubscriptionsGetRequest($customerId, $f $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'GET', + 'PATCH', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -5139,41 +4809,33 @@ protected function apiCustomersCustomerIdSubscriptionsGetRequest($customerId, $f } /** - * Operation apiCustomersCustomerIdSubscriptionsIdCancelPost + * Operation customerControllerProfile * - * Cancel (part of) a subscription. - * - * @param \Yoast\MyYoastApiClient\Model\CancelSubscriptionBodyDto $cancelSubscriptionBodyDto cancelSubscriptionBodyDto (required) - * @param string $customerId customerId (required) * @param string $id id (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return object */ - public function apiCustomersCustomerIdSubscriptionsIdCancelPost($cancelSubscriptionBodyDto, $customerId, $id) + public function customerControllerProfile($id) { - list($response) = $this->apiCustomersCustomerIdSubscriptionsIdCancelPostWithHttpInfo($cancelSubscriptionBodyDto, $customerId, $id); + list($response) = $this->customerControllerProfileWithHttpInfo($id); return $response; } /** - * Operation apiCustomersCustomerIdSubscriptionsIdCancelPostWithHttpInfo - * - * Cancel (part of) a subscription. + * Operation customerControllerProfileWithHttpInfo * - * @param \Yoast\MyYoastApiClient\Model\CancelSubscriptionBodyDto $cancelSubscriptionBodyDto (required) - * @param string $customerId (required) * @param string $id (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of object, HTTP status code, HTTP response headers (array of strings) */ - public function apiCustomersCustomerIdSubscriptionsIdCancelPostWithHttpInfo($cancelSubscriptionBodyDto, $customerId, $id) + public function customerControllerProfileWithHttpInfo($id) { $returnType = 'object'; - $request = $this->apiCustomersCustomerIdSubscriptionsIdCancelPostRequest($cancelSubscriptionBodyDto, $customerId, $id); + $request = $this->customerControllerProfileRequest($id); try { $options = $this->createHttpClientOption(); @@ -5208,7 +4870,7 @@ public function apiCustomersCustomerIdSubscriptionsIdCancelPostWithHttpInfo($can $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -5235,20 +4897,18 @@ public function apiCustomersCustomerIdSubscriptionsIdCancelPostWithHttpInfo($can } /** - * Operation apiCustomersCustomerIdSubscriptionsIdCancelPostAsync + * Operation customerControllerProfileAsync * - * Cancel (part of) a subscription. + * * - * @param \Yoast\MyYoastApiClient\Model\CancelSubscriptionBodyDto $cancelSubscriptionBodyDto (required) - * @param string $customerId (required) * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersCustomerIdSubscriptionsIdCancelPostAsync($cancelSubscriptionBodyDto, $customerId, $id) + public function customerControllerProfileAsync($id) { - return $this->apiCustomersCustomerIdSubscriptionsIdCancelPostAsyncWithHttpInfo($cancelSubscriptionBodyDto, $customerId, $id) + return $this->customerControllerProfileAsyncWithHttpInfo($id) ->then( function ($response) { return $response[0]; @@ -5257,21 +4917,19 @@ function ($response) { } /** - * Operation apiCustomersCustomerIdSubscriptionsIdCancelPostAsyncWithHttpInfo + * Operation customerControllerProfileAsyncWithHttpInfo * - * Cancel (part of) a subscription. + * * - * @param \Yoast\MyYoastApiClient\Model\CancelSubscriptionBodyDto $cancelSubscriptionBodyDto (required) - * @param string $customerId (required) * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersCustomerIdSubscriptionsIdCancelPostAsyncWithHttpInfo($cancelSubscriptionBodyDto, $customerId, $id) + public function customerControllerProfileAsyncWithHttpInfo($id) { $returnType = 'object'; - $request = $this->apiCustomersCustomerIdSubscriptionsIdCancelPostRequest($cancelSubscriptionBodyDto, $customerId, $id); + $request = $this->customerControllerProfileRequest($id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5311,37 +4969,23 @@ function ($exception) { } /** - * Create request for operation 'apiCustomersCustomerIdSubscriptionsIdCancelPost' + * Create request for operation 'customerControllerProfile' * - * @param \Yoast\MyYoastApiClient\Model\CancelSubscriptionBodyDto $cancelSubscriptionBodyDto (required) - * @param string $customerId (required) * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCustomersCustomerIdSubscriptionsIdCancelPostRequest($cancelSubscriptionBodyDto, $customerId, $id) + protected function customerControllerProfileRequest($id) { - // verify the required parameter 'cancelSubscriptionBodyDto' is set - if ($cancelSubscriptionBodyDto === null || (is_array($cancelSubscriptionBodyDto) && count($cancelSubscriptionBodyDto) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $cancelSubscriptionBodyDto when calling apiCustomersCustomerIdSubscriptionsIdCancelPost' - ); - } - // verify the required parameter 'customerId' is set - if ($customerId === null || (is_array($customerId) && count($customerId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $customerId when calling apiCustomersCustomerIdSubscriptionsIdCancelPost' - ); - } // 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 apiCustomersCustomerIdSubscriptionsIdCancelPost' + 'Missing the required parameter $id when calling customerControllerProfile' ); } - $resourcePath = '/api/Customers/{customerId}/subscriptions/{id}/cancel'; + $resourcePath = '/api/Customers/{id}/profile'; $formParams = []; $queryParams = []; $headerParams = []; @@ -5349,14 +4993,6 @@ protected function apiCustomersCustomerIdSubscriptionsIdCancelPostRequest($cance $multipart = false; - // path params - if ($customerId !== null) { - $resourcePath = str_replace( - '{' . 'customerId' . '}', - ObjectSerializer::toPathValue($customerId), - $resourcePath - ); - } // path params if ($id !== null) { $resourcePath = str_replace( @@ -5368,9 +5004,6 @@ protected function apiCustomersCustomerIdSubscriptionsIdCancelPostRequest($cance // body params $_tempBody = null; - if (isset($cancelSubscriptionBodyDto)) { - $_tempBody = $cancelSubscriptionBodyDto; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -5379,7 +5012,7 @@ protected function apiCustomersCustomerIdSubscriptionsIdCancelPostRequest($cance } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -5387,16 +5020,9 @@ protected function apiCustomersCustomerIdSubscriptionsIdCancelPostRequest($cance if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -5419,11 +5045,10 @@ protected function apiCustomersCustomerIdSubscriptionsIdCancelPostRequest($cance } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -5438,7 +5063,7 @@ protected function apiCustomersCustomerIdSubscriptionsIdCancelPostRequest($cance $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -5446,41 +5071,35 @@ protected function apiCustomersCustomerIdSubscriptionsIdCancelPostRequest($cance } /** - * Operation apiCustomersCustomerIdSubscriptionsIdGet - * - * Get a subscriptions + * Operation customerControllerUpdateOne * - * @param string $customerId customerId (required) + * @param \Yoast\MyYoastApiClient\Model\UpdateUserDto $body body (required) * @param string $id id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\Subscription + * @return \Yoast\MyYoastApiClient\Model\Customer */ - public function apiCustomersCustomerIdSubscriptionsIdGet($customerId, $id, $filter = null) + public function customerControllerUpdateOne($body, $id) { - list($response) = $this->apiCustomersCustomerIdSubscriptionsIdGetWithHttpInfo($customerId, $id, $filter); + list($response) = $this->customerControllerUpdateOneWithHttpInfo($body, $id); return $response; } /** - * Operation apiCustomersCustomerIdSubscriptionsIdGetWithHttpInfo + * Operation customerControllerUpdateOneWithHttpInfo * - * Get a subscriptions - * - * @param string $customerId (required) + * @param \Yoast\MyYoastApiClient\Model\UpdateUserDto $body (required) * @param string $id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Yoast\MyYoastApiClient\Model\Subscription, HTTP status code, HTTP response headers (array of strings) + * @return array of \Yoast\MyYoastApiClient\Model\Customer, HTTP status code, HTTP response headers (array of strings) */ - public function apiCustomersCustomerIdSubscriptionsIdGetWithHttpInfo($customerId, $id, $filter = null) + public function customerControllerUpdateOneWithHttpInfo($body, $id) { - $returnType = '\Yoast\MyYoastApiClient\Model\Subscription'; - $request = $this->apiCustomersCustomerIdSubscriptionsIdGetRequest($customerId, $id, $filter); + $returnType = '\Yoast\MyYoastApiClient\Model\Customer'; + $request = $this->customerControllerUpdateOneRequest($body, $id); try { $options = $this->createHttpClientOption(); @@ -5515,7 +5134,7 @@ public function apiCustomersCustomerIdSubscriptionsIdGetWithHttpInfo($customerId $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -5531,7 +5150,7 @@ public function apiCustomersCustomerIdSubscriptionsIdGetWithHttpInfo($customerId case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Yoast\MyYoastApiClient\Model\Subscription', + '\Yoast\MyYoastApiClient\Model\Customer', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -5542,20 +5161,19 @@ public function apiCustomersCustomerIdSubscriptionsIdGetWithHttpInfo($customerId } /** - * Operation apiCustomersCustomerIdSubscriptionsIdGetAsync + * Operation customerControllerUpdateOneAsync * - * Get a subscriptions + * * - * @param string $customerId (required) + * @param \Yoast\MyYoastApiClient\Model\UpdateUserDto $body (required) * @param string $id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersCustomerIdSubscriptionsIdGetAsync($customerId, $id, $filter = null) + public function customerControllerUpdateOneAsync($body, $id) { - return $this->apiCustomersCustomerIdSubscriptionsIdGetAsyncWithHttpInfo($customerId, $id, $filter) + return $this->customerControllerUpdateOneAsyncWithHttpInfo($body, $id) ->then( function ($response) { return $response[0]; @@ -5564,21 +5182,20 @@ function ($response) { } /** - * Operation apiCustomersCustomerIdSubscriptionsIdGetAsyncWithHttpInfo + * Operation customerControllerUpdateOneAsyncWithHttpInfo * - * Get a subscriptions + * * - * @param string $customerId (required) + * @param \Yoast\MyYoastApiClient\Model\UpdateUserDto $body (required) * @param string $id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersCustomerIdSubscriptionsIdGetAsyncWithHttpInfo($customerId, $id, $filter = null) + public function customerControllerUpdateOneAsyncWithHttpInfo($body, $id) { - $returnType = '\Yoast\MyYoastApiClient\Model\Subscription'; - $request = $this->apiCustomersCustomerIdSubscriptionsIdGetRequest($customerId, $id, $filter); + $returnType = '\Yoast\MyYoastApiClient\Model\Customer'; + $request = $this->customerControllerUpdateOneRequest($body, $id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5618,50 +5235,37 @@ function ($exception) { } /** - * Create request for operation 'apiCustomersCustomerIdSubscriptionsIdGet' + * Create request for operation 'customerControllerUpdateOne' * - * @param string $customerId (required) + * @param \Yoast\MyYoastApiClient\Model\UpdateUserDto $body (required) * @param string $id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCustomersCustomerIdSubscriptionsIdGetRequest($customerId, $id, $filter = null) + protected function customerControllerUpdateOneRequest($body, $id) { - // verify the required parameter 'customerId' is set - if ($customerId === null || (is_array($customerId) && count($customerId) === 0)) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $customerId when calling apiCustomersCustomerIdSubscriptionsIdGet' + 'Missing the required parameter $body when calling customerControllerUpdateOne' ); } // 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 apiCustomersCustomerIdSubscriptionsIdGet' + 'Missing the required parameter $id when calling customerControllerUpdateOne' ); } - $resourcePath = '/api/Customers/{customerId}/subscriptions/{id}'; + $resourcePath = '/api/Customers/{id}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if ($filter !== null) { - $queryParams['filter'] = ObjectSerializer::toQueryValue($filter); - } - // path params - if ($customerId !== null) { - $resourcePath = str_replace( - '{' . 'customerId' . '}', - ObjectSerializer::toPathValue($customerId), - $resourcePath - ); - } // path params if ($id !== null) { $resourcePath = str_replace( @@ -5673,6 +5277,9 @@ protected function apiCustomersCustomerIdSubscriptionsIdGetRequest($customerId, // body params $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -5689,16 +5296,9 @@ protected function apiCustomersCustomerIdSubscriptionsIdGetRequest($customerId, if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -5721,11 +5321,10 @@ protected function apiCustomersCustomerIdSubscriptionsIdGetRequest($customerId, } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -5740,7 +5339,7 @@ protected function apiCustomersCustomerIdSubscriptionsIdGetRequest($customerId, $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'GET', + 'PATCH', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -5748,37 +5347,37 @@ protected function apiCustomersCustomerIdSubscriptionsIdGetRequest($customerId, } /** - * Operation apiCustomersGet + * Operation customerControllerUploadAvatar * - * Get customers + * Upload a new UserAvatar to WordPress * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param string $id id (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\Customer[] + * @return \Yoast\MyYoastApiClient\Model\Customer */ - public function apiCustomersGet($filter = null) + public function customerControllerUploadAvatar($id) { - list($response) = $this->apiCustomersGetWithHttpInfo($filter); + list($response) = $this->customerControllerUploadAvatarWithHttpInfo($id); return $response; } /** - * Operation apiCustomersGetWithHttpInfo + * Operation customerControllerUploadAvatarWithHttpInfo * - * Get customers + * Upload a new UserAvatar to WordPress * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param string $id (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Yoast\MyYoastApiClient\Model\Customer[], HTTP status code, HTTP response headers (array of strings) + * @return array of \Yoast\MyYoastApiClient\Model\Customer, HTTP status code, HTTP response headers (array of strings) */ - public function apiCustomersGetWithHttpInfo($filter = null) + public function customerControllerUploadAvatarWithHttpInfo($id) { - $returnType = '\Yoast\MyYoastApiClient\Model\Customer[]'; - $request = $this->apiCustomersGetRequest($filter); + $returnType = '\Yoast\MyYoastApiClient\Model\Customer'; + $request = $this->customerControllerUploadAvatarRequest($id); try { $options = $this->createHttpClientOption(); @@ -5813,7 +5412,7 @@ public function apiCustomersGetWithHttpInfo($filter = null) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -5829,7 +5428,7 @@ public function apiCustomersGetWithHttpInfo($filter = null) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Yoast\MyYoastApiClient\Model\Customer[]', + '\Yoast\MyYoastApiClient\Model\Customer', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -5840,18 +5439,18 @@ public function apiCustomersGetWithHttpInfo($filter = null) } /** - * Operation apiCustomersGetAsync + * Operation customerControllerUploadAvatarAsync * - * Get customers + * Upload a new UserAvatar to WordPress * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersGetAsync($filter = null) + public function customerControllerUploadAvatarAsync($id) { - return $this->apiCustomersGetAsyncWithHttpInfo($filter) + return $this->customerControllerUploadAvatarAsyncWithHttpInfo($id) ->then( function ($response) { return $response[0]; @@ -5860,19 +5459,19 @@ function ($response) { } /** - * Operation apiCustomersGetAsyncWithHttpInfo + * Operation customerControllerUploadAvatarAsyncWithHttpInfo * - * Get customers + * Upload a new UserAvatar to WordPress * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersGetAsyncWithHttpInfo($filter = null) + public function customerControllerUploadAvatarAsyncWithHttpInfo($id) { - $returnType = '\Yoast\MyYoastApiClient\Model\Customer[]'; - $request = $this->apiCustomersGetRequest($filter); + $returnType = '\Yoast\MyYoastApiClient\Model\Customer'; + $request = $this->customerControllerUploadAvatarRequest($id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -5912,28 +5511,38 @@ function ($exception) { } /** - * Create request for operation 'apiCustomersGet' + * Create request for operation 'customerControllerUploadAvatar' * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCustomersGetRequest($filter = null) + protected function customerControllerUploadAvatarRequest($id) { + // 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 customerControllerUploadAvatar' + ); + } - $resourcePath = '/api/Customers'; + $resourcePath = '/api/Customers/{id}/avatar'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if ($filter !== null) { - $queryParams['filter'] = ObjectSerializer::toQueryValue($filter); - } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } // body params $_tempBody = null; @@ -5945,7 +5554,7 @@ protected function apiCustomersGetRequest($filter = null) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -5953,16 +5562,9 @@ protected function apiCustomersGetRequest($filter = null) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -5985,11 +5587,10 @@ protected function apiCustomersGetRequest($filter = null) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -6004,7 +5605,7 @@ protected function apiCustomersGetRequest($filter = null) $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'GET', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -6012,36 +5613,37 @@ protected function apiCustomersGetRequest($filter = null) } /** - * Operation apiCustomersIdAccessTokensPost + * Operation customerCourseEnrollmentControllerGetBuyerCourseEnrollments * - * Create an access token for a user + * Find Course Enrollments that a customer is buyer of * - * @param string $id id (required) + * @param string $customerId customerId (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return \Yoast\MyYoastApiClient\Model\CourseEnrollment[] */ - public function apiCustomersIdAccessTokensPost($id) + public function customerCourseEnrollmentControllerGetBuyerCourseEnrollments($customerId) { - $this->apiCustomersIdAccessTokensPostWithHttpInfo($id); + list($response) = $this->customerCourseEnrollmentControllerGetBuyerCourseEnrollmentsWithHttpInfo($customerId); + return $response; } /** - * Operation apiCustomersIdAccessTokensPostWithHttpInfo + * Operation customerCourseEnrollmentControllerGetBuyerCourseEnrollmentsWithHttpInfo * - * Create an access token for a user + * Find Course Enrollments that a customer is buyer of * - * @param string $id (required) + * @param string $customerId (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of \Yoast\MyYoastApiClient\Model\CourseEnrollment[], HTTP status code, HTTP response headers (array of strings) */ - public function apiCustomersIdAccessTokensPostWithHttpInfo($id) + public function customerCourseEnrollmentControllerGetBuyerCourseEnrollmentsWithHttpInfo($customerId) { - $returnType = ''; - $request = $this->apiCustomersIdAccessTokensPostRequest($id); + $returnType = '\Yoast\MyYoastApiClient\Model\CourseEnrollment[]'; + $request = $this->customerCourseEnrollmentControllerGetBuyerCourseEnrollmentsRequest($customerId); try { $options = $this->createHttpClientOption(); @@ -6071,28 +5673,50 @@ public function apiCustomersIdAccessTokensPostWithHttpInfo($id) ); } - return [null, $statusCode, $response->getHeaders()]; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if (!in_array($returnType, ['string','integer','bool'])) { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; } catch (ApiException $e) { switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Yoast\MyYoastApiClient\Model\CourseEnrollment[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } } /** - * Operation apiCustomersIdAccessTokensPostAsync + * Operation customerCourseEnrollmentControllerGetBuyerCourseEnrollmentsAsync * - * Create an access token for a user + * Find Course Enrollments that a customer is buyer of * - * @param string $id (required) + * @param string $customerId (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersIdAccessTokensPostAsync($id) + public function customerCourseEnrollmentControllerGetBuyerCourseEnrollmentsAsync($customerId) { - return $this->apiCustomersIdAccessTokensPostAsyncWithHttpInfo($id) + return $this->customerCourseEnrollmentControllerGetBuyerCourseEnrollmentsAsyncWithHttpInfo($customerId) ->then( function ($response) { return $response[0]; @@ -6101,34 +5725,48 @@ function ($response) { } /** - * Operation apiCustomersIdAccessTokensPostAsyncWithHttpInfo + * Operation customerCourseEnrollmentControllerGetBuyerCourseEnrollmentsAsyncWithHttpInfo * - * Create an access token for a user + * Find Course Enrollments that a customer is buyer of * - * @param string $id (required) + * @param string $customerId (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersIdAccessTokensPostAsyncWithHttpInfo($id) + public function customerCourseEnrollmentControllerGetBuyerCourseEnrollmentsAsyncWithHttpInfo($customerId) { - $returnType = ''; - $request = $this->apiCustomersIdAccessTokensPostRequest($id); + $returnType = '\Yoast\MyYoastApiClient\Model\CourseEnrollment[]'; + $request = $this->customerCourseEnrollmentControllerGetBuyerCourseEnrollmentsRequest($customerId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $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() + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + 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(), @@ -6139,23 +5777,23 @@ function ($exception) { } /** - * Create request for operation 'apiCustomersIdAccessTokensPost' + * Create request for operation 'customerCourseEnrollmentControllerGetBuyerCourseEnrollments' * - * @param string $id (required) + * @param string $customerId (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCustomersIdAccessTokensPostRequest($id) + protected function customerCourseEnrollmentControllerGetBuyerCourseEnrollmentsRequest($customerId) { - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { + // verify the required parameter 'customerId' is set + if ($customerId === null || (is_array($customerId) && count($customerId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling apiCustomersIdAccessTokensPost' + 'Missing the required parameter $customerId when calling customerCourseEnrollmentControllerGetBuyerCourseEnrollments' ); } - $resourcePath = '/api/Customers/{id}/accessTokens'; + $resourcePath = '/api/Customers/{customerId}/buyerCourseEnrollments'; $formParams = []; $queryParams = []; $headerParams = []; @@ -6164,10 +5802,10 @@ protected function apiCustomersIdAccessTokensPostRequest($id) // path params - if ($id !== null) { + if ($customerId !== null) { $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), + '{' . 'customerId' . '}', + ObjectSerializer::toPathValue($customerId), $resourcePath ); } @@ -6182,7 +5820,7 @@ protected function apiCustomersIdAccessTokensPostRequest($id) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -6190,16 +5828,9 @@ protected function apiCustomersIdAccessTokensPostRequest($id) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -6222,6 +5853,10 @@ protected function apiCustomersIdAccessTokensPostRequest($id) } } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -6236,7 +5871,7 @@ protected function apiCustomersIdAccessTokensPostRequest($id) $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -6244,37 +5879,41 @@ protected function apiCustomersIdAccessTokensPostRequest($id) } /** - * Operation apiCustomersIdAvatarPost + * Operation customerCourseEnrollmentControllerGetCourseEnrollments * - * Upload a new UserAvatar to WordPress + * Find Course Enrollments * - * @param string $id id (required) + * @param string $customerId customerId (required) + * @param string $ownershipRelation ownershipRelation (required) + * @param string $courseId courseId (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\Customer + * @return \Yoast\MyYoastApiClient\Model\CourseEnrollment[] */ - public function apiCustomersIdAvatarPost($id) + public function customerCourseEnrollmentControllerGetCourseEnrollments($customerId, $ownershipRelation, $courseId = null) { - list($response) = $this->apiCustomersIdAvatarPostWithHttpInfo($id); + list($response) = $this->customerCourseEnrollmentControllerGetCourseEnrollmentsWithHttpInfo($customerId, $ownershipRelation, $courseId); return $response; } /** - * Operation apiCustomersIdAvatarPostWithHttpInfo + * Operation customerCourseEnrollmentControllerGetCourseEnrollmentsWithHttpInfo * - * Upload a new UserAvatar to WordPress + * Find Course Enrollments * - * @param string $id (required) + * @param string $customerId (required) + * @param string $ownershipRelation (required) + * @param string $courseId (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Yoast\MyYoastApiClient\Model\Customer, HTTP status code, HTTP response headers (array of strings) + * @return array of \Yoast\MyYoastApiClient\Model\CourseEnrollment[], HTTP status code, HTTP response headers (array of strings) */ - public function apiCustomersIdAvatarPostWithHttpInfo($id) + public function customerCourseEnrollmentControllerGetCourseEnrollmentsWithHttpInfo($customerId, $ownershipRelation, $courseId = null) { - $returnType = '\Yoast\MyYoastApiClient\Model\Customer'; - $request = $this->apiCustomersIdAvatarPostRequest($id); + $returnType = '\Yoast\MyYoastApiClient\Model\CourseEnrollment[]'; + $request = $this->customerCourseEnrollmentControllerGetCourseEnrollmentsRequest($customerId, $ownershipRelation, $courseId); try { $options = $this->createHttpClientOption(); @@ -6309,7 +5948,7 @@ public function apiCustomersIdAvatarPostWithHttpInfo($id) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -6325,7 +5964,7 @@ public function apiCustomersIdAvatarPostWithHttpInfo($id) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Yoast\MyYoastApiClient\Model\Customer', + '\Yoast\MyYoastApiClient\Model\CourseEnrollment[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -6336,18 +5975,20 @@ public function apiCustomersIdAvatarPostWithHttpInfo($id) } /** - * Operation apiCustomersIdAvatarPostAsync + * Operation customerCourseEnrollmentControllerGetCourseEnrollmentsAsync * - * Upload a new UserAvatar to WordPress + * Find Course Enrollments * - * @param string $id (required) + * @param string $customerId (required) + * @param string $ownershipRelation (required) + * @param string $courseId (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersIdAvatarPostAsync($id) + public function customerCourseEnrollmentControllerGetCourseEnrollmentsAsync($customerId, $ownershipRelation, $courseId = null) { - return $this->apiCustomersIdAvatarPostAsyncWithHttpInfo($id) + return $this->customerCourseEnrollmentControllerGetCourseEnrollmentsAsyncWithHttpInfo($customerId, $ownershipRelation, $courseId) ->then( function ($response) { return $response[0]; @@ -6356,19 +5997,21 @@ function ($response) { } /** - * Operation apiCustomersIdAvatarPostAsyncWithHttpInfo + * Operation customerCourseEnrollmentControllerGetCourseEnrollmentsAsyncWithHttpInfo * - * Upload a new UserAvatar to WordPress + * Find Course Enrollments * - * @param string $id (required) + * @param string $customerId (required) + * @param string $ownershipRelation (required) + * @param string $courseId (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersIdAvatarPostAsyncWithHttpInfo($id) + public function customerCourseEnrollmentControllerGetCourseEnrollmentsAsyncWithHttpInfo($customerId, $ownershipRelation, $courseId = null) { - $returnType = '\Yoast\MyYoastApiClient\Model\Customer'; - $request = $this->apiCustomersIdAvatarPostRequest($id); + $returnType = '\Yoast\MyYoastApiClient\Model\CourseEnrollment[]'; + $request = $this->customerCourseEnrollmentControllerGetCourseEnrollmentsRequest($customerId, $ownershipRelation, $courseId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6408,35 +6051,51 @@ function ($exception) { } /** - * Create request for operation 'apiCustomersIdAvatarPost' + * Create request for operation 'customerCourseEnrollmentControllerGetCourseEnrollments' * - * @param string $id (required) + * @param string $customerId (required) + * @param string $ownershipRelation (required) + * @param string $courseId (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCustomersIdAvatarPostRequest($id) + protected function customerCourseEnrollmentControllerGetCourseEnrollmentsRequest($customerId, $ownershipRelation, $courseId = null) { - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { + // verify the required parameter 'customerId' is set + if ($customerId === null || (is_array($customerId) && count($customerId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $customerId when calling customerCourseEnrollmentControllerGetCourseEnrollments' + ); + } + // verify the required parameter 'ownershipRelation' is set + if ($ownershipRelation === null || (is_array($ownershipRelation) && count($ownershipRelation) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling apiCustomersIdAvatarPost' + 'Missing the required parameter $ownershipRelation when calling customerCourseEnrollmentControllerGetCourseEnrollments' ); } - $resourcePath = '/api/Customers/{id}/avatar'; + $resourcePath = '/api/Customers/{customerId}/courseEnrollments'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + if ($ownershipRelation !== null) { + $queryParams['ownershipRelation'] = ObjectSerializer::toQueryValue($ownershipRelation, 'uuid'); + } + // query params + if ($courseId !== null) { + $queryParams['courseId'] = ObjectSerializer::toQueryValue($courseId, 'uuid'); + } // path params - if ($id !== null) { + if ($customerId !== null) { $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), + '{' . 'customerId' . '}', + ObjectSerializer::toPathValue($customerId), $resourcePath ); } @@ -6451,7 +6110,7 @@ protected function apiCustomersIdAvatarPostRequest($id) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -6459,16 +6118,9 @@ protected function apiCustomersIdAvatarPostRequest($id) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -6491,11 +6143,10 @@ protected function apiCustomersIdAvatarPostRequest($id) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -6510,7 +6161,7 @@ protected function apiCustomersIdAvatarPostRequest($id) $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -6518,37 +6169,37 @@ protected function apiCustomersIdAvatarPostRequest($id) } /** - * Operation apiCustomersIdDownloadGet + * Operation customerCourseEnrollmentControllerGetStudentCourseEnrollments * - * Download profile. + * Find Course Enrollments that a customer is student in * - * @param string $id id (required) + * @param string $customerId customerId (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\JSZip + * @return \Yoast\MyYoastApiClient\Model\CourseEnrollment[] */ - public function apiCustomersIdDownloadGet($id) + public function customerCourseEnrollmentControllerGetStudentCourseEnrollments($customerId) { - list($response) = $this->apiCustomersIdDownloadGetWithHttpInfo($id); + list($response) = $this->customerCourseEnrollmentControllerGetStudentCourseEnrollmentsWithHttpInfo($customerId); return $response; } /** - * Operation apiCustomersIdDownloadGetWithHttpInfo + * Operation customerCourseEnrollmentControllerGetStudentCourseEnrollmentsWithHttpInfo * - * Download profile. + * Find Course Enrollments that a customer is student in * - * @param string $id (required) + * @param string $customerId (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Yoast\MyYoastApiClient\Model\JSZip, HTTP status code, HTTP response headers (array of strings) + * @return array of \Yoast\MyYoastApiClient\Model\CourseEnrollment[], HTTP status code, HTTP response headers (array of strings) */ - public function apiCustomersIdDownloadGetWithHttpInfo($id) + public function customerCourseEnrollmentControllerGetStudentCourseEnrollmentsWithHttpInfo($customerId) { - $returnType = '\Yoast\MyYoastApiClient\Model\JSZip'; - $request = $this->apiCustomersIdDownloadGetRequest($id); + $returnType = '\Yoast\MyYoastApiClient\Model\CourseEnrollment[]'; + $request = $this->customerCourseEnrollmentControllerGetStudentCourseEnrollmentsRequest($customerId); try { $options = $this->createHttpClientOption(); @@ -6583,7 +6234,7 @@ public function apiCustomersIdDownloadGetWithHttpInfo($id) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -6599,7 +6250,7 @@ public function apiCustomersIdDownloadGetWithHttpInfo($id) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Yoast\MyYoastApiClient\Model\JSZip', + '\Yoast\MyYoastApiClient\Model\CourseEnrollment[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -6610,18 +6261,18 @@ public function apiCustomersIdDownloadGetWithHttpInfo($id) } /** - * Operation apiCustomersIdDownloadGetAsync + * Operation customerCourseEnrollmentControllerGetStudentCourseEnrollmentsAsync * - * Download profile. + * Find Course Enrollments that a customer is student in * - * @param string $id (required) + * @param string $customerId (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersIdDownloadGetAsync($id) + public function customerCourseEnrollmentControllerGetStudentCourseEnrollmentsAsync($customerId) { - return $this->apiCustomersIdDownloadGetAsyncWithHttpInfo($id) + return $this->customerCourseEnrollmentControllerGetStudentCourseEnrollmentsAsyncWithHttpInfo($customerId) ->then( function ($response) { return $response[0]; @@ -6630,19 +6281,19 @@ function ($response) { } /** - * Operation apiCustomersIdDownloadGetAsyncWithHttpInfo + * Operation customerCourseEnrollmentControllerGetStudentCourseEnrollmentsAsyncWithHttpInfo * - * Download profile. + * Find Course Enrollments that a customer is student in * - * @param string $id (required) + * @param string $customerId (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersIdDownloadGetAsyncWithHttpInfo($id) + public function customerCourseEnrollmentControllerGetStudentCourseEnrollmentsAsyncWithHttpInfo($customerId) { - $returnType = '\Yoast\MyYoastApiClient\Model\JSZip'; - $request = $this->apiCustomersIdDownloadGetRequest($id); + $returnType = '\Yoast\MyYoastApiClient\Model\CourseEnrollment[]'; + $request = $this->customerCourseEnrollmentControllerGetStudentCourseEnrollmentsRequest($customerId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6682,23 +6333,23 @@ function ($exception) { } /** - * Create request for operation 'apiCustomersIdDownloadGet' + * Create request for operation 'customerCourseEnrollmentControllerGetStudentCourseEnrollments' * - * @param string $id (required) + * @param string $customerId (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCustomersIdDownloadGetRequest($id) + protected function customerCourseEnrollmentControllerGetStudentCourseEnrollmentsRequest($customerId) { - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { + // verify the required parameter 'customerId' is set + if ($customerId === null || (is_array($customerId) && count($customerId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling apiCustomersIdDownloadGet' + 'Missing the required parameter $customerId when calling customerCourseEnrollmentControllerGetStudentCourseEnrollments' ); } - $resourcePath = '/api/Customers/{id}/download'; + $resourcePath = '/api/Customers/{customerId}/studentCourseEnrollments'; $formParams = []; $queryParams = []; $headerParams = []; @@ -6707,10 +6358,10 @@ protected function apiCustomersIdDownloadGetRequest($id) // path params - if ($id !== null) { + if ($customerId !== null) { $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), + '{' . 'customerId' . '}', + ObjectSerializer::toPathValue($customerId), $resourcePath ); } @@ -6725,7 +6376,7 @@ protected function apiCustomersIdDownloadGetRequest($id) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -6733,16 +6384,9 @@ protected function apiCustomersIdDownloadGetRequest($id) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -6765,11 +6409,10 @@ protected function apiCustomersIdDownloadGetRequest($id) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -6792,37 +6435,37 @@ protected function apiCustomersIdDownloadGetRequest($id) } /** - * Operation apiCustomersIdEnablePost + * Operation customerGDPRControllerDeleteCustomer * - * Enables the customer with the given ID + * Performs a \"GDPR forget me\" request. * * @param string $id id (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return object + * @return string */ - public function apiCustomersIdEnablePost($id) + public function customerGDPRControllerDeleteCustomer($id) { - list($response) = $this->apiCustomersIdEnablePostWithHttpInfo($id); + list($response) = $this->customerGDPRControllerDeleteCustomerWithHttpInfo($id); return $response; } /** - * Operation apiCustomersIdEnablePostWithHttpInfo + * Operation customerGDPRControllerDeleteCustomerWithHttpInfo * - * Enables the customer with the given ID + * Performs a \"GDPR forget me\" request. * * @param string $id (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of object, HTTP status code, HTTP response headers (array of strings) + * @return array of string, HTTP status code, HTTP response headers (array of strings) */ - public function apiCustomersIdEnablePostWithHttpInfo($id) + public function customerGDPRControllerDeleteCustomerWithHttpInfo($id) { - $returnType = 'object'; - $request = $this->apiCustomersIdEnablePostRequest($id); + $returnType = 'string'; + $request = $this->customerGDPRControllerDeleteCustomerRequest($id); try { $options = $this->createHttpClientOption(); @@ -6857,7 +6500,7 @@ public function apiCustomersIdEnablePostWithHttpInfo($id) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -6873,7 +6516,7 @@ public function apiCustomersIdEnablePostWithHttpInfo($id) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - 'object', + 'string', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -6884,18 +6527,18 @@ public function apiCustomersIdEnablePostWithHttpInfo($id) } /** - * Operation apiCustomersIdEnablePostAsync + * Operation customerGDPRControllerDeleteCustomerAsync * - * Enables the customer with the given ID + * Performs a \"GDPR forget me\" request. * * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersIdEnablePostAsync($id) + public function customerGDPRControllerDeleteCustomerAsync($id) { - return $this->apiCustomersIdEnablePostAsyncWithHttpInfo($id) + return $this->customerGDPRControllerDeleteCustomerAsyncWithHttpInfo($id) ->then( function ($response) { return $response[0]; @@ -6904,19 +6547,19 @@ function ($response) { } /** - * Operation apiCustomersIdEnablePostAsyncWithHttpInfo + * Operation customerGDPRControllerDeleteCustomerAsyncWithHttpInfo * - * Enables the customer with the given ID + * Performs a \"GDPR forget me\" request. * * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersIdEnablePostAsyncWithHttpInfo($id) + public function customerGDPRControllerDeleteCustomerAsyncWithHttpInfo($id) { - $returnType = 'object'; - $request = $this->apiCustomersIdEnablePostRequest($id); + $returnType = 'string'; + $request = $this->customerGDPRControllerDeleteCustomerRequest($id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -6956,23 +6599,23 @@ function ($exception) { } /** - * Create request for operation 'apiCustomersIdEnablePost' + * Create request for operation 'customerGDPRControllerDeleteCustomer' * * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCustomersIdEnablePostRequest($id) + protected function customerGDPRControllerDeleteCustomerRequest($id) { // 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 apiCustomersIdEnablePost' + 'Missing the required parameter $id when calling customerGDPRControllerDeleteCustomer' ); } - $resourcePath = '/api/Customers/{id}/enable'; + $resourcePath = '/api/Customers/{id}/gdpr-delete'; $formParams = []; $queryParams = []; $headerParams = []; @@ -6999,7 +6642,7 @@ protected function apiCustomersIdEnablePostRequest($id) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -7007,16 +6650,9 @@ protected function apiCustomersIdEnablePostRequest($id) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -7039,11 +6675,10 @@ protected function apiCustomersIdEnablePostRequest($id) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -7058,7 +6693,7 @@ protected function apiCustomersIdEnablePostRequest($id) $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'POST', + 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -7066,37 +6701,39 @@ protected function apiCustomersIdEnablePostRequest($id) } /** - * Operation apiCustomersIdFindRefundsGet + * Operation customerIdentityControllerGetMany * - * Find refunds for user + * Get user identities * - * @param string $id id (required) + * @param string $customerId customerId (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\Refund[] + * @return \Yoast\MyYoastApiClient\Model\UserIdentity[] */ - public function apiCustomersIdFindRefundsGet($id) + public function customerIdentityControllerGetMany($customerId, $filter = null) { - list($response) = $this->apiCustomersIdFindRefundsGetWithHttpInfo($id); + list($response) = $this->customerIdentityControllerGetManyWithHttpInfo($customerId, $filter); return $response; } /** - * Operation apiCustomersIdFindRefundsGetWithHttpInfo + * Operation customerIdentityControllerGetManyWithHttpInfo * - * Find refunds for user + * Get user identities * - * @param string $id (required) + * @param string $customerId (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Yoast\MyYoastApiClient\Model\Refund[], HTTP status code, HTTP response headers (array of strings) + * @return array of \Yoast\MyYoastApiClient\Model\UserIdentity[], HTTP status code, HTTP response headers (array of strings) */ - public function apiCustomersIdFindRefundsGetWithHttpInfo($id) + public function customerIdentityControllerGetManyWithHttpInfo($customerId, $filter = null) { - $returnType = '\Yoast\MyYoastApiClient\Model\Refund[]'; - $request = $this->apiCustomersIdFindRefundsGetRequest($id); + $returnType = '\Yoast\MyYoastApiClient\Model\UserIdentity[]'; + $request = $this->customerIdentityControllerGetManyRequest($customerId, $filter); try { $options = $this->createHttpClientOption(); @@ -7131,7 +6768,7 @@ public function apiCustomersIdFindRefundsGetWithHttpInfo($id) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -7147,7 +6784,7 @@ public function apiCustomersIdFindRefundsGetWithHttpInfo($id) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Yoast\MyYoastApiClient\Model\Refund[]', + '\Yoast\MyYoastApiClient\Model\UserIdentity[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -7158,18 +6795,19 @@ public function apiCustomersIdFindRefundsGetWithHttpInfo($id) } /** - * Operation apiCustomersIdFindRefundsGetAsync + * Operation customerIdentityControllerGetManyAsync * - * Find refunds for user + * Get user identities * - * @param string $id (required) + * @param string $customerId (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersIdFindRefundsGetAsync($id) + public function customerIdentityControllerGetManyAsync($customerId, $filter = null) { - return $this->apiCustomersIdFindRefundsGetAsyncWithHttpInfo($id) + return $this->customerIdentityControllerGetManyAsyncWithHttpInfo($customerId, $filter) ->then( function ($response) { return $response[0]; @@ -7178,19 +6816,20 @@ function ($response) { } /** - * Operation apiCustomersIdFindRefundsGetAsyncWithHttpInfo + * Operation customerIdentityControllerGetManyAsyncWithHttpInfo * - * Find refunds for user + * Get user identities * - * @param string $id (required) + * @param string $customerId (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersIdFindRefundsGetAsyncWithHttpInfo($id) + public function customerIdentityControllerGetManyAsyncWithHttpInfo($customerId, $filter = null) { - $returnType = '\Yoast\MyYoastApiClient\Model\Refund[]'; - $request = $this->apiCustomersIdFindRefundsGetRequest($id); + $returnType = '\Yoast\MyYoastApiClient\Model\UserIdentity[]'; + $request = $this->customerIdentityControllerGetManyRequest($customerId, $filter); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -7230,35 +6869,40 @@ function ($exception) { } /** - * Create request for operation 'apiCustomersIdFindRefundsGet' + * Create request for operation 'customerIdentityControllerGetMany' * - * @param string $id (required) + * @param string $customerId (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCustomersIdFindRefundsGetRequest($id) + protected function customerIdentityControllerGetManyRequest($customerId, $filter = null) { - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { + // verify the required parameter 'customerId' is set + if ($customerId === null || (is_array($customerId) && count($customerId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling apiCustomersIdFindRefundsGet' + 'Missing the required parameter $customerId when calling customerIdentityControllerGetMany' ); } - $resourcePath = '/api/Customers/{id}/findRefunds'; + $resourcePath = '/api/Customers/{customerId}/identities'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + if ($filter !== null) { + $queryParams['filter'] = ObjectSerializer::toQueryValue($filter, null); + } // path params - if ($id !== null) { + if ($customerId !== null) { $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), + '{' . 'customerId' . '}', + ObjectSerializer::toPathValue($customerId), $resourcePath ); } @@ -7273,7 +6917,7 @@ protected function apiCustomersIdFindRefundsGetRequest($id) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -7281,16 +6925,9 @@ protected function apiCustomersIdFindRefundsGetRequest($id) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -7313,11 +6950,10 @@ protected function apiCustomersIdFindRefundsGetRequest($id) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -7340,39 +6976,37 @@ protected function apiCustomersIdFindRefundsGetRequest($id) } /** - * Operation apiCustomersIdGet + * Operation customerNewsletterControllerStatus * - * Get a customer + * Newsletter subscription status * - * @param string $id id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param string $customerId customerId (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\Customer + * @return object */ - public function apiCustomersIdGet($id, $filter = null) + public function customerNewsletterControllerStatus($customerId) { - list($response) = $this->apiCustomersIdGetWithHttpInfo($id, $filter); + list($response) = $this->customerNewsletterControllerStatusWithHttpInfo($customerId); return $response; } /** - * Operation apiCustomersIdGetWithHttpInfo + * Operation customerNewsletterControllerStatusWithHttpInfo * - * Get a customer + * Newsletter subscription status * - * @param string $id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param string $customerId (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Yoast\MyYoastApiClient\Model\Customer, HTTP status code, HTTP response headers (array of strings) + * @return array of object, HTTP status code, HTTP response headers (array of strings) */ - public function apiCustomersIdGetWithHttpInfo($id, $filter = null) + public function customerNewsletterControllerStatusWithHttpInfo($customerId) { - $returnType = '\Yoast\MyYoastApiClient\Model\Customer'; - $request = $this->apiCustomersIdGetRequest($id, $filter); + $returnType = 'object'; + $request = $this->customerNewsletterControllerStatusRequest($customerId); try { $options = $this->createHttpClientOption(); @@ -7407,7 +7041,7 @@ public function apiCustomersIdGetWithHttpInfo($id, $filter = null) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -7423,7 +7057,7 @@ public function apiCustomersIdGetWithHttpInfo($id, $filter = null) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Yoast\MyYoastApiClient\Model\Customer', + 'object', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -7434,19 +7068,18 @@ public function apiCustomersIdGetWithHttpInfo($id, $filter = null) } /** - * Operation apiCustomersIdGetAsync + * Operation customerNewsletterControllerStatusAsync * - * Get a customer + * Newsletter subscription status * - * @param string $id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param string $customerId (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersIdGetAsync($id, $filter = null) + public function customerNewsletterControllerStatusAsync($customerId) { - return $this->apiCustomersIdGetAsyncWithHttpInfo($id, $filter) + return $this->customerNewsletterControllerStatusAsyncWithHttpInfo($customerId) ->then( function ($response) { return $response[0]; @@ -7455,20 +7088,19 @@ function ($response) { } /** - * Operation apiCustomersIdGetAsyncWithHttpInfo + * Operation customerNewsletterControllerStatusAsyncWithHttpInfo * - * Get a customer + * Newsletter subscription status * - * @param string $id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param string $customerId (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersIdGetAsyncWithHttpInfo($id, $filter = null) + public function customerNewsletterControllerStatusAsyncWithHttpInfo($customerId) { - $returnType = '\Yoast\MyYoastApiClient\Model\Customer'; - $request = $this->apiCustomersIdGetRequest($id, $filter); + $returnType = 'object'; + $request = $this->customerNewsletterControllerStatusRequest($customerId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -7508,40 +7140,35 @@ function ($exception) { } /** - * Create request for operation 'apiCustomersIdGet' + * Create request for operation 'customerNewsletterControllerStatus' * - * @param string $id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param string $customerId (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCustomersIdGetRequest($id, $filter = null) + protected function customerNewsletterControllerStatusRequest($customerId) { - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { + // verify the required parameter 'customerId' is set + if ($customerId === null || (is_array($customerId) && count($customerId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling apiCustomersIdGet' + 'Missing the required parameter $customerId when calling customerNewsletterControllerStatus' ); } - $resourcePath = '/api/Customers/{id}'; + $resourcePath = '/api/Customers/{customerId}/newsletter'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if ($filter !== null) { - $queryParams['filter'] = ObjectSerializer::toQueryValue($filter); - } // path params - if ($id !== null) { + if ($customerId !== null) { $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), + '{' . 'customerId' . '}', + ObjectSerializer::toPathValue($customerId), $resourcePath ); } @@ -7556,7 +7183,7 @@ protected function apiCustomersIdGetRequest($id, $filter = null) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -7564,16 +7191,9 @@ protected function apiCustomersIdGetRequest($id, $filter = null) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -7596,11 +7216,10 @@ protected function apiCustomersIdGetRequest($id, $filter = null) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -7623,39 +7242,37 @@ protected function apiCustomersIdGetRequest($id, $filter = null) } /** - * Operation apiCustomersIdPasswordPatch + * Operation customerNewsletterControllerSubscribe * - * Update a customer's password in WordPress + * Subscribe to the newsletter * - * @param \Yoast\MyYoastApiClient\Model\ChangePasswordDto $changePasswordDto changePasswordDto (required) - * @param string $id id (required) + * @param string $customerId customerId (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\Customer + * @return object */ - public function apiCustomersIdPasswordPatch($changePasswordDto, $id) + public function customerNewsletterControllerSubscribe($customerId) { - list($response) = $this->apiCustomersIdPasswordPatchWithHttpInfo($changePasswordDto, $id); + list($response) = $this->customerNewsletterControllerSubscribeWithHttpInfo($customerId); return $response; } /** - * Operation apiCustomersIdPasswordPatchWithHttpInfo + * Operation customerNewsletterControllerSubscribeWithHttpInfo * - * Update a customer's password in WordPress + * Subscribe to the newsletter * - * @param \Yoast\MyYoastApiClient\Model\ChangePasswordDto $changePasswordDto (required) - * @param string $id (required) + * @param string $customerId (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Yoast\MyYoastApiClient\Model\Customer, HTTP status code, HTTP response headers (array of strings) + * @return array of object, HTTP status code, HTTP response headers (array of strings) */ - public function apiCustomersIdPasswordPatchWithHttpInfo($changePasswordDto, $id) + public function customerNewsletterControllerSubscribeWithHttpInfo($customerId) { - $returnType = '\Yoast\MyYoastApiClient\Model\Customer'; - $request = $this->apiCustomersIdPasswordPatchRequest($changePasswordDto, $id); + $returnType = 'object'; + $request = $this->customerNewsletterControllerSubscribeRequest($customerId); try { $options = $this->createHttpClientOption(); @@ -7690,7 +7307,7 @@ public function apiCustomersIdPasswordPatchWithHttpInfo($changePasswordDto, $id) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -7703,10 +7320,10 @@ public function apiCustomersIdPasswordPatchWithHttpInfo($changePasswordDto, $id) } catch (ApiException $e) { switch ($e->getCode()) { - case 200: + case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Yoast\MyYoastApiClient\Model\Customer', + 'object', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -7717,19 +7334,18 @@ public function apiCustomersIdPasswordPatchWithHttpInfo($changePasswordDto, $id) } /** - * Operation apiCustomersIdPasswordPatchAsync + * Operation customerNewsletterControllerSubscribeAsync * - * Update a customer's password in WordPress + * Subscribe to the newsletter * - * @param \Yoast\MyYoastApiClient\Model\ChangePasswordDto $changePasswordDto (required) - * @param string $id (required) + * @param string $customerId (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersIdPasswordPatchAsync($changePasswordDto, $id) + public function customerNewsletterControllerSubscribeAsync($customerId) { - return $this->apiCustomersIdPasswordPatchAsyncWithHttpInfo($changePasswordDto, $id) + return $this->customerNewsletterControllerSubscribeAsyncWithHttpInfo($customerId) ->then( function ($response) { return $response[0]; @@ -7738,20 +7354,19 @@ function ($response) { } /** - * Operation apiCustomersIdPasswordPatchAsyncWithHttpInfo + * Operation customerNewsletterControllerSubscribeAsyncWithHttpInfo * - * Update a customer's password in WordPress + * Subscribe to the newsletter * - * @param \Yoast\MyYoastApiClient\Model\ChangePasswordDto $changePasswordDto (required) - * @param string $id (required) + * @param string $customerId (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersIdPasswordPatchAsyncWithHttpInfo($changePasswordDto, $id) + public function customerNewsletterControllerSubscribeAsyncWithHttpInfo($customerId) { - $returnType = '\Yoast\MyYoastApiClient\Model\Customer'; - $request = $this->apiCustomersIdPasswordPatchRequest($changePasswordDto, $id); + $returnType = 'object'; + $request = $this->customerNewsletterControllerSubscribeRequest($customerId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -7791,30 +7406,23 @@ function ($exception) { } /** - * Create request for operation 'apiCustomersIdPasswordPatch' + * Create request for operation 'customerNewsletterControllerSubscribe' * - * @param \Yoast\MyYoastApiClient\Model\ChangePasswordDto $changePasswordDto (required) - * @param string $id (required) + * @param string $customerId (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCustomersIdPasswordPatchRequest($changePasswordDto, $id) + protected function customerNewsletterControllerSubscribeRequest($customerId) { - // verify the required parameter 'changePasswordDto' is set - if ($changePasswordDto === null || (is_array($changePasswordDto) && count($changePasswordDto) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $changePasswordDto when calling apiCustomersIdPasswordPatch' - ); - } - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { + // verify the required parameter 'customerId' is set + if ($customerId === null || (is_array($customerId) && count($customerId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling apiCustomersIdPasswordPatch' + 'Missing the required parameter $customerId when calling customerNewsletterControllerSubscribe' ); } - $resourcePath = '/api/Customers/{id}/password'; + $resourcePath = '/api/Customers/{customerId}/newsletter'; $formParams = []; $queryParams = []; $headerParams = []; @@ -7823,19 +7431,16 @@ protected function apiCustomersIdPasswordPatchRequest($changePasswordDto, $id) // path params - if ($id !== null) { + if ($customerId !== null) { $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), + '{' . 'customerId' . '}', + ObjectSerializer::toPathValue($customerId), $resourcePath ); } // body params $_tempBody = null; - if (isset($changePasswordDto)) { - $_tempBody = $changePasswordDto; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -7844,7 +7449,7 @@ protected function apiCustomersIdPasswordPatchRequest($changePasswordDto, $id) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -7852,16 +7457,9 @@ protected function apiCustomersIdPasswordPatchRequest($changePasswordDto, $id) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -7884,11 +7482,10 @@ protected function apiCustomersIdPasswordPatchRequest($changePasswordDto, $id) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -7903,7 +7500,7 @@ protected function apiCustomersIdPasswordPatchRequest($changePasswordDto, $id) $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'PATCH', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -7911,34 +7508,39 @@ protected function apiCustomersIdPasswordPatchRequest($changePasswordDto, $id) } /** - * Operation apiCustomersIdPatch + * Operation customerNewsletterControllerSubscribeByEmail * - * @param \Yoast\MyYoastApiClient\Model\UpdateUserDto $updateUserDto updateUserDto (required) - * @param string $id id (required) + * Subscribes a user to a newsletter + * + * @param \Yoast\MyYoastApiClient\Model\SubscribeByEmailBodyDto $body body (required) + * @param string $list list (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return object */ - public function apiCustomersIdPatch($updateUserDto, $id) + public function customerNewsletterControllerSubscribeByEmail($body, $list) { - $this->apiCustomersIdPatchWithHttpInfo($updateUserDto, $id); + list($response) = $this->customerNewsletterControllerSubscribeByEmailWithHttpInfo($body, $list); + return $response; } /** - * Operation apiCustomersIdPatchWithHttpInfo + * Operation customerNewsletterControllerSubscribeByEmailWithHttpInfo * - * @param \Yoast\MyYoastApiClient\Model\UpdateUserDto $updateUserDto (required) - * @param string $id (required) + * Subscribes a user to a newsletter + * + * @param \Yoast\MyYoastApiClient\Model\SubscribeByEmailBodyDto $body (required) + * @param string $list (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of object, HTTP status code, HTTP response headers (array of strings) */ - public function apiCustomersIdPatchWithHttpInfo($updateUserDto, $id) + public function customerNewsletterControllerSubscribeByEmailWithHttpInfo($body, $list) { - $returnType = ''; - $request = $this->apiCustomersIdPatchRequest($updateUserDto, $id); + $returnType = 'object'; + $request = $this->customerNewsletterControllerSubscribeByEmailRequest($body, $list); try { $options = $this->createHttpClientOption(); @@ -7968,29 +7570,51 @@ public function apiCustomersIdPatchWithHttpInfo($updateUserDto, $id) ); } - return [null, $statusCode, $response->getHeaders()]; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if (!in_array($returnType, ['string','integer','bool'])) { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; } catch (ApiException $e) { switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } } /** - * Operation apiCustomersIdPatchAsync + * Operation customerNewsletterControllerSubscribeByEmailAsync * - * + * Subscribes a user to a newsletter * - * @param \Yoast\MyYoastApiClient\Model\UpdateUserDto $updateUserDto (required) - * @param string $id (required) + * @param \Yoast\MyYoastApiClient\Model\SubscribeByEmailBodyDto $body (required) + * @param string $list (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersIdPatchAsync($updateUserDto, $id) + public function customerNewsletterControllerSubscribeByEmailAsync($body, $list) { - return $this->apiCustomersIdPatchAsyncWithHttpInfo($updateUserDto, $id) + return $this->customerNewsletterControllerSubscribeByEmailAsyncWithHttpInfo($body, $list) ->then( function ($response) { return $response[0]; @@ -7999,26 +7623,40 @@ function ($response) { } /** - * Operation apiCustomersIdPatchAsyncWithHttpInfo + * Operation customerNewsletterControllerSubscribeByEmailAsyncWithHttpInfo * - * + * Subscribes a user to a newsletter * - * @param \Yoast\MyYoastApiClient\Model\UpdateUserDto $updateUserDto (required) - * @param string $id (required) + * @param \Yoast\MyYoastApiClient\Model\SubscribeByEmailBodyDto $body (required) + * @param string $list (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersIdPatchAsyncWithHttpInfo($updateUserDto, $id) + public function customerNewsletterControllerSubscribeByEmailAsyncWithHttpInfo($body, $list) { - $returnType = ''; - $request = $this->apiCustomersIdPatchRequest($updateUserDto, $id); + $returnType = 'object'; + $request = $this->customerNewsletterControllerSubscribeByEmailRequest($body, $list); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -8038,30 +7676,30 @@ function ($exception) { } /** - * Create request for operation 'apiCustomersIdPatch' + * Create request for operation 'customerNewsletterControllerSubscribeByEmail' * - * @param \Yoast\MyYoastApiClient\Model\UpdateUserDto $updateUserDto (required) - * @param string $id (required) + * @param \Yoast\MyYoastApiClient\Model\SubscribeByEmailBodyDto $body (required) + * @param string $list (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCustomersIdPatchRequest($updateUserDto, $id) + protected function customerNewsletterControllerSubscribeByEmailRequest($body, $list) { - // verify the required parameter 'updateUserDto' is set - if ($updateUserDto === null || (is_array($updateUserDto) && count($updateUserDto) === 0)) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $updateUserDto when calling apiCustomersIdPatch' + 'Missing the required parameter $body when calling customerNewsletterControllerSubscribeByEmail' ); } - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { + // verify the required parameter 'list' is set + if ($list === null || (is_array($list) && count($list) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling apiCustomersIdPatch' + 'Missing the required parameter $list when calling customerNewsletterControllerSubscribeByEmail' ); } - $resourcePath = '/api/Customers/{id}'; + $resourcePath = '/api/Customers/newsletter/{list}/subscribe'; $formParams = []; $queryParams = []; $headerParams = []; @@ -8070,18 +7708,18 @@ protected function apiCustomersIdPatchRequest($updateUserDto, $id) // path params - if ($id !== null) { + if ($list !== null) { $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), + '{' . 'list' . '}', + ObjectSerializer::toPathValue($list), $resourcePath ); } // body params $_tempBody = null; - if (isset($updateUserDto)) { - $_tempBody = $updateUserDto; + if (isset($body)) { + $_tempBody = $body; } if ($multipart) { @@ -8099,16 +7737,9 @@ protected function apiCustomersIdPatchRequest($updateUserDto, $id) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -8131,11 +7762,6 @@ protected function apiCustomersIdPatchRequest($updateUserDto, $id) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -8150,7 +7776,7 @@ protected function apiCustomersIdPatchRequest($updateUserDto, $id) $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'PATCH', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -8158,33 +7784,37 @@ protected function apiCustomersIdPatchRequest($updateUserDto, $id) } /** - * Operation apiCustomersIdProfileGet + * Operation customerNewsletterControllerUnsubscribe * - * @param string $id id (required) + * Unsubscribe from the newsletter + * + * @param string $customerId customerId (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return object */ - public function apiCustomersIdProfileGet($id) + public function customerNewsletterControllerUnsubscribe($customerId) { - list($response) = $this->apiCustomersIdProfileGetWithHttpInfo($id); + list($response) = $this->customerNewsletterControllerUnsubscribeWithHttpInfo($customerId); return $response; } /** - * Operation apiCustomersIdProfileGetWithHttpInfo + * Operation customerNewsletterControllerUnsubscribeWithHttpInfo * - * @param string $id (required) + * Unsubscribe from the newsletter + * + * @param string $customerId (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of object, HTTP status code, HTTP response headers (array of strings) */ - public function apiCustomersIdProfileGetWithHttpInfo($id) + public function customerNewsletterControllerUnsubscribeWithHttpInfo($customerId) { $returnType = 'object'; - $request = $this->apiCustomersIdProfileGetRequest($id); + $request = $this->customerNewsletterControllerUnsubscribeRequest($customerId); try { $options = $this->createHttpClientOption(); @@ -8219,7 +7849,7 @@ public function apiCustomersIdProfileGetWithHttpInfo($id) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -8246,18 +7876,18 @@ public function apiCustomersIdProfileGetWithHttpInfo($id) } /** - * Operation apiCustomersIdProfileGetAsync + * Operation customerNewsletterControllerUnsubscribeAsync * - * + * Unsubscribe from the newsletter * - * @param string $id (required) + * @param string $customerId (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersIdProfileGetAsync($id) + public function customerNewsletterControllerUnsubscribeAsync($customerId) { - return $this->apiCustomersIdProfileGetAsyncWithHttpInfo($id) + return $this->customerNewsletterControllerUnsubscribeAsyncWithHttpInfo($customerId) ->then( function ($response) { return $response[0]; @@ -8266,19 +7896,19 @@ function ($response) { } /** - * Operation apiCustomersIdProfileGetAsyncWithHttpInfo + * Operation customerNewsletterControllerUnsubscribeAsyncWithHttpInfo * - * + * Unsubscribe from the newsletter * - * @param string $id (required) + * @param string $customerId (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersIdProfileGetAsyncWithHttpInfo($id) + public function customerNewsletterControllerUnsubscribeAsyncWithHttpInfo($customerId) { $returnType = 'object'; - $request = $this->apiCustomersIdProfileGetRequest($id); + $request = $this->customerNewsletterControllerUnsubscribeRequest($customerId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -8318,23 +7948,23 @@ function ($exception) { } /** - * Create request for operation 'apiCustomersIdProfileGet' + * Create request for operation 'customerNewsletterControllerUnsubscribe' * - * @param string $id (required) + * @param string $customerId (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCustomersIdProfileGetRequest($id) + protected function customerNewsletterControllerUnsubscribeRequest($customerId) { - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { + // verify the required parameter 'customerId' is set + if ($customerId === null || (is_array($customerId) && count($customerId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling apiCustomersIdProfileGet' + 'Missing the required parameter $customerId when calling customerNewsletterControllerUnsubscribe' ); } - $resourcePath = '/api/Customers/{id}/profile'; + $resourcePath = '/api/Customers/{customerId}/newsletter'; $formParams = []; $queryParams = []; $headerParams = []; @@ -8343,10 +7973,10 @@ protected function apiCustomersIdProfileGetRequest($id) // path params - if ($id !== null) { + if ($customerId !== null) { $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), + '{' . 'customerId' . '}', + ObjectSerializer::toPathValue($customerId), $resourcePath ); } @@ -8361,7 +7991,7 @@ protected function apiCustomersIdProfileGetRequest($id) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -8369,16 +7999,9 @@ protected function apiCustomersIdProfileGetRequest($id) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -8401,11 +8024,10 @@ protected function apiCustomersIdProfileGetRequest($id) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -8420,7 +8042,7 @@ protected function apiCustomersIdProfileGetRequest($id) $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'GET', + 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -8428,39 +8050,39 @@ protected function apiCustomersIdProfileGetRequest($id) } /** - * Operation apiCustomersIdProfilePatch + * Operation customerOrderControllerGetMany * - * Update a customer to WordPress + * Get orders * - * @param string $id id (required) - * @param \Yoast\MyYoastApiClient\Model\UpdateUserToWordpressDto $updateUserToWordpressDto updateUserToWordpressDto (required) + * @param string $customerId customerId (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\Customer + * @return \Yoast\MyYoastApiClient\Model\Order[] */ - public function apiCustomersIdProfilePatch($id, $updateUserToWordpressDto) + public function customerOrderControllerGetMany($customerId, $filter = null) { - list($response) = $this->apiCustomersIdProfilePatchWithHttpInfo($id, $updateUserToWordpressDto); + list($response) = $this->customerOrderControllerGetManyWithHttpInfo($customerId, $filter); return $response; } /** - * Operation apiCustomersIdProfilePatchWithHttpInfo + * Operation customerOrderControllerGetManyWithHttpInfo * - * Update a customer to WordPress + * Get orders * - * @param string $id (required) - * @param \Yoast\MyYoastApiClient\Model\UpdateUserToWordpressDto $updateUserToWordpressDto (required) + * @param string $customerId (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Yoast\MyYoastApiClient\Model\Customer, HTTP status code, HTTP response headers (array of strings) + * @return array of \Yoast\MyYoastApiClient\Model\Order[], HTTP status code, HTTP response headers (array of strings) */ - public function apiCustomersIdProfilePatchWithHttpInfo($id, $updateUserToWordpressDto) + public function customerOrderControllerGetManyWithHttpInfo($customerId, $filter = null) { - $returnType = '\Yoast\MyYoastApiClient\Model\Customer'; - $request = $this->apiCustomersIdProfilePatchRequest($id, $updateUserToWordpressDto); + $returnType = '\Yoast\MyYoastApiClient\Model\Order[]'; + $request = $this->customerOrderControllerGetManyRequest($customerId, $filter); try { $options = $this->createHttpClientOption(); @@ -8495,7 +8117,7 @@ public function apiCustomersIdProfilePatchWithHttpInfo($id, $updateUserToWordpre $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -8511,7 +8133,7 @@ public function apiCustomersIdProfilePatchWithHttpInfo($id, $updateUserToWordpre case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Yoast\MyYoastApiClient\Model\Customer', + '\Yoast\MyYoastApiClient\Model\Order[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -8522,19 +8144,19 @@ public function apiCustomersIdProfilePatchWithHttpInfo($id, $updateUserToWordpre } /** - * Operation apiCustomersIdProfilePatchAsync + * Operation customerOrderControllerGetManyAsync * - * Update a customer to WordPress + * Get orders * - * @param string $id (required) - * @param \Yoast\MyYoastApiClient\Model\UpdateUserToWordpressDto $updateUserToWordpressDto (required) + * @param string $customerId (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersIdProfilePatchAsync($id, $updateUserToWordpressDto) + public function customerOrderControllerGetManyAsync($customerId, $filter = null) { - return $this->apiCustomersIdProfilePatchAsyncWithHttpInfo($id, $updateUserToWordpressDto) + return $this->customerOrderControllerGetManyAsyncWithHttpInfo($customerId, $filter) ->then( function ($response) { return $response[0]; @@ -8543,20 +8165,20 @@ function ($response) { } /** - * Operation apiCustomersIdProfilePatchAsyncWithHttpInfo + * Operation customerOrderControllerGetManyAsyncWithHttpInfo * - * Update a customer to WordPress + * Get orders * - * @param string $id (required) - * @param \Yoast\MyYoastApiClient\Model\UpdateUserToWordpressDto $updateUserToWordpressDto (required) + * @param string $customerId (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersIdProfilePatchAsyncWithHttpInfo($id, $updateUserToWordpressDto) + public function customerOrderControllerGetManyAsyncWithHttpInfo($customerId, $filter = null) { - $returnType = '\Yoast\MyYoastApiClient\Model\Customer'; - $request = $this->apiCustomersIdProfilePatchRequest($id, $updateUserToWordpressDto); + $returnType = '\Yoast\MyYoastApiClient\Model\Order[]'; + $request = $this->customerOrderControllerGetManyRequest($customerId, $filter); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -8596,51 +8218,46 @@ function ($exception) { } /** - * Create request for operation 'apiCustomersIdProfilePatch' + * Create request for operation 'customerOrderControllerGetMany' * - * @param string $id (required) - * @param \Yoast\MyYoastApiClient\Model\UpdateUserToWordpressDto $updateUserToWordpressDto (required) + * @param string $customerId (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCustomersIdProfilePatchRequest($id, $updateUserToWordpressDto) + protected function customerOrderControllerGetManyRequest($customerId, $filter = null) { - // 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 apiCustomersIdProfilePatch' - ); - } - // verify the required parameter 'updateUserToWordpressDto' is set - if ($updateUserToWordpressDto === null || (is_array($updateUserToWordpressDto) && count($updateUserToWordpressDto) === 0)) { + // verify the required parameter 'customerId' is set + if ($customerId === null || (is_array($customerId) && count($customerId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $updateUserToWordpressDto when calling apiCustomersIdProfilePatch' + 'Missing the required parameter $customerId when calling customerOrderControllerGetMany' ); } - $resourcePath = '/api/Customers/{id}/profile'; + $resourcePath = '/api/Customers/{customerId}/orders'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + if ($filter !== null) { + $queryParams['filter'] = ObjectSerializer::toQueryValue($filter, null); + } // path params - if ($id !== null) { + if ($customerId !== null) { $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), + '{' . 'customerId' . '}', + ObjectSerializer::toPathValue($customerId), $resourcePath ); } // body params $_tempBody = null; - if (isset($updateUserToWordpressDto)) { - $_tempBody = $updateUserToWordpressDto; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -8649,7 +8266,7 @@ protected function apiCustomersIdProfilePatchRequest($id, $updateUserToWordpress } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -8657,16 +8274,9 @@ protected function apiCustomersIdProfilePatchRequest($id, $updateUserToWordpress if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -8689,11 +8299,10 @@ protected function apiCustomersIdProfilePatchRequest($id, $updateUserToWordpress } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -8708,7 +8317,7 @@ protected function apiCustomersIdProfilePatchRequest($id, $updateUserToWordpress $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'PATCH', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -8716,34 +8325,41 @@ protected function apiCustomersIdProfilePatchRequest($id, $updateUserToWordpress } /** - * Operation apiCustomersIdRoleMappingDelete + * Operation customerOrderControllerGetOne + * + * Get a order * - * @param \Yoast\MyYoastApiClient\Model\RoleIDDto $roleIDDto roleIDDto (required) + * @param string $customerId customerId (required) * @param string $id id (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return \Yoast\MyYoastApiClient\Model\Order */ - public function apiCustomersIdRoleMappingDelete($roleIDDto, $id) + public function customerOrderControllerGetOne($customerId, $id, $filter = null) { - $this->apiCustomersIdRoleMappingDeleteWithHttpInfo($roleIDDto, $id); + list($response) = $this->customerOrderControllerGetOneWithHttpInfo($customerId, $id, $filter); + return $response; } /** - * Operation apiCustomersIdRoleMappingDeleteWithHttpInfo + * Operation customerOrderControllerGetOneWithHttpInfo * - * @param \Yoast\MyYoastApiClient\Model\RoleIDDto $roleIDDto (required) + * Get a order + * + * @param string $customerId (required) * @param string $id (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of \Yoast\MyYoastApiClient\Model\Order, HTTP status code, HTTP response headers (array of strings) */ - public function apiCustomersIdRoleMappingDeleteWithHttpInfo($roleIDDto, $id) + public function customerOrderControllerGetOneWithHttpInfo($customerId, $id, $filter = null) { - $returnType = ''; - $request = $this->apiCustomersIdRoleMappingDeleteRequest($roleIDDto, $id); + $returnType = '\Yoast\MyYoastApiClient\Model\Order'; + $request = $this->customerOrderControllerGetOneRequest($customerId, $id, $filter); try { $options = $this->createHttpClientOption(); @@ -8773,29 +8389,605 @@ public function apiCustomersIdRoleMappingDeleteWithHttpInfo($roleIDDto, $id) ); } - return [null, $statusCode, $response->getHeaders()]; - - } catch (ApiException $e) { - switch ($e->getCode()) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if (!in_array($returnType, ['string','integer','bool'])) { + $content = json_decode($content); + } } - throw $e; + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Yoast\MyYoastApiClient\Model\Order', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation customerOrderControllerGetOneAsync + * + * Get a order + * + * @param string $customerId (required) + * @param string $id (required) + * @param object $filter Used for filtering/joining the results. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function customerOrderControllerGetOneAsync($customerId, $id, $filter = null) + { + return $this->customerOrderControllerGetOneAsyncWithHttpInfo($customerId, $id, $filter) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation customerOrderControllerGetOneAsyncWithHttpInfo + * + * Get a order + * + * @param string $customerId (required) + * @param string $id (required) + * @param object $filter Used for filtering/joining the results. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function customerOrderControllerGetOneAsyncWithHttpInfo($customerId, $id, $filter = null) + { + $returnType = '\Yoast\MyYoastApiClient\Model\Order'; + $request = $this->customerOrderControllerGetOneRequest($customerId, $id, $filter); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + 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(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'customerOrderControllerGetOne' + * + * @param string $customerId (required) + * @param string $id (required) + * @param object $filter Used for filtering/joining the results. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function customerOrderControllerGetOneRequest($customerId, $id, $filter = null) + { + // verify the required parameter 'customerId' is set + if ($customerId === null || (is_array($customerId) && count($customerId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $customerId when calling customerOrderControllerGetOne' + ); + } + // 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 customerOrderControllerGetOne' + ); + } + + $resourcePath = '/api/Customers/{customerId}/orders/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($filter !== null) { + $queryParams['filter'] = ObjectSerializer::toQueryValue($filter, null); + } + + // path params + if ($customerId !== null) { + $resourcePath = str_replace( + '{' . 'customerId' . '}', + ObjectSerializer::toPathValue($customerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation customerRefundControllerFindRefunds + * + * Find refunds for user + * + * @param string $id id (required) + * + * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Yoast\MyYoastApiClient\Model\Refund[] + */ + public function customerRefundControllerFindRefunds($id) + { + list($response) = $this->customerRefundControllerFindRefundsWithHttpInfo($id); + return $response; + } + + /** + * Operation customerRefundControllerFindRefundsWithHttpInfo + * + * Find refunds for user + * + * @param string $id (required) + * + * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Yoast\MyYoastApiClient\Model\Refund[], HTTP status code, HTTP response headers (array of strings) + */ + public function customerRefundControllerFindRefundsWithHttpInfo($id) + { + $returnType = '\Yoast\MyYoastApiClient\Model\Refund[]'; + $request = $this->customerRefundControllerFindRefundsRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if (!in_array($returnType, ['string','integer','bool'])) { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Yoast\MyYoastApiClient\Model\Refund[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation customerRefundControllerFindRefundsAsync + * + * Find refunds for user + * + * @param string $id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function customerRefundControllerFindRefundsAsync($id) + { + return $this->customerRefundControllerFindRefundsAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation customerRefundControllerFindRefundsAsyncWithHttpInfo + * + * Find refunds for user + * + * @param string $id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function customerRefundControllerFindRefundsAsyncWithHttpInfo($id) + { + $returnType = '\Yoast\MyYoastApiClient\Model\Refund[]'; + $request = $this->customerRefundControllerFindRefundsRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + 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(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'customerRefundControllerFindRefunds' + * + * @param string $id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function customerRefundControllerFindRefundsRequest($id) + { + // 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 customerRefundControllerFindRefunds' + ); + } + + $resourcePath = '/api/Customers/{id}/findRefunds'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation customerRolesControllerAddRole + * + * @param \Yoast\MyYoastApiClient\Model\RoleIDDto $body body (required) + * @param string $id id (required) + * + * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Yoast\MyYoastApiClient\Model\Customer + */ + public function customerRolesControllerAddRole($body, $id) + { + list($response) = $this->customerRolesControllerAddRoleWithHttpInfo($body, $id); + return $response; + } + + /** + * Operation customerRolesControllerAddRoleWithHttpInfo + * + * @param \Yoast\MyYoastApiClient\Model\RoleIDDto $body (required) + * @param string $id (required) + * + * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Yoast\MyYoastApiClient\Model\Customer, HTTP status code, HTTP response headers (array of strings) + */ + public function customerRolesControllerAddRoleWithHttpInfo($body, $id) + { + $returnType = '\Yoast\MyYoastApiClient\Model\Customer'; + $request = $this->customerRolesControllerAddRoleRequest($body, $id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if (!in_array($returnType, ['string','integer','bool'])) { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Yoast\MyYoastApiClient\Model\Customer', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; } } /** - * Operation apiCustomersIdRoleMappingDeleteAsync + * Operation customerRolesControllerAddRoleAsync * * * - * @param \Yoast\MyYoastApiClient\Model\RoleIDDto $roleIDDto (required) + * @param \Yoast\MyYoastApiClient\Model\RoleIDDto $body (required) * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersIdRoleMappingDeleteAsync($roleIDDto, $id) + public function customerRolesControllerAddRoleAsync($body, $id) { - return $this->apiCustomersIdRoleMappingDeleteAsyncWithHttpInfo($roleIDDto, $id) + return $this->customerRolesControllerAddRoleAsyncWithHttpInfo($body, $id) ->then( function ($response) { return $response[0]; @@ -8804,26 +8996,40 @@ function ($response) { } /** - * Operation apiCustomersIdRoleMappingDeleteAsyncWithHttpInfo + * Operation customerRolesControllerAddRoleAsyncWithHttpInfo * * * - * @param \Yoast\MyYoastApiClient\Model\RoleIDDto $roleIDDto (required) + * @param \Yoast\MyYoastApiClient\Model\RoleIDDto $body (required) * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersIdRoleMappingDeleteAsyncWithHttpInfo($roleIDDto, $id) + public function customerRolesControllerAddRoleAsyncWithHttpInfo($body, $id) { - $returnType = ''; - $request = $this->apiCustomersIdRoleMappingDeleteRequest($roleIDDto, $id); + $returnType = '\Yoast\MyYoastApiClient\Model\Customer'; + $request = $this->customerRolesControllerAddRoleRequest($body, $id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -8843,26 +9049,26 @@ function ($exception) { } /** - * Create request for operation 'apiCustomersIdRoleMappingDelete' + * Create request for operation 'customerRolesControllerAddRole' * - * @param \Yoast\MyYoastApiClient\Model\RoleIDDto $roleIDDto (required) + * @param \Yoast\MyYoastApiClient\Model\RoleIDDto $body (required) * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCustomersIdRoleMappingDeleteRequest($roleIDDto, $id) + protected function customerRolesControllerAddRoleRequest($body, $id) { - // verify the required parameter 'roleIDDto' is set - if ($roleIDDto === null || (is_array($roleIDDto) && count($roleIDDto) === 0)) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $roleIDDto when calling apiCustomersIdRoleMappingDelete' + 'Missing the required parameter $body when calling customerRolesControllerAddRole' ); } // 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 apiCustomersIdRoleMappingDelete' + 'Missing the required parameter $id when calling customerRolesControllerAddRole' ); } @@ -8885,8 +9091,8 @@ protected function apiCustomersIdRoleMappingDeleteRequest($roleIDDto, $id) // body params $_tempBody = null; - if (isset($roleIDDto)) { - $_tempBody = $roleIDDto; + if (isset($body)) { + $_tempBody = $body; } if ($multipart) { @@ -8904,16 +9110,9 @@ protected function apiCustomersIdRoleMappingDeleteRequest($roleIDDto, $id) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -8936,11 +9135,10 @@ protected function apiCustomersIdRoleMappingDeleteRequest($roleIDDto, $id) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -8955,7 +9153,7 @@ protected function apiCustomersIdRoleMappingDeleteRequest($roleIDDto, $id) $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'DELETE', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -8963,34 +9161,35 @@ protected function apiCustomersIdRoleMappingDeleteRequest($roleIDDto, $id) } /** - * Operation apiCustomersIdRoleMappingPost + * Operation customerRolesControllerDeleteRole * - * @param \Yoast\MyYoastApiClient\Model\RoleIDDto $roleIDDto roleIDDto (required) + * @param \Yoast\MyYoastApiClient\Model\RoleIDDto $body body (required) * @param string $id id (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return \Yoast\MyYoastApiClient\Model\Customer */ - public function apiCustomersIdRoleMappingPost($roleIDDto, $id) + public function customerRolesControllerDeleteRole($body, $id) { - $this->apiCustomersIdRoleMappingPostWithHttpInfo($roleIDDto, $id); + list($response) = $this->customerRolesControllerDeleteRoleWithHttpInfo($body, $id); + return $response; } /** - * Operation apiCustomersIdRoleMappingPostWithHttpInfo + * Operation customerRolesControllerDeleteRoleWithHttpInfo * - * @param \Yoast\MyYoastApiClient\Model\RoleIDDto $roleIDDto (required) + * @param \Yoast\MyYoastApiClient\Model\RoleIDDto $body (required) * @param string $id (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of \Yoast\MyYoastApiClient\Model\Customer, HTTP status code, HTTP response headers (array of strings) */ - public function apiCustomersIdRoleMappingPostWithHttpInfo($roleIDDto, $id) + public function customerRolesControllerDeleteRoleWithHttpInfo($body, $id) { - $returnType = ''; - $request = $this->apiCustomersIdRoleMappingPostRequest($roleIDDto, $id); + $returnType = '\Yoast\MyYoastApiClient\Model\Customer'; + $request = $this->customerRolesControllerDeleteRoleRequest($body, $id); try { $options = $this->createHttpClientOption(); @@ -9020,29 +9219,51 @@ public function apiCustomersIdRoleMappingPostWithHttpInfo($roleIDDto, $id) ); } - return [null, $statusCode, $response->getHeaders()]; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if (!in_array($returnType, ['string','integer','bool'])) { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; } catch (ApiException $e) { switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Yoast\MyYoastApiClient\Model\Customer', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } } /** - * Operation apiCustomersIdRoleMappingPostAsync + * Operation customerRolesControllerDeleteRoleAsync * * * - * @param \Yoast\MyYoastApiClient\Model\RoleIDDto $roleIDDto (required) + * @param \Yoast\MyYoastApiClient\Model\RoleIDDto $body (required) * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersIdRoleMappingPostAsync($roleIDDto, $id) + public function customerRolesControllerDeleteRoleAsync($body, $id) { - return $this->apiCustomersIdRoleMappingPostAsyncWithHttpInfo($roleIDDto, $id) + return $this->customerRolesControllerDeleteRoleAsyncWithHttpInfo($body, $id) ->then( function ($response) { return $response[0]; @@ -9051,26 +9272,40 @@ function ($response) { } /** - * Operation apiCustomersIdRoleMappingPostAsyncWithHttpInfo + * Operation customerRolesControllerDeleteRoleAsyncWithHttpInfo * * * - * @param \Yoast\MyYoastApiClient\Model\RoleIDDto $roleIDDto (required) + * @param \Yoast\MyYoastApiClient\Model\RoleIDDto $body (required) * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersIdRoleMappingPostAsyncWithHttpInfo($roleIDDto, $id) + public function customerRolesControllerDeleteRoleAsyncWithHttpInfo($body, $id) { - $returnType = ''; - $request = $this->apiCustomersIdRoleMappingPostRequest($roleIDDto, $id); + $returnType = '\Yoast\MyYoastApiClient\Model\Customer'; + $request = $this->customerRolesControllerDeleteRoleRequest($body, $id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -9090,26 +9325,26 @@ function ($exception) { } /** - * Create request for operation 'apiCustomersIdRoleMappingPost' + * Create request for operation 'customerRolesControllerDeleteRole' * - * @param \Yoast\MyYoastApiClient\Model\RoleIDDto $roleIDDto (required) + * @param \Yoast\MyYoastApiClient\Model\RoleIDDto $body (required) * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCustomersIdRoleMappingPostRequest($roleIDDto, $id) + protected function customerRolesControllerDeleteRoleRequest($body, $id) { - // verify the required parameter 'roleIDDto' is set - if ($roleIDDto === null || (is_array($roleIDDto) && count($roleIDDto) === 0)) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $roleIDDto when calling apiCustomersIdRoleMappingPost' + 'Missing the required parameter $body when calling customerRolesControllerDeleteRole' ); } // 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 apiCustomersIdRoleMappingPost' + 'Missing the required parameter $id when calling customerRolesControllerDeleteRole' ); } @@ -9132,8 +9367,8 @@ protected function apiCustomersIdRoleMappingPostRequest($roleIDDto, $id) // body params $_tempBody = null; - if (isset($roleIDDto)) { - $_tempBody = $roleIDDto; + if (isset($body)) { + $_tempBody = $body; } if ($multipart) { @@ -9151,16 +9386,9 @@ protected function apiCustomersIdRoleMappingPostRequest($roleIDDto, $id) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -9183,11 +9411,10 @@ protected function apiCustomersIdRoleMappingPostRequest($roleIDDto, $id) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -9202,7 +9429,7 @@ protected function apiCustomersIdRoleMappingPostRequest($roleIDDto, $id) $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'POST', + 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -9210,32 +9437,33 @@ protected function apiCustomersIdRoleMappingPostRequest($roleIDDto, $id) } /** - * Operation apiCustomersIdRolesGet + * Operation customerRolesControllerGetMany * * @param string $id id (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return \Yoast\MyYoastApiClient\Model\Role[] */ - public function apiCustomersIdRolesGet($id) + public function customerRolesControllerGetMany($id) { - $this->apiCustomersIdRolesGetWithHttpInfo($id); + list($response) = $this->customerRolesControllerGetManyWithHttpInfo($id); + return $response; } /** - * Operation apiCustomersIdRolesGetWithHttpInfo + * Operation customerRolesControllerGetManyWithHttpInfo * * @param string $id (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of \Yoast\MyYoastApiClient\Model\Role[], HTTP status code, HTTP response headers (array of strings) */ - public function apiCustomersIdRolesGetWithHttpInfo($id) + public function customerRolesControllerGetManyWithHttpInfo($id) { - $returnType = ''; - $request = $this->apiCustomersIdRolesGetRequest($id); + $returnType = '\Yoast\MyYoastApiClient\Model\Role[]'; + $request = $this->customerRolesControllerGetManyRequest($id); try { $options = $this->createHttpClientOption(); @@ -9265,17 +9493,39 @@ public function apiCustomersIdRolesGetWithHttpInfo($id) ); } - return [null, $statusCode, $response->getHeaders()]; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if (!in_array($returnType, ['string','integer','bool'])) { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; } catch (ApiException $e) { switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Yoast\MyYoastApiClient\Model\Role[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } } /** - * Operation apiCustomersIdRolesGetAsync + * Operation customerRolesControllerGetManyAsync * * * @@ -9284,9 +9534,9 @@ public function apiCustomersIdRolesGetWithHttpInfo($id) * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersIdRolesGetAsync($id) + public function customerRolesControllerGetManyAsync($id) { - return $this->apiCustomersIdRolesGetAsyncWithHttpInfo($id) + return $this->customerRolesControllerGetManyAsyncWithHttpInfo($id) ->then( function ($response) { return $response[0]; @@ -9295,7 +9545,7 @@ function ($response) { } /** - * Operation apiCustomersIdRolesGetAsyncWithHttpInfo + * Operation customerRolesControllerGetManyAsyncWithHttpInfo * * * @@ -9304,16 +9554,30 @@ function ($response) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersIdRolesGetAsyncWithHttpInfo($id) + public function customerRolesControllerGetManyAsyncWithHttpInfo($id) { - $returnType = ''; - $request = $this->apiCustomersIdRolesGetRequest($id); + $returnType = '\Yoast\MyYoastApiClient\Model\Role[]'; + $request = $this->customerRolesControllerGetManyRequest($id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -9333,19 +9597,19 @@ function ($exception) { } /** - * Create request for operation 'apiCustomersIdRolesGet' + * Create request for operation 'customerRolesControllerGetMany' * * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCustomersIdRolesGetRequest($id) + protected function customerRolesControllerGetManyRequest($id) { // 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 apiCustomersIdRolesGet' + 'Missing the required parameter $id when calling customerRolesControllerGetMany' ); } @@ -9376,7 +9640,7 @@ protected function apiCustomersIdRolesGetRequest($id) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -9384,16 +9648,9 @@ protected function apiCustomersIdRolesGetRequest($id) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -9416,11 +9673,10 @@ protected function apiCustomersIdRolesGetRequest($id) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -9443,39 +9699,39 @@ protected function apiCustomersIdRolesGetRequest($id) } /** - * Operation apiCustomersNewsletterListSubscribePost + * Operation customerSiteControllerCreateSite * - * Subscribes a user to a newsletter + * Create a site for a user * - * @param \Yoast\MyYoastApiClient\Model\SubscribeByEmailBodyDto $subscribeByEmailBodyDto subscribeByEmailBodyDto (required) - * @param string $list list (required) + * @param \Yoast\MyYoastApiClient\Model\CreateSiteBodyDto $body body (required) + * @param string $customerId customerId (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return object + * @return \Yoast\MyYoastApiClient\Model\Site */ - public function apiCustomersNewsletterListSubscribePost($subscribeByEmailBodyDto, $list) + public function customerSiteControllerCreateSite($body, $customerId) { - list($response) = $this->apiCustomersNewsletterListSubscribePostWithHttpInfo($subscribeByEmailBodyDto, $list); + list($response) = $this->customerSiteControllerCreateSiteWithHttpInfo($body, $customerId); return $response; } /** - * Operation apiCustomersNewsletterListSubscribePostWithHttpInfo + * Operation customerSiteControllerCreateSiteWithHttpInfo * - * Subscribes a user to a newsletter + * Create a site for a user * - * @param \Yoast\MyYoastApiClient\Model\SubscribeByEmailBodyDto $subscribeByEmailBodyDto (required) - * @param string $list (required) + * @param \Yoast\MyYoastApiClient\Model\CreateSiteBodyDto $body (required) + * @param string $customerId (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of object, HTTP status code, HTTP response headers (array of strings) + * @return array of \Yoast\MyYoastApiClient\Model\Site, HTTP status code, HTTP response headers (array of strings) */ - public function apiCustomersNewsletterListSubscribePostWithHttpInfo($subscribeByEmailBodyDto, $list) + public function customerSiteControllerCreateSiteWithHttpInfo($body, $customerId) { - $returnType = 'object'; - $request = $this->apiCustomersNewsletterListSubscribePostRequest($subscribeByEmailBodyDto, $list); + $returnType = '\Yoast\MyYoastApiClient\Model\Site'; + $request = $this->customerSiteControllerCreateSiteRequest($body, $customerId); try { $options = $this->createHttpClientOption(); @@ -9510,7 +9766,7 @@ public function apiCustomersNewsletterListSubscribePostWithHttpInfo($subscribeBy $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -9526,7 +9782,7 @@ public function apiCustomersNewsletterListSubscribePostWithHttpInfo($subscribeBy case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - 'object', + '\Yoast\MyYoastApiClient\Model\Site', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -9537,19 +9793,19 @@ public function apiCustomersNewsletterListSubscribePostWithHttpInfo($subscribeBy } /** - * Operation apiCustomersNewsletterListSubscribePostAsync + * Operation customerSiteControllerCreateSiteAsync * - * Subscribes a user to a newsletter + * Create a site for a user * - * @param \Yoast\MyYoastApiClient\Model\SubscribeByEmailBodyDto $subscribeByEmailBodyDto (required) - * @param string $list (required) + * @param \Yoast\MyYoastApiClient\Model\CreateSiteBodyDto $body (required) + * @param string $customerId (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersNewsletterListSubscribePostAsync($subscribeByEmailBodyDto, $list) + public function customerSiteControllerCreateSiteAsync($body, $customerId) { - return $this->apiCustomersNewsletterListSubscribePostAsyncWithHttpInfo($subscribeByEmailBodyDto, $list) + return $this->customerSiteControllerCreateSiteAsyncWithHttpInfo($body, $customerId) ->then( function ($response) { return $response[0]; @@ -9558,20 +9814,20 @@ function ($response) { } /** - * Operation apiCustomersNewsletterListSubscribePostAsyncWithHttpInfo + * Operation customerSiteControllerCreateSiteAsyncWithHttpInfo * - * Subscribes a user to a newsletter + * Create a site for a user * - * @param \Yoast\MyYoastApiClient\Model\SubscribeByEmailBodyDto $subscribeByEmailBodyDto (required) - * @param string $list (required) + * @param \Yoast\MyYoastApiClient\Model\CreateSiteBodyDto $body (required) + * @param string $customerId (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersNewsletterListSubscribePostAsyncWithHttpInfo($subscribeByEmailBodyDto, $list) + public function customerSiteControllerCreateSiteAsyncWithHttpInfo($body, $customerId) { - $returnType = 'object'; - $request = $this->apiCustomersNewsletterListSubscribePostRequest($subscribeByEmailBodyDto, $list); + $returnType = '\Yoast\MyYoastApiClient\Model\Site'; + $request = $this->customerSiteControllerCreateSiteRequest($body, $customerId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -9611,30 +9867,30 @@ function ($exception) { } /** - * Create request for operation 'apiCustomersNewsletterListSubscribePost' + * Create request for operation 'customerSiteControllerCreateSite' * - * @param \Yoast\MyYoastApiClient\Model\SubscribeByEmailBodyDto $subscribeByEmailBodyDto (required) - * @param string $list (required) + * @param \Yoast\MyYoastApiClient\Model\CreateSiteBodyDto $body (required) + * @param string $customerId (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCustomersNewsletterListSubscribePostRequest($subscribeByEmailBodyDto, $list) + protected function customerSiteControllerCreateSiteRequest($body, $customerId) { - // verify the required parameter 'subscribeByEmailBodyDto' is set - if ($subscribeByEmailBodyDto === null || (is_array($subscribeByEmailBodyDto) && count($subscribeByEmailBodyDto) === 0)) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $subscribeByEmailBodyDto when calling apiCustomersNewsletterListSubscribePost' + 'Missing the required parameter $body when calling customerSiteControllerCreateSite' ); } - // verify the required parameter 'list' is set - if ($list === null || (is_array($list) && count($list) === 0)) { + // verify the required parameter 'customerId' is set + if ($customerId === null || (is_array($customerId) && count($customerId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $list when calling apiCustomersNewsletterListSubscribePost' + 'Missing the required parameter $customerId when calling customerSiteControllerCreateSite' ); } - $resourcePath = '/api/Customers/newsletter/{list}/subscribe'; + $resourcePath = '/api/Customers/{customerId}/sites'; $formParams = []; $queryParams = []; $headerParams = []; @@ -9643,18 +9899,18 @@ protected function apiCustomersNewsletterListSubscribePostRequest($subscribeByEm // path params - if ($list !== null) { + if ($customerId !== null) { $resourcePath = str_replace( - '{' . 'list' . '}', - ObjectSerializer::toPathValue($list), + '{' . 'customerId' . '}', + ObjectSerializer::toPathValue($customerId), $resourcePath ); } // body params $_tempBody = null; - if (isset($subscribeByEmailBodyDto)) { - $_tempBody = $subscribeByEmailBodyDto; + if (isset($body)) { + $_tempBody = $body; } if ($multipart) { @@ -9672,16 +9928,9 @@ protected function apiCustomersNewsletterListSubscribePostRequest($subscribeByEm if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -9704,6 +9953,10 @@ protected function apiCustomersNewsletterListSubscribePostRequest($subscribeByEm } } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -9726,35 +9979,39 @@ protected function apiCustomersNewsletterListSubscribePostRequest($subscribeByEm } /** - * Operation apiCustomersNonceGet + * Operation customerSiteControllerGetMany * - * Get a nonce from Yoast.com + * Get sites * + * @param string $customerId customerId (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return object + * @return \Yoast\MyYoastApiClient\Model\Site[] */ - public function apiCustomersNonceGet() + public function customerSiteControllerGetMany($customerId, $filter = null) { - list($response) = $this->apiCustomersNonceGetWithHttpInfo(); + list($response) = $this->customerSiteControllerGetManyWithHttpInfo($customerId, $filter); return $response; } /** - * Operation apiCustomersNonceGetWithHttpInfo + * Operation customerSiteControllerGetManyWithHttpInfo * - * Get a nonce from Yoast.com + * Get sites * + * @param string $customerId (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of object, HTTP status code, HTTP response headers (array of strings) + * @return array of \Yoast\MyYoastApiClient\Model\Site[], HTTP status code, HTTP response headers (array of strings) */ - public function apiCustomersNonceGetWithHttpInfo() + public function customerSiteControllerGetManyWithHttpInfo($customerId, $filter = null) { - $returnType = 'object'; - $request = $this->apiCustomersNonceGetRequest(); + $returnType = '\Yoast\MyYoastApiClient\Model\Site[]'; + $request = $this->customerSiteControllerGetManyRequest($customerId, $filter); try { $options = $this->createHttpClientOption(); @@ -9789,7 +10046,7 @@ public function apiCustomersNonceGetWithHttpInfo() $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -9805,7 +10062,7 @@ public function apiCustomersNonceGetWithHttpInfo() case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - 'object', + '\Yoast\MyYoastApiClient\Model\Site[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -9816,17 +10073,19 @@ public function apiCustomersNonceGetWithHttpInfo() } /** - * Operation apiCustomersNonceGetAsync + * Operation customerSiteControllerGetManyAsync * - * Get a nonce from Yoast.com + * Get sites * + * @param string $customerId (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersNonceGetAsync() + public function customerSiteControllerGetManyAsync($customerId, $filter = null) { - return $this->apiCustomersNonceGetAsyncWithHttpInfo() + return $this->customerSiteControllerGetManyAsyncWithHttpInfo($customerId, $filter) ->then( function ($response) { return $response[0]; @@ -9835,18 +10094,20 @@ function ($response) { } /** - * Operation apiCustomersNonceGetAsyncWithHttpInfo + * Operation customerSiteControllerGetManyAsyncWithHttpInfo * - * Get a nonce from Yoast.com + * Get sites * + * @param string $customerId (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersNonceGetAsyncWithHttpInfo() + public function customerSiteControllerGetManyAsyncWithHttpInfo($customerId, $filter = null) { - $returnType = 'object'; - $request = $this->apiCustomersNonceGetRequest(); + $returnType = '\Yoast\MyYoastApiClient\Model\Site[]'; + $request = $this->customerSiteControllerGetManyRequest($customerId, $filter); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -9886,23 +10147,43 @@ function ($exception) { } /** - * Create request for operation 'apiCustomersNonceGet' + * Create request for operation 'customerSiteControllerGetMany' * + * @param string $customerId (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCustomersNonceGetRequest() + protected function customerSiteControllerGetManyRequest($customerId, $filter = null) { + // verify the required parameter 'customerId' is set + if ($customerId === null || (is_array($customerId) && count($customerId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $customerId when calling customerSiteControllerGetMany' + ); + } - $resourcePath = '/api/Customers/nonce'; + $resourcePath = '/api/Customers/{customerId}/sites'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + if ($filter !== null) { + $queryParams['filter'] = ObjectSerializer::toQueryValue($filter, null); + } + // path params + if ($customerId !== null) { + $resourcePath = str_replace( + '{' . 'customerId' . '}', + ObjectSerializer::toPathValue($customerId), + $resourcePath + ); + } // body params $_tempBody = null; @@ -9914,7 +10195,7 @@ protected function apiCustomersNonceGetRequest() } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -9922,16 +10203,9 @@ protected function apiCustomersNonceGetRequest() if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -9954,6 +10228,10 @@ protected function apiCustomersNonceGetRequest() } } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -9976,37 +10254,41 @@ protected function apiCustomersNonceGetRequest() } /** - * Operation apiCustomersResetPasswordPatch + * Operation customerSiteControllerGetOne * - * Reset the user's password. + * Get a site * - * @param \Yoast\MyYoastApiClient\Model\ResetPasswordDto $resetPasswordDto resetPasswordDto (required) + * @param string $customerId customerId (required) + * @param string $id id (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return object + * @return \Yoast\MyYoastApiClient\Model\Site */ - public function apiCustomersResetPasswordPatch($resetPasswordDto) + public function customerSiteControllerGetOne($customerId, $id, $filter = null) { - list($response) = $this->apiCustomersResetPasswordPatchWithHttpInfo($resetPasswordDto); + list($response) = $this->customerSiteControllerGetOneWithHttpInfo($customerId, $id, $filter); return $response; } /** - * Operation apiCustomersResetPasswordPatchWithHttpInfo + * Operation customerSiteControllerGetOneWithHttpInfo * - * Reset the user's password. + * Get a site * - * @param \Yoast\MyYoastApiClient\Model\ResetPasswordDto $resetPasswordDto (required) + * @param string $customerId (required) + * @param string $id (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of object, HTTP status code, HTTP response headers (array of strings) + * @return array of \Yoast\MyYoastApiClient\Model\Site, HTTP status code, HTTP response headers (array of strings) */ - public function apiCustomersResetPasswordPatchWithHttpInfo($resetPasswordDto) + public function customerSiteControllerGetOneWithHttpInfo($customerId, $id, $filter = null) { - $returnType = 'object'; - $request = $this->apiCustomersResetPasswordPatchRequest($resetPasswordDto); + $returnType = '\Yoast\MyYoastApiClient\Model\Site'; + $request = $this->customerSiteControllerGetOneRequest($customerId, $id, $filter); try { $options = $this->createHttpClientOption(); @@ -10041,7 +10323,7 @@ public function apiCustomersResetPasswordPatchWithHttpInfo($resetPasswordDto) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -10057,7 +10339,7 @@ public function apiCustomersResetPasswordPatchWithHttpInfo($resetPasswordDto) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - 'object', + '\Yoast\MyYoastApiClient\Model\Site', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -10068,18 +10350,20 @@ public function apiCustomersResetPasswordPatchWithHttpInfo($resetPasswordDto) } /** - * Operation apiCustomersResetPasswordPatchAsync + * Operation customerSiteControllerGetOneAsync * - * Reset the user's password. + * Get a site * - * @param \Yoast\MyYoastApiClient\Model\ResetPasswordDto $resetPasswordDto (required) + * @param string $customerId (required) + * @param string $id (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersResetPasswordPatchAsync($resetPasswordDto) + public function customerSiteControllerGetOneAsync($customerId, $id, $filter = null) { - return $this->apiCustomersResetPasswordPatchAsyncWithHttpInfo($resetPasswordDto) + return $this->customerSiteControllerGetOneAsyncWithHttpInfo($customerId, $id, $filter) ->then( function ($response) { return $response[0]; @@ -10088,19 +10372,21 @@ function ($response) { } /** - * Operation apiCustomersResetPasswordPatchAsyncWithHttpInfo + * Operation customerSiteControllerGetOneAsyncWithHttpInfo * - * Reset the user's password. + * Get a site * - * @param \Yoast\MyYoastApiClient\Model\ResetPasswordDto $resetPasswordDto (required) + * @param string $customerId (required) + * @param string $id (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersResetPasswordPatchAsyncWithHttpInfo($resetPasswordDto) + public function customerSiteControllerGetOneAsyncWithHttpInfo($customerId, $id, $filter = null) { - $returnType = 'object'; - $request = $this->apiCustomersResetPasswordPatchRequest($resetPasswordDto); + $returnType = '\Yoast\MyYoastApiClient\Model\Site'; + $request = $this->customerSiteControllerGetOneRequest($customerId, $id, $filter); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -10140,36 +10426,61 @@ function ($exception) { } /** - * Create request for operation 'apiCustomersResetPasswordPatch' + * Create request for operation 'customerSiteControllerGetOne' * - * @param \Yoast\MyYoastApiClient\Model\ResetPasswordDto $resetPasswordDto (required) + * @param string $customerId (required) + * @param string $id (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCustomersResetPasswordPatchRequest($resetPasswordDto) + protected function customerSiteControllerGetOneRequest($customerId, $id, $filter = null) { - // verify the required parameter 'resetPasswordDto' is set - if ($resetPasswordDto === null || (is_array($resetPasswordDto) && count($resetPasswordDto) === 0)) { + // verify the required parameter 'customerId' is set + if ($customerId === null || (is_array($customerId) && count($customerId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $customerId when calling customerSiteControllerGetOne' + ); + } + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $resetPasswordDto when calling apiCustomersResetPasswordPatch' + 'Missing the required parameter $id when calling customerSiteControllerGetOne' ); } - $resourcePath = '/api/Customers/resetPassword'; + $resourcePath = '/api/Customers/{customerId}/sites/{id}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + if ($filter !== null) { + $queryParams['filter'] = ObjectSerializer::toQueryValue($filter, null); + } + // path params + if ($customerId !== null) { + $resourcePath = str_replace( + '{' . 'customerId' . '}', + ObjectSerializer::toPathValue($customerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } // body params $_tempBody = null; - if (isset($resetPasswordDto)) { - $_tempBody = $resetPasswordDto; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -10178,7 +10489,7 @@ protected function apiCustomersResetPasswordPatchRequest($resetPasswordDto) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -10186,16 +10497,9 @@ protected function apiCustomersResetPasswordPatchRequest($resetPasswordDto) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -10218,6 +10522,10 @@ protected function apiCustomersResetPasswordPatchRequest($resetPasswordDto) } } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -10232,7 +10540,7 @@ protected function apiCustomersResetPasswordPatchRequest($resetPasswordDto) $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'PATCH', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -10240,35 +10548,41 @@ protected function apiCustomersResetPasswordPatchRequest($resetPasswordDto) } /** - * Operation apiCustomersRolemappingIdsGet + * Operation customerSubscriptionControllerCancelSubscription * - * Get the ids of all customers with at least one role. + * Cancel (part of) a subscription. * + * @param \Yoast\MyYoastApiClient\Model\CancelSubscriptionBodyDto $body body (required) + * @param string $customerId customerId (required) + * @param string $id id (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return string[] + * @return object */ - public function apiCustomersRolemappingIdsGet() + public function customerSubscriptionControllerCancelSubscription($body, $customerId, $id) { - list($response) = $this->apiCustomersRolemappingIdsGetWithHttpInfo(); + list($response) = $this->customerSubscriptionControllerCancelSubscriptionWithHttpInfo($body, $customerId, $id); return $response; } /** - * Operation apiCustomersRolemappingIdsGetWithHttpInfo + * Operation customerSubscriptionControllerCancelSubscriptionWithHttpInfo * - * Get the ids of all customers with at least one role. + * Cancel (part of) a subscription. * + * @param \Yoast\MyYoastApiClient\Model\CancelSubscriptionBodyDto $body (required) + * @param string $customerId (required) + * @param string $id (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of string[], HTTP status code, HTTP response headers (array of strings) + * @return array of object, HTTP status code, HTTP response headers (array of strings) */ - public function apiCustomersRolemappingIdsGetWithHttpInfo() + public function customerSubscriptionControllerCancelSubscriptionWithHttpInfo($body, $customerId, $id) { - $returnType = 'string[]'; - $request = $this->apiCustomersRolemappingIdsGetRequest(); + $returnType = 'object'; + $request = $this->customerSubscriptionControllerCancelSubscriptionRequest($body, $customerId, $id); try { $options = $this->createHttpClientOption(); @@ -10303,7 +10617,7 @@ public function apiCustomersRolemappingIdsGetWithHttpInfo() $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -10319,7 +10633,7 @@ public function apiCustomersRolemappingIdsGetWithHttpInfo() case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - 'string[]', + 'object', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -10330,17 +10644,20 @@ public function apiCustomersRolemappingIdsGetWithHttpInfo() } /** - * Operation apiCustomersRolemappingIdsGetAsync + * Operation customerSubscriptionControllerCancelSubscriptionAsync * - * Get the ids of all customers with at least one role. + * Cancel (part of) a subscription. * + * @param \Yoast\MyYoastApiClient\Model\CancelSubscriptionBodyDto $body (required) + * @param string $customerId (required) + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersRolemappingIdsGetAsync() + public function customerSubscriptionControllerCancelSubscriptionAsync($body, $customerId, $id) { - return $this->apiCustomersRolemappingIdsGetAsyncWithHttpInfo() + return $this->customerSubscriptionControllerCancelSubscriptionAsyncWithHttpInfo($body, $customerId, $id) ->then( function ($response) { return $response[0]; @@ -10349,18 +10666,21 @@ function ($response) { } /** - * Operation apiCustomersRolemappingIdsGetAsyncWithHttpInfo + * Operation customerSubscriptionControllerCancelSubscriptionAsyncWithHttpInfo * - * Get the ids of all customers with at least one role. + * Cancel (part of) a subscription. * + * @param \Yoast\MyYoastApiClient\Model\CancelSubscriptionBodyDto $body (required) + * @param string $customerId (required) + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersRolemappingIdsGetAsyncWithHttpInfo() + public function customerSubscriptionControllerCancelSubscriptionAsyncWithHttpInfo($body, $customerId, $id) { - $returnType = 'string[]'; - $request = $this->apiCustomersRolemappingIdsGetRequest(); + $returnType = 'object'; + $request = $this->customerSubscriptionControllerCancelSubscriptionRequest($body, $customerId, $id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -10400,16 +10720,37 @@ function ($exception) { } /** - * Create request for operation 'apiCustomersRolemappingIdsGet' + * Create request for operation 'customerSubscriptionControllerCancelSubscription' * + * @param \Yoast\MyYoastApiClient\Model\CancelSubscriptionBodyDto $body (required) + * @param string $customerId (required) + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCustomersRolemappingIdsGetRequest() + protected function customerSubscriptionControllerCancelSubscriptionRequest($body, $customerId, $id) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling customerSubscriptionControllerCancelSubscription' + ); + } + // verify the required parameter 'customerId' is set + if ($customerId === null || (is_array($customerId) && count($customerId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $customerId when calling customerSubscriptionControllerCancelSubscription' + ); + } + // 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 customerSubscriptionControllerCancelSubscription' + ); + } - $resourcePath = '/api/Customers/rolemapping-ids'; + $resourcePath = '/api/Customers/{customerId}/subscriptions/{id}/cancel'; $formParams = []; $queryParams = []; $headerParams = []; @@ -10417,9 +10758,28 @@ protected function apiCustomersRolemappingIdsGetRequest() $multipart = false; + // path params + if ($customerId !== null) { + $resourcePath = str_replace( + '{' . 'customerId' . '}', + ObjectSerializer::toPathValue($customerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } // body params $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -10436,16 +10796,9 @@ protected function apiCustomersRolemappingIdsGetRequest() if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -10468,11 +10821,10 @@ protected function apiCustomersRolemappingIdsGetRequest() } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -10487,7 +10839,7 @@ protected function apiCustomersRolemappingIdsGetRequest() $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'GET', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -10495,37 +10847,39 @@ protected function apiCustomersRolemappingIdsGetRequest() } /** - * Operation apiCustomersSendResetPasswordEmailPost + * Operation customerSubscriptionControllerGetMany * - * Send a reset password email to the user. + * Get subscriptions * - * @param \Yoast\MyYoastApiClient\Model\SendResetPasswordEmailDto $sendResetPasswordEmailDto sendResetPasswordEmailDto (required) + * @param string $customerId customerId (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return object + * @return \Yoast\MyYoastApiClient\Model\Subscription[] */ - public function apiCustomersSendResetPasswordEmailPost($sendResetPasswordEmailDto) + public function customerSubscriptionControllerGetMany($customerId, $filter = null) { - list($response) = $this->apiCustomersSendResetPasswordEmailPostWithHttpInfo($sendResetPasswordEmailDto); + list($response) = $this->customerSubscriptionControllerGetManyWithHttpInfo($customerId, $filter); return $response; } /** - * Operation apiCustomersSendResetPasswordEmailPostWithHttpInfo + * Operation customerSubscriptionControllerGetManyWithHttpInfo * - * Send a reset password email to the user. + * Get subscriptions * - * @param \Yoast\MyYoastApiClient\Model\SendResetPasswordEmailDto $sendResetPasswordEmailDto (required) + * @param string $customerId (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of object, HTTP status code, HTTP response headers (array of strings) + * @return array of \Yoast\MyYoastApiClient\Model\Subscription[], HTTP status code, HTTP response headers (array of strings) */ - public function apiCustomersSendResetPasswordEmailPostWithHttpInfo($sendResetPasswordEmailDto) + public function customerSubscriptionControllerGetManyWithHttpInfo($customerId, $filter = null) { - $returnType = 'object'; - $request = $this->apiCustomersSendResetPasswordEmailPostRequest($sendResetPasswordEmailDto); + $returnType = '\Yoast\MyYoastApiClient\Model\Subscription[]'; + $request = $this->customerSubscriptionControllerGetManyRequest($customerId, $filter); try { $options = $this->createHttpClientOption(); @@ -10560,7 +10914,7 @@ public function apiCustomersSendResetPasswordEmailPostWithHttpInfo($sendResetPas $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -10576,7 +10930,7 @@ public function apiCustomersSendResetPasswordEmailPostWithHttpInfo($sendResetPas case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - 'object', + '\Yoast\MyYoastApiClient\Model\Subscription[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -10587,18 +10941,19 @@ public function apiCustomersSendResetPasswordEmailPostWithHttpInfo($sendResetPas } /** - * Operation apiCustomersSendResetPasswordEmailPostAsync + * Operation customerSubscriptionControllerGetManyAsync * - * Send a reset password email to the user. + * Get subscriptions * - * @param \Yoast\MyYoastApiClient\Model\SendResetPasswordEmailDto $sendResetPasswordEmailDto (required) + * @param string $customerId (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersSendResetPasswordEmailPostAsync($sendResetPasswordEmailDto) + public function customerSubscriptionControllerGetManyAsync($customerId, $filter = null) { - return $this->apiCustomersSendResetPasswordEmailPostAsyncWithHttpInfo($sendResetPasswordEmailDto) + return $this->customerSubscriptionControllerGetManyAsyncWithHttpInfo($customerId, $filter) ->then( function ($response) { return $response[0]; @@ -10607,19 +10962,20 @@ function ($response) { } /** - * Operation apiCustomersSendResetPasswordEmailPostAsyncWithHttpInfo + * Operation customerSubscriptionControllerGetManyAsyncWithHttpInfo * - * Send a reset password email to the user. + * Get subscriptions * - * @param \Yoast\MyYoastApiClient\Model\SendResetPasswordEmailDto $sendResetPasswordEmailDto (required) + * @param string $customerId (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersSendResetPasswordEmailPostAsyncWithHttpInfo($sendResetPasswordEmailDto) + public function customerSubscriptionControllerGetManyAsyncWithHttpInfo($customerId, $filter = null) { - $returnType = 'object'; - $request = $this->apiCustomersSendResetPasswordEmailPostRequest($sendResetPasswordEmailDto); + $returnType = '\Yoast\MyYoastApiClient\Model\Subscription[]'; + $request = $this->customerSubscriptionControllerGetManyRequest($customerId, $filter); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -10659,36 +11015,46 @@ function ($exception) { } /** - * Create request for operation 'apiCustomersSendResetPasswordEmailPost' + * Create request for operation 'customerSubscriptionControllerGetMany' * - * @param \Yoast\MyYoastApiClient\Model\SendResetPasswordEmailDto $sendResetPasswordEmailDto (required) + * @param string $customerId (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCustomersSendResetPasswordEmailPostRequest($sendResetPasswordEmailDto) + protected function customerSubscriptionControllerGetManyRequest($customerId, $filter = null) { - // verify the required parameter 'sendResetPasswordEmailDto' is set - if ($sendResetPasswordEmailDto === null || (is_array($sendResetPasswordEmailDto) && count($sendResetPasswordEmailDto) === 0)) { + // verify the required parameter 'customerId' is set + if ($customerId === null || (is_array($customerId) && count($customerId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $sendResetPasswordEmailDto when calling apiCustomersSendResetPasswordEmailPost' + 'Missing the required parameter $customerId when calling customerSubscriptionControllerGetMany' ); } - $resourcePath = '/api/Customers/sendResetPasswordEmail'; + $resourcePath = '/api/Customers/{customerId}/subscriptions'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + if ($filter !== null) { + $queryParams['filter'] = ObjectSerializer::toQueryValue($filter, null); + } + // path params + if ($customerId !== null) { + $resourcePath = str_replace( + '{' . 'customerId' . '}', + ObjectSerializer::toPathValue($customerId), + $resourcePath + ); + } // body params $_tempBody = null; - if (isset($sendResetPasswordEmailDto)) { - $_tempBody = $sendResetPasswordEmailDto; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -10697,7 +11063,7 @@ protected function apiCustomersSendResetPasswordEmailPostRequest($sendResetPassw } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -10705,16 +11071,9 @@ protected function apiCustomersSendResetPasswordEmailPostRequest($sendResetPassw if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -10737,6 +11096,10 @@ protected function apiCustomersSendResetPasswordEmailPostRequest($sendResetPassw } } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -10751,7 +11114,7 @@ protected function apiCustomersSendResetPasswordEmailPostRequest($sendResetPassw $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -10759,37 +11122,41 @@ protected function apiCustomersSendResetPasswordEmailPostRequest($sendResetPassw } /** - * Operation apiCustomersSignupPost + * Operation customerSubscriptionControllerGetOne * - * Signup a customer on yoast.com. + * Get a subscriptions * - * @param \Yoast\MyYoastApiClient\Model\SignupAccountDto $signupAccountDto signupAccountDto (required) + * @param string $customerId customerId (required) + * @param string $id id (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return object + * @return \Yoast\MyYoastApiClient\Model\Subscription */ - public function apiCustomersSignupPost($signupAccountDto) + public function customerSubscriptionControllerGetOne($customerId, $id, $filter = null) { - list($response) = $this->apiCustomersSignupPostWithHttpInfo($signupAccountDto); + list($response) = $this->customerSubscriptionControllerGetOneWithHttpInfo($customerId, $id, $filter); return $response; } /** - * Operation apiCustomersSignupPostWithHttpInfo + * Operation customerSubscriptionControllerGetOneWithHttpInfo * - * Signup a customer on yoast.com. + * Get a subscriptions * - * @param \Yoast\MyYoastApiClient\Model\SignupAccountDto $signupAccountDto (required) + * @param string $customerId (required) + * @param string $id (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of object, HTTP status code, HTTP response headers (array of strings) + * @return array of \Yoast\MyYoastApiClient\Model\Subscription, HTTP status code, HTTP response headers (array of strings) */ - public function apiCustomersSignupPostWithHttpInfo($signupAccountDto) + public function customerSubscriptionControllerGetOneWithHttpInfo($customerId, $id, $filter = null) { - $returnType = 'object'; - $request = $this->apiCustomersSignupPostRequest($signupAccountDto); + $returnType = '\Yoast\MyYoastApiClient\Model\Subscription'; + $request = $this->customerSubscriptionControllerGetOneRequest($customerId, $id, $filter); try { $options = $this->createHttpClientOption(); @@ -10824,7 +11191,7 @@ public function apiCustomersSignupPostWithHttpInfo($signupAccountDto) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -10840,7 +11207,7 @@ public function apiCustomersSignupPostWithHttpInfo($signupAccountDto) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - 'object', + '\Yoast\MyYoastApiClient\Model\Subscription', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -10851,18 +11218,20 @@ public function apiCustomersSignupPostWithHttpInfo($signupAccountDto) } /** - * Operation apiCustomersSignupPostAsync + * Operation customerSubscriptionControllerGetOneAsync * - * Signup a customer on yoast.com. + * Get a subscriptions * - * @param \Yoast\MyYoastApiClient\Model\SignupAccountDto $signupAccountDto (required) + * @param string $customerId (required) + * @param string $id (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersSignupPostAsync($signupAccountDto) + public function customerSubscriptionControllerGetOneAsync($customerId, $id, $filter = null) { - return $this->apiCustomersSignupPostAsyncWithHttpInfo($signupAccountDto) + return $this->customerSubscriptionControllerGetOneAsyncWithHttpInfo($customerId, $id, $filter) ->then( function ($response) { return $response[0]; @@ -10871,19 +11240,21 @@ function ($response) { } /** - * Operation apiCustomersSignupPostAsyncWithHttpInfo + * Operation customerSubscriptionControllerGetOneAsyncWithHttpInfo * - * Signup a customer on yoast.com. + * Get a subscriptions * - * @param \Yoast\MyYoastApiClient\Model\SignupAccountDto $signupAccountDto (required) + * @param string $customerId (required) + * @param string $id (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersSignupPostAsyncWithHttpInfo($signupAccountDto) + public function customerSubscriptionControllerGetOneAsyncWithHttpInfo($customerId, $id, $filter = null) { - $returnType = 'object'; - $request = $this->apiCustomersSignupPostRequest($signupAccountDto); + $returnType = '\Yoast\MyYoastApiClient\Model\Subscription'; + $request = $this->customerSubscriptionControllerGetOneRequest($customerId, $id, $filter); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -10923,36 +11294,61 @@ function ($exception) { } /** - * Create request for operation 'apiCustomersSignupPost' + * Create request for operation 'customerSubscriptionControllerGetOne' * - * @param \Yoast\MyYoastApiClient\Model\SignupAccountDto $signupAccountDto (required) + * @param string $customerId (required) + * @param string $id (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCustomersSignupPostRequest($signupAccountDto) + protected function customerSubscriptionControllerGetOneRequest($customerId, $id, $filter = null) { - // verify the required parameter 'signupAccountDto' is set - if ($signupAccountDto === null || (is_array($signupAccountDto) && count($signupAccountDto) === 0)) { + // verify the required parameter 'customerId' is set + if ($customerId === null || (is_array($customerId) && count($customerId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $customerId when calling customerSubscriptionControllerGetOne' + ); + } + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $signupAccountDto when calling apiCustomersSignupPost' + 'Missing the required parameter $id when calling customerSubscriptionControllerGetOne' ); } - $resourcePath = '/api/Customers/signup'; + $resourcePath = '/api/Customers/{customerId}/subscriptions/{id}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + if ($filter !== null) { + $queryParams['filter'] = ObjectSerializer::toQueryValue($filter, null); + } + // path params + if ($customerId !== null) { + $resourcePath = str_replace( + '{' . 'customerId' . '}', + ObjectSerializer::toPathValue($customerId), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } // body params $_tempBody = null; - if (isset($signupAccountDto)) { - $_tempBody = $signupAccountDto; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -10961,7 +11357,7 @@ protected function apiCustomersSignupPostRequest($signupAccountDto) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -10969,16 +11365,9 @@ protected function apiCustomersSignupPostRequest($signupAccountDto) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -11001,6 +11390,10 @@ protected function apiCustomersSignupPostRequest($signupAccountDto) } } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -11015,7 +11408,7 @@ protected function apiCustomersSignupPostRequest($signupAccountDto) $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody diff --git a/src/Api/CustomerNoteApi.php b/src/Api/CustomerNoteApi.php index 422731b..e897180 100644 --- a/src/Api/CustomerNoteApi.php +++ b/src/Api/CustomerNoteApi.php @@ -17,9 +17,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -88,37 +87,32 @@ public function getConfig() } /** - * Operation apiCustomerNotesGet - * - * Get customer notes + * Operation customerNoteControllerCreateOne * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param \Yoast\MyYoastApiClient\Model\CreateCustomerNoteDto $body body (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\CustomerNote[] + * @return void */ - public function apiCustomerNotesGet($filter = null) + public function customerNoteControllerCreateOne($body) { - list($response) = $this->apiCustomerNotesGetWithHttpInfo($filter); - return $response; + $this->customerNoteControllerCreateOneWithHttpInfo($body); } /** - * Operation apiCustomerNotesGetWithHttpInfo + * Operation customerNoteControllerCreateOneWithHttpInfo * - * Get customer notes - * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param \Yoast\MyYoastApiClient\Model\CreateCustomerNoteDto $body (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Yoast\MyYoastApiClient\Model\CustomerNote[], HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function apiCustomerNotesGetWithHttpInfo($filter = null) + public function customerNoteControllerCreateOneWithHttpInfo($body) { - $returnType = '\Yoast\MyYoastApiClient\Model\CustomerNote[]'; - $request = $this->apiCustomerNotesGetRequest($filter); + $returnType = ''; + $request = $this->customerNoteControllerCreateOneRequest($body); try { $options = $this->createHttpClientOption(); @@ -148,50 +142,28 @@ public function apiCustomerNotesGetWithHttpInfo($filter = null) ); } - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Yoast\MyYoastApiClient\Model\CustomerNote[]', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; } throw $e; } } /** - * Operation apiCustomerNotesGetAsync + * Operation customerNoteControllerCreateOneAsync * - * Get customer notes + * * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param \Yoast\MyYoastApiClient\Model\CreateCustomerNoteDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomerNotesGetAsync($filter = null) + public function customerNoteControllerCreateOneAsync($body) { - return $this->apiCustomerNotesGetAsyncWithHttpInfo($filter) + return $this->customerNoteControllerCreateOneAsyncWithHttpInfo($body) ->then( function ($response) { return $response[0]; @@ -200,39 +172,25 @@ function ($response) { } /** - * Operation apiCustomerNotesGetAsyncWithHttpInfo + * Operation customerNoteControllerCreateOneAsyncWithHttpInfo * - * Get customer notes + * * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param \Yoast\MyYoastApiClient\Model\CreateCustomerNoteDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomerNotesGetAsyncWithHttpInfo($filter = null) + public function customerNoteControllerCreateOneAsyncWithHttpInfo($body) { - $returnType = '\Yoast\MyYoastApiClient\Model\CustomerNote[]'; - $request = $this->apiCustomerNotesGetRequest($filter); + $returnType = ''; + $request = $this->customerNoteControllerCreateOneRequest($body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -252,15 +210,21 @@ function ($exception) { } /** - * Create request for operation 'apiCustomerNotesGet' + * Create request for operation 'customerNoteControllerCreateOne' * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param \Yoast\MyYoastApiClient\Model\CreateCustomerNoteDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCustomerNotesGetRequest($filter = null) + protected function customerNoteControllerCreateOneRequest($body) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling customerNoteControllerCreateOne' + ); + } $resourcePath = '/api/CustomerNotes'; $formParams = []; @@ -269,22 +233,21 @@ protected function apiCustomerNotesGetRequest($filter = null) $httpBody = ''; $multipart = false; - // query params - if ($filter !== null) { - $queryParams['filter'] = ObjectSerializer::toQueryValue($filter); - } // body params $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + [] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + [], ['application/json'] ); } @@ -293,16 +256,9 @@ protected function apiCustomerNotesGetRequest($filter = null) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -325,11 +281,10 @@ protected function apiCustomerNotesGetRequest($filter = null) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -344,7 +299,7 @@ protected function apiCustomerNotesGetRequest($filter = null) $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'GET', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -352,7 +307,7 @@ protected function apiCustomerNotesGetRequest($filter = null) } /** - * Operation apiCustomerNotesIdDelete + * Operation customerNoteControllerDeleteOne * * @param string $id id (required) * @@ -360,13 +315,13 @@ protected function apiCustomerNotesGetRequest($filter = null) * @throws \InvalidArgumentException * @return void */ - public function apiCustomerNotesIdDelete($id) + public function customerNoteControllerDeleteOne($id) { - $this->apiCustomerNotesIdDeleteWithHttpInfo($id); + $this->customerNoteControllerDeleteOneWithHttpInfo($id); } /** - * Operation apiCustomerNotesIdDeleteWithHttpInfo + * Operation customerNoteControllerDeleteOneWithHttpInfo * * @param string $id (required) * @@ -374,10 +329,10 @@ public function apiCustomerNotesIdDelete($id) * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function apiCustomerNotesIdDeleteWithHttpInfo($id) + public function customerNoteControllerDeleteOneWithHttpInfo($id) { $returnType = ''; - $request = $this->apiCustomerNotesIdDeleteRequest($id); + $request = $this->customerNoteControllerDeleteOneRequest($id); try { $options = $this->createHttpClientOption(); @@ -417,7 +372,7 @@ public function apiCustomerNotesIdDeleteWithHttpInfo($id) } /** - * Operation apiCustomerNotesIdDeleteAsync + * Operation customerNoteControllerDeleteOneAsync * * * @@ -426,9 +381,9 @@ public function apiCustomerNotesIdDeleteWithHttpInfo($id) * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomerNotesIdDeleteAsync($id) + public function customerNoteControllerDeleteOneAsync($id) { - return $this->apiCustomerNotesIdDeleteAsyncWithHttpInfo($id) + return $this->customerNoteControllerDeleteOneAsyncWithHttpInfo($id) ->then( function ($response) { return $response[0]; @@ -437,7 +392,7 @@ function ($response) { } /** - * Operation apiCustomerNotesIdDeleteAsyncWithHttpInfo + * Operation customerNoteControllerDeleteOneAsyncWithHttpInfo * * * @@ -446,10 +401,10 @@ function ($response) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomerNotesIdDeleteAsyncWithHttpInfo($id) + public function customerNoteControllerDeleteOneAsyncWithHttpInfo($id) { $returnType = ''; - $request = $this->apiCustomerNotesIdDeleteRequest($id); + $request = $this->customerNoteControllerDeleteOneRequest($id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -475,19 +430,19 @@ function ($exception) { } /** - * Create request for operation 'apiCustomerNotesIdDelete' + * Create request for operation 'customerNoteControllerDeleteOne' * * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCustomerNotesIdDeleteRequest($id) + protected function customerNoteControllerDeleteOneRequest($id) { // 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 apiCustomerNotesIdDelete' + 'Missing the required parameter $id when calling customerNoteControllerDeleteOne' ); } @@ -513,12 +468,12 @@ protected function apiCustomerNotesIdDeleteRequest($id) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + [] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + [], + [] ); } @@ -526,16 +481,9 @@ protected function apiCustomerNotesIdDeleteRequest($id) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -558,11 +506,10 @@ protected function apiCustomerNotesIdDeleteRequest($id) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -585,39 +532,37 @@ protected function apiCustomerNotesIdDeleteRequest($id) } /** - * Operation apiCustomerNotesIdGet + * Operation customerNoteControllerGetMany * - * Get a customer note + * Get customer notes * - * @param string $id id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\CustomerNote + * @return \Yoast\MyYoastApiClient\Model\CustomerNote[] */ - public function apiCustomerNotesIdGet($id, $filter = null) + public function customerNoteControllerGetMany($filter = null) { - list($response) = $this->apiCustomerNotesIdGetWithHttpInfo($id, $filter); + list($response) = $this->customerNoteControllerGetManyWithHttpInfo($filter); return $response; } /** - * Operation apiCustomerNotesIdGetWithHttpInfo + * Operation customerNoteControllerGetManyWithHttpInfo * - * Get a customer note + * Get customer notes * - * @param string $id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Yoast\MyYoastApiClient\Model\CustomerNote, HTTP status code, HTTP response headers (array of strings) + * @return array of \Yoast\MyYoastApiClient\Model\CustomerNote[], HTTP status code, HTTP response headers (array of strings) */ - public function apiCustomerNotesIdGetWithHttpInfo($id, $filter = null) + public function customerNoteControllerGetManyWithHttpInfo($filter = null) { - $returnType = '\Yoast\MyYoastApiClient\Model\CustomerNote'; - $request = $this->apiCustomerNotesIdGetRequest($id, $filter); + $returnType = '\Yoast\MyYoastApiClient\Model\CustomerNote[]'; + $request = $this->customerNoteControllerGetManyRequest($filter); try { $options = $this->createHttpClientOption(); @@ -652,7 +597,7 @@ public function apiCustomerNotesIdGetWithHttpInfo($id, $filter = null) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -668,7 +613,7 @@ public function apiCustomerNotesIdGetWithHttpInfo($id, $filter = null) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Yoast\MyYoastApiClient\Model\CustomerNote', + '\Yoast\MyYoastApiClient\Model\CustomerNote[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -679,19 +624,18 @@ public function apiCustomerNotesIdGetWithHttpInfo($id, $filter = null) } /** - * Operation apiCustomerNotesIdGetAsync + * Operation customerNoteControllerGetManyAsync * - * Get a customer note + * Get customer notes * - * @param string $id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomerNotesIdGetAsync($id, $filter = null) + public function customerNoteControllerGetManyAsync($filter = null) { - return $this->apiCustomerNotesIdGetAsyncWithHttpInfo($id, $filter) + return $this->customerNoteControllerGetManyAsyncWithHttpInfo($filter) ->then( function ($response) { return $response[0]; @@ -700,20 +644,19 @@ function ($response) { } /** - * Operation apiCustomerNotesIdGetAsyncWithHttpInfo + * Operation customerNoteControllerGetManyAsyncWithHttpInfo * - * Get a customer note + * Get customer notes * - * @param string $id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomerNotesIdGetAsyncWithHttpInfo($id, $filter = null) + public function customerNoteControllerGetManyAsyncWithHttpInfo($filter = null) { - $returnType = '\Yoast\MyYoastApiClient\Model\CustomerNote'; - $request = $this->apiCustomerNotesIdGetRequest($id, $filter); + $returnType = '\Yoast\MyYoastApiClient\Model\CustomerNote[]'; + $request = $this->customerNoteControllerGetManyRequest($filter); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -753,24 +696,17 @@ function ($exception) { } /** - * Create request for operation 'apiCustomerNotesIdGet' + * Create request for operation 'customerNoteControllerGetMany' * - * @param string $id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCustomerNotesIdGetRequest($id, $filter = null) + protected function customerNoteControllerGetManyRequest($filter = null) { - // 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 apiCustomerNotesIdGet' - ); - } - $resourcePath = '/api/CustomerNotes/{id}'; + $resourcePath = '/api/CustomerNotes'; $formParams = []; $queryParams = []; $headerParams = []; @@ -779,17 +715,9 @@ protected function apiCustomerNotesIdGetRequest($id, $filter = null) // query params if ($filter !== null) { - $queryParams['filter'] = ObjectSerializer::toQueryValue($filter); + $queryParams['filter'] = ObjectSerializer::toQueryValue($filter, null); } - // path params - if ($id !== null) { - $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), - $resourcePath - ); - } // body params $_tempBody = null; @@ -801,7 +729,7 @@ protected function apiCustomerNotesIdGetRequest($id, $filter = null) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -809,16 +737,9 @@ protected function apiCustomerNotesIdGetRequest($id, $filter = null) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -841,11 +762,10 @@ protected function apiCustomerNotesIdGetRequest($id, $filter = null) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -868,32 +788,39 @@ protected function apiCustomerNotesIdGetRequest($id, $filter = null) } /** - * Operation apiCustomerNotesPost + * Operation customerNoteControllerGetOne * - * @param \Yoast\MyYoastApiClient\Model\CreateCustomerNoteDto $createCustomerNoteDto createCustomerNoteDto (required) + * Get a customer note + * + * @param string $id id (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return \Yoast\MyYoastApiClient\Model\CustomerNote */ - public function apiCustomerNotesPost($createCustomerNoteDto) + public function customerNoteControllerGetOne($id, $filter = null) { - $this->apiCustomerNotesPostWithHttpInfo($createCustomerNoteDto); + list($response) = $this->customerNoteControllerGetOneWithHttpInfo($id, $filter); + return $response; } /** - * Operation apiCustomerNotesPostWithHttpInfo + * Operation customerNoteControllerGetOneWithHttpInfo + * + * Get a customer note * - * @param \Yoast\MyYoastApiClient\Model\CreateCustomerNoteDto $createCustomerNoteDto (required) + * @param string $id (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of \Yoast\MyYoastApiClient\Model\CustomerNote, HTTP status code, HTTP response headers (array of strings) */ - public function apiCustomerNotesPostWithHttpInfo($createCustomerNoteDto) + public function customerNoteControllerGetOneWithHttpInfo($id, $filter = null) { - $returnType = ''; - $request = $this->apiCustomerNotesPostRequest($createCustomerNoteDto); + $returnType = '\Yoast\MyYoastApiClient\Model\CustomerNote'; + $request = $this->customerNoteControllerGetOneRequest($id, $filter); try { $options = $this->createHttpClientOption(); @@ -923,28 +850,51 @@ public function apiCustomerNotesPostWithHttpInfo($createCustomerNoteDto) ); } - return [null, $statusCode, $response->getHeaders()]; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if (!in_array($returnType, ['string','integer','bool'])) { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; } catch (ApiException $e) { switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Yoast\MyYoastApiClient\Model\CustomerNote', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } } /** - * Operation apiCustomerNotesPostAsync + * Operation customerNoteControllerGetOneAsync * - * + * Get a customer note * - * @param \Yoast\MyYoastApiClient\Model\CreateCustomerNoteDto $createCustomerNoteDto (required) + * @param string $id (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomerNotesPostAsync($createCustomerNoteDto) + public function customerNoteControllerGetOneAsync($id, $filter = null) { - return $this->apiCustomerNotesPostAsyncWithHttpInfo($createCustomerNoteDto) + return $this->customerNoteControllerGetOneAsyncWithHttpInfo($id, $filter) ->then( function ($response) { return $response[0]; @@ -953,25 +903,40 @@ function ($response) { } /** - * Operation apiCustomerNotesPostAsyncWithHttpInfo + * Operation customerNoteControllerGetOneAsyncWithHttpInfo * - * + * Get a customer note * - * @param \Yoast\MyYoastApiClient\Model\CreateCustomerNoteDto $createCustomerNoteDto (required) + * @param string $id (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomerNotesPostAsyncWithHttpInfo($createCustomerNoteDto) + public function customerNoteControllerGetOneAsyncWithHttpInfo($id, $filter = null) { - $returnType = ''; - $request = $this->apiCustomerNotesPostRequest($createCustomerNoteDto); + $returnType = '\Yoast\MyYoastApiClient\Model\CustomerNote'; + $request = $this->customerNoteControllerGetOneRequest($id, $filter); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -991,36 +956,46 @@ function ($exception) { } /** - * Create request for operation 'apiCustomerNotesPost' + * Create request for operation 'customerNoteControllerGetOne' * - * @param \Yoast\MyYoastApiClient\Model\CreateCustomerNoteDto $createCustomerNoteDto (required) + * @param string $id (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCustomerNotesPostRequest($createCustomerNoteDto) + protected function customerNoteControllerGetOneRequest($id, $filter = null) { - // verify the required parameter 'createCustomerNoteDto' is set - if ($createCustomerNoteDto === null || (is_array($createCustomerNoteDto) && count($createCustomerNoteDto) === 0)) { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $createCustomerNoteDto when calling apiCustomerNotesPost' + 'Missing the required parameter $id when calling customerNoteControllerGetOne' ); } - $resourcePath = '/api/CustomerNotes'; + $resourcePath = '/api/CustomerNotes/{id}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + if ($filter !== null) { + $queryParams['filter'] = ObjectSerializer::toQueryValue($filter, null); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } // body params $_tempBody = null; - if (isset($createCustomerNoteDto)) { - $_tempBody = $createCustomerNoteDto; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -1029,7 +1004,7 @@ protected function apiCustomerNotesPostRequest($createCustomerNoteDto) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -1037,16 +1012,9 @@ protected function apiCustomerNotesPostRequest($createCustomerNoteDto) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -1069,11 +1037,10 @@ protected function apiCustomerNotesPostRequest($createCustomerNoteDto) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1088,7 +1055,7 @@ protected function apiCustomerNotesPostRequest($createCustomerNoteDto) $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody diff --git a/src/Api/DownloadApi.php b/src/Api/DownloadApi.php index 61bf4d9..133202f 100644 --- a/src/Api/DownloadApi.php +++ b/src/Api/DownloadApi.php @@ -17,9 +17,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -88,42 +87,43 @@ public function getConfig() } /** - * Operation apiDownloadsFileNameGet + * Operation downloadControllerDownloadFile * * Route to download a file * + * @param string $name name (required) * @param string $version version (required) * @param string $pluginVersion pluginVersion (required) * @param string $site site (required) - * @param string $name name (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return object */ - public function apiDownloadsFileNameGet($version, $pluginVersion, $site, $name) + public function downloadControllerDownloadFile($name, $version, $pluginVersion, $site) { - $this->apiDownloadsFileNameGetWithHttpInfo($version, $pluginVersion, $site, $name); + list($response) = $this->downloadControllerDownloadFileWithHttpInfo($name, $version, $pluginVersion, $site); + return $response; } /** - * Operation apiDownloadsFileNameGetWithHttpInfo + * Operation downloadControllerDownloadFileWithHttpInfo * * Route to download a file * + * @param string $name (required) * @param string $version (required) * @param string $pluginVersion (required) * @param string $site (required) - * @param string $name (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of object, HTTP status code, HTTP response headers (array of strings) */ - public function apiDownloadsFileNameGetWithHttpInfo($version, $pluginVersion, $site, $name) + public function downloadControllerDownloadFileWithHttpInfo($name, $version, $pluginVersion, $site) { - $returnType = ''; - $request = $this->apiDownloadsFileNameGetRequest($version, $pluginVersion, $site, $name); + $returnType = 'object'; + $request = $this->downloadControllerDownloadFileRequest($name, $version, $pluginVersion, $site); try { $options = $this->createHttpClientOption(); @@ -153,31 +153,53 @@ public function apiDownloadsFileNameGetWithHttpInfo($version, $pluginVersion, $s ); } - return [null, $statusCode, $response->getHeaders()]; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if (!in_array($returnType, ['string','integer','bool'])) { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; } catch (ApiException $e) { switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } } /** - * Operation apiDownloadsFileNameGetAsync + * Operation downloadControllerDownloadFileAsync * * Route to download a file * + * @param string $name (required) * @param string $version (required) * @param string $pluginVersion (required) * @param string $site (required) - * @param string $name (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiDownloadsFileNameGetAsync($version, $pluginVersion, $site, $name) + public function downloadControllerDownloadFileAsync($name, $version, $pluginVersion, $site) { - return $this->apiDownloadsFileNameGetAsyncWithHttpInfo($version, $pluginVersion, $site, $name) + return $this->downloadControllerDownloadFileAsyncWithHttpInfo($name, $version, $pluginVersion, $site) ->then( function ($response) { return $response[0]; @@ -186,28 +208,42 @@ function ($response) { } /** - * Operation apiDownloadsFileNameGetAsyncWithHttpInfo + * Operation downloadControllerDownloadFileAsyncWithHttpInfo * * Route to download a file * + * @param string $name (required) * @param string $version (required) * @param string $pluginVersion (required) * @param string $site (required) - * @param string $name (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiDownloadsFileNameGetAsyncWithHttpInfo($version, $pluginVersion, $site, $name) + public function downloadControllerDownloadFileAsyncWithHttpInfo($name, $version, $pluginVersion, $site) { - $returnType = ''; - $request = $this->apiDownloadsFileNameGetRequest($version, $pluginVersion, $site, $name); + $returnType = 'object'; + $request = $this->downloadControllerDownloadFileRequest($name, $version, $pluginVersion, $site); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -227,40 +263,40 @@ function ($exception) { } /** - * Create request for operation 'apiDownloadsFileNameGet' + * Create request for operation 'downloadControllerDownloadFile' * + * @param string $name (required) * @param string $version (required) * @param string $pluginVersion (required) * @param string $site (required) - * @param string $name (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiDownloadsFileNameGetRequest($version, $pluginVersion, $site, $name) + protected function downloadControllerDownloadFileRequest($name, $version, $pluginVersion, $site) { + // verify the required parameter 'name' is set + if ($name === null || (is_array($name) && count($name) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $name when calling downloadControllerDownloadFile' + ); + } // verify the required parameter 'version' is set if ($version === null || (is_array($version) && count($version) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $version when calling apiDownloadsFileNameGet' + 'Missing the required parameter $version when calling downloadControllerDownloadFile' ); } // verify the required parameter 'pluginVersion' is set if ($pluginVersion === null || (is_array($pluginVersion) && count($pluginVersion) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $pluginVersion when calling apiDownloadsFileNameGet' + 'Missing the required parameter $pluginVersion when calling downloadControllerDownloadFile' ); } // verify the required parameter 'site' is set if ($site === null || (is_array($site) && count($site) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $site when calling apiDownloadsFileNameGet' - ); - } - // verify the required parameter 'name' is set - if ($name === null || (is_array($name) && count($name) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $name when calling apiDownloadsFileNameGet' + 'Missing the required parameter $site when calling downloadControllerDownloadFile' ); } @@ -273,15 +309,15 @@ protected function apiDownloadsFileNameGetRequest($version, $pluginVersion, $sit // query params if ($version !== null) { - $queryParams['version'] = ObjectSerializer::toQueryValue($version); + $queryParams['version'] = ObjectSerializer::toQueryValue($version, null); } // query params if ($pluginVersion !== null) { - $queryParams['plugin_version'] = ObjectSerializer::toQueryValue($pluginVersion); + $queryParams['plugin_version'] = ObjectSerializer::toQueryValue($pluginVersion, null); } // query params if ($site !== null) { - $queryParams['site'] = ObjectSerializer::toQueryValue($site); + $queryParams['site'] = ObjectSerializer::toQueryValue($site, null); } // path params @@ -303,7 +339,7 @@ protected function apiDownloadsFileNameGetRequest($version, $pluginVersion, $sit } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -311,16 +347,9 @@ protected function apiDownloadsFileNameGetRequest($version, $pluginVersion, $sit if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -365,39 +394,39 @@ protected function apiDownloadsFileNameGetRequest($version, $pluginVersion, $sit } /** - * Operation apiDownloadsFileNamePost + * Operation downloadControllerUploadFile * * Route to update a file. * - * @param \Yoast\MyYoastApiClient\Model\UpdateFileDto $updateFileDto updateFileDto (required) + * @param \Yoast\MyYoastApiClient\Model\UpdateFileDto $body body (required) * @param string $name name (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return object */ - public function apiDownloadsFileNamePost($updateFileDto, $name) + public function downloadControllerUploadFile($body, $name) { - list($response) = $this->apiDownloadsFileNamePostWithHttpInfo($updateFileDto, $name); + list($response) = $this->downloadControllerUploadFileWithHttpInfo($body, $name); return $response; } /** - * Operation apiDownloadsFileNamePostWithHttpInfo + * Operation downloadControllerUploadFileWithHttpInfo * * Route to update a file. * - * @param \Yoast\MyYoastApiClient\Model\UpdateFileDto $updateFileDto (required) + * @param \Yoast\MyYoastApiClient\Model\UpdateFileDto $body (required) * @param string $name (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of object, HTTP status code, HTTP response headers (array of strings) */ - public function apiDownloadsFileNamePostWithHttpInfo($updateFileDto, $name) + public function downloadControllerUploadFileWithHttpInfo($body, $name) { $returnType = 'object'; - $request = $this->apiDownloadsFileNamePostRequest($updateFileDto, $name); + $request = $this->downloadControllerUploadFileRequest($body, $name); try { $options = $this->createHttpClientOption(); @@ -432,7 +461,7 @@ public function apiDownloadsFileNamePostWithHttpInfo($updateFileDto, $name) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -459,19 +488,19 @@ public function apiDownloadsFileNamePostWithHttpInfo($updateFileDto, $name) } /** - * Operation apiDownloadsFileNamePostAsync + * Operation downloadControllerUploadFileAsync * * Route to update a file. * - * @param \Yoast\MyYoastApiClient\Model\UpdateFileDto $updateFileDto (required) + * @param \Yoast\MyYoastApiClient\Model\UpdateFileDto $body (required) * @param string $name (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiDownloadsFileNamePostAsync($updateFileDto, $name) + public function downloadControllerUploadFileAsync($body, $name) { - return $this->apiDownloadsFileNamePostAsyncWithHttpInfo($updateFileDto, $name) + return $this->downloadControllerUploadFileAsyncWithHttpInfo($body, $name) ->then( function ($response) { return $response[0]; @@ -480,20 +509,20 @@ function ($response) { } /** - * Operation apiDownloadsFileNamePostAsyncWithHttpInfo + * Operation downloadControllerUploadFileAsyncWithHttpInfo * * Route to update a file. * - * @param \Yoast\MyYoastApiClient\Model\UpdateFileDto $updateFileDto (required) + * @param \Yoast\MyYoastApiClient\Model\UpdateFileDto $body (required) * @param string $name (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiDownloadsFileNamePostAsyncWithHttpInfo($updateFileDto, $name) + public function downloadControllerUploadFileAsyncWithHttpInfo($body, $name) { $returnType = 'object'; - $request = $this->apiDownloadsFileNamePostRequest($updateFileDto, $name); + $request = $this->downloadControllerUploadFileRequest($body, $name); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -533,26 +562,26 @@ function ($exception) { } /** - * Create request for operation 'apiDownloadsFileNamePost' + * Create request for operation 'downloadControllerUploadFile' * - * @param \Yoast\MyYoastApiClient\Model\UpdateFileDto $updateFileDto (required) + * @param \Yoast\MyYoastApiClient\Model\UpdateFileDto $body (required) * @param string $name (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiDownloadsFileNamePostRequest($updateFileDto, $name) + protected function downloadControllerUploadFileRequest($body, $name) { - // verify the required parameter 'updateFileDto' is set - if ($updateFileDto === null || (is_array($updateFileDto) && count($updateFileDto) === 0)) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $updateFileDto when calling apiDownloadsFileNamePost' + 'Missing the required parameter $body when calling downloadControllerUploadFile' ); } // verify the required parameter 'name' is set if ($name === null || (is_array($name) && count($name) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $name when calling apiDownloadsFileNamePost' + 'Missing the required parameter $name when calling downloadControllerUploadFile' ); } @@ -575,8 +604,8 @@ protected function apiDownloadsFileNamePostRequest($updateFileDto, $name) // body params $_tempBody = null; - if (isset($updateFileDto)) { - $_tempBody = $updateFileDto; + if (isset($body)) { + $_tempBody = $body; } if ($multipart) { @@ -594,16 +623,9 @@ protected function apiDownloadsFileNamePostRequest($updateFileDto, $name) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { diff --git a/src/Api/EDDApi.php b/src/Api/EDDApi.php index 32652ad..dfeee3d 100644 --- a/src/Api/EDDApi.php +++ b/src/Api/EDDApi.php @@ -17,9 +17,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -88,7 +87,7 @@ public function getConfig() } /** - * Operation eddSlApiGet + * Operation eddControllerHandleGetRequest * * Activate or deactivate a site license * @@ -100,13 +99,13 @@ public function getConfig() * @throws \InvalidArgumentException * @return void */ - public function eddSlApiGet($eddAction, $url, $itemName) + public function eddControllerHandleGetRequest($eddAction, $url, $itemName) { - $this->eddSlApiGetWithHttpInfo($eddAction, $url, $itemName); + $this->eddControllerHandleGetRequestWithHttpInfo($eddAction, $url, $itemName); } /** - * Operation eddSlApiGetWithHttpInfo + * Operation eddControllerHandleGetRequestWithHttpInfo * * Activate or deactivate a site license * @@ -118,10 +117,10 @@ public function eddSlApiGet($eddAction, $url, $itemName) * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function eddSlApiGetWithHttpInfo($eddAction, $url, $itemName) + public function eddControllerHandleGetRequestWithHttpInfo($eddAction, $url, $itemName) { $returnType = ''; - $request = $this->eddSlApiGetRequest($eddAction, $url, $itemName); + $request = $this->eddControllerHandleGetRequestRequest($eddAction, $url, $itemName); try { $options = $this->createHttpClientOption(); @@ -161,7 +160,7 @@ public function eddSlApiGetWithHttpInfo($eddAction, $url, $itemName) } /** - * Operation eddSlApiGetAsync + * Operation eddControllerHandleGetRequestAsync * * Activate or deactivate a site license * @@ -172,9 +171,9 @@ public function eddSlApiGetWithHttpInfo($eddAction, $url, $itemName) * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function eddSlApiGetAsync($eddAction, $url, $itemName) + public function eddControllerHandleGetRequestAsync($eddAction, $url, $itemName) { - return $this->eddSlApiGetAsyncWithHttpInfo($eddAction, $url, $itemName) + return $this->eddControllerHandleGetRequestAsyncWithHttpInfo($eddAction, $url, $itemName) ->then( function ($response) { return $response[0]; @@ -183,7 +182,7 @@ function ($response) { } /** - * Operation eddSlApiGetAsyncWithHttpInfo + * Operation eddControllerHandleGetRequestAsyncWithHttpInfo * * Activate or deactivate a site license * @@ -194,10 +193,10 @@ function ($response) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function eddSlApiGetAsyncWithHttpInfo($eddAction, $url, $itemName) + public function eddControllerHandleGetRequestAsyncWithHttpInfo($eddAction, $url, $itemName) { $returnType = ''; - $request = $this->eddSlApiGetRequest($eddAction, $url, $itemName); + $request = $this->eddControllerHandleGetRequestRequest($eddAction, $url, $itemName); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -223,7 +222,7 @@ function ($exception) { } /** - * Create request for operation 'eddSlApiGet' + * Create request for operation 'eddControllerHandleGetRequest' * * @param string $eddAction (required) * @param string $url (required) @@ -232,24 +231,24 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function eddSlApiGetRequest($eddAction, $url, $itemName) + protected function eddControllerHandleGetRequestRequest($eddAction, $url, $itemName) { // verify the required parameter 'eddAction' is set if ($eddAction === null || (is_array($eddAction) && count($eddAction) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $eddAction when calling eddSlApiGet' + 'Missing the required parameter $eddAction when calling eddControllerHandleGetRequest' ); } // verify the required parameter 'url' is set if ($url === null || (is_array($url) && count($url) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $url when calling eddSlApiGet' + 'Missing the required parameter $url when calling eddControllerHandleGetRequest' ); } // verify the required parameter 'itemName' is set if ($itemName === null || (is_array($itemName) && count($itemName) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $itemName when calling eddSlApiGet' + 'Missing the required parameter $itemName when calling eddControllerHandleGetRequest' ); } @@ -262,15 +261,15 @@ protected function eddSlApiGetRequest($eddAction, $url, $itemName) // query params if ($eddAction !== null) { - $queryParams['edd_action'] = ObjectSerializer::toQueryValue($eddAction); + $queryParams['edd_action'] = ObjectSerializer::toQueryValue($eddAction, null); } // query params if ($url !== null) { - $queryParams['url'] = ObjectSerializer::toQueryValue($url); + $queryParams['url'] = ObjectSerializer::toQueryValue($url, null); } // query params if ($itemName !== null) { - $queryParams['item_name'] = ObjectSerializer::toQueryValue($itemName); + $queryParams['item_name'] = ObjectSerializer::toQueryValue($itemName, null); } @@ -279,12 +278,12 @@ protected function eddSlApiGetRequest($eddAction, $url, $itemName) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + [] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + [], + [] ); } @@ -292,16 +291,9 @@ protected function eddSlApiGetRequest($eddAction, $url, $itemName) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -346,34 +338,34 @@ protected function eddSlApiGetRequest($eddAction, $url, $itemName) } /** - * Operation eddSlApiPost + * Operation eddControllerHandlePostRequest * - * @param \Yoast\MyYoastApiClient\Model\EddDTO $eddDTO eddDTO (required) + * @param \Yoast\MyYoastApiClient\Model\EddDTO $body body (required) * @param string $eddAction eddAction (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function eddSlApiPost($eddDTO, $eddAction) + public function eddControllerHandlePostRequest($body, $eddAction) { - $this->eddSlApiPostWithHttpInfo($eddDTO, $eddAction); + $this->eddControllerHandlePostRequestWithHttpInfo($body, $eddAction); } /** - * Operation eddSlApiPostWithHttpInfo + * Operation eddControllerHandlePostRequestWithHttpInfo * - * @param \Yoast\MyYoastApiClient\Model\EddDTO $eddDTO (required) + * @param \Yoast\MyYoastApiClient\Model\EddDTO $body (required) * @param string $eddAction (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function eddSlApiPostWithHttpInfo($eddDTO, $eddAction) + public function eddControllerHandlePostRequestWithHttpInfo($body, $eddAction) { $returnType = ''; - $request = $this->eddSlApiPostRequest($eddDTO, $eddAction); + $request = $this->eddControllerHandlePostRequestRequest($body, $eddAction); try { $options = $this->createHttpClientOption(); @@ -413,19 +405,19 @@ public function eddSlApiPostWithHttpInfo($eddDTO, $eddAction) } /** - * Operation eddSlApiPostAsync + * Operation eddControllerHandlePostRequestAsync * * * - * @param \Yoast\MyYoastApiClient\Model\EddDTO $eddDTO (required) + * @param \Yoast\MyYoastApiClient\Model\EddDTO $body (required) * @param string $eddAction (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function eddSlApiPostAsync($eddDTO, $eddAction) + public function eddControllerHandlePostRequestAsync($body, $eddAction) { - return $this->eddSlApiPostAsyncWithHttpInfo($eddDTO, $eddAction) + return $this->eddControllerHandlePostRequestAsyncWithHttpInfo($body, $eddAction) ->then( function ($response) { return $response[0]; @@ -434,20 +426,20 @@ function ($response) { } /** - * Operation eddSlApiPostAsyncWithHttpInfo + * Operation eddControllerHandlePostRequestAsyncWithHttpInfo * * * - * @param \Yoast\MyYoastApiClient\Model\EddDTO $eddDTO (required) + * @param \Yoast\MyYoastApiClient\Model\EddDTO $body (required) * @param string $eddAction (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function eddSlApiPostAsyncWithHttpInfo($eddDTO, $eddAction) + public function eddControllerHandlePostRequestAsyncWithHttpInfo($body, $eddAction) { $returnType = ''; - $request = $this->eddSlApiPostRequest($eddDTO, $eddAction); + $request = $this->eddControllerHandlePostRequestRequest($body, $eddAction); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -473,26 +465,26 @@ function ($exception) { } /** - * Create request for operation 'eddSlApiPost' + * Create request for operation 'eddControllerHandlePostRequest' * - * @param \Yoast\MyYoastApiClient\Model\EddDTO $eddDTO (required) + * @param \Yoast\MyYoastApiClient\Model\EddDTO $body (required) * @param string $eddAction (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function eddSlApiPostRequest($eddDTO, $eddAction) + protected function eddControllerHandlePostRequestRequest($body, $eddAction) { - // verify the required parameter 'eddDTO' is set - if ($eddDTO === null || (is_array($eddDTO) && count($eddDTO) === 0)) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $eddDTO when calling eddSlApiPost' + 'Missing the required parameter $body when calling eddControllerHandlePostRequest' ); } // verify the required parameter 'eddAction' is set if ($eddAction === null || (is_array($eddAction) && count($eddAction) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $eddAction when calling eddSlApiPost' + 'Missing the required parameter $eddAction when calling eddControllerHandlePostRequest' ); } @@ -505,23 +497,23 @@ protected function eddSlApiPostRequest($eddDTO, $eddAction) // query params if ($eddAction !== null) { - $queryParams['edd_action'] = ObjectSerializer::toQueryValue($eddAction); + $queryParams['edd_action'] = ObjectSerializer::toQueryValue($eddAction, null); } // body params $_tempBody = null; - if (isset($eddDTO)) { - $_tempBody = $eddDTO; + if (isset($body)) { + $_tempBody = $body; } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + [] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + [], ['application/json'] ); } @@ -530,16 +522,9 @@ protected function eddSlApiPostRequest($eddDTO, $eddAction) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { diff --git a/src/Api/EmailApi.php b/src/Api/EmailApi.php new file mode 100644 index 0000000..6c3f3ee --- /dev/null +++ b/src/Api/EmailApi.php @@ -0,0 +1,364 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation emailControllerSendEmails + * + * @param \Yoast\MyYoastApiClient\Model\BulkSendEmailDto $body body (required) + * + * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return int + */ + public function emailControllerSendEmails($body) + { + list($response) = $this->emailControllerSendEmailsWithHttpInfo($body); + return $response; + } + + /** + * Operation emailControllerSendEmailsWithHttpInfo + * + * @param \Yoast\MyYoastApiClient\Model\BulkSendEmailDto $body (required) + * + * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of int, HTTP status code, HTTP response headers (array of strings) + */ + public function emailControllerSendEmailsWithHttpInfo($body) + { + $returnType = 'int'; + $request = $this->emailControllerSendEmailsRequest($body); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if (!in_array($returnType, ['string','integer','bool'])) { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'int', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation emailControllerSendEmailsAsync + * + * + * + * @param \Yoast\MyYoastApiClient\Model\BulkSendEmailDto $body (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function emailControllerSendEmailsAsync($body) + { + return $this->emailControllerSendEmailsAsyncWithHttpInfo($body) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation emailControllerSendEmailsAsyncWithHttpInfo + * + * + * + * @param \Yoast\MyYoastApiClient\Model\BulkSendEmailDto $body (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function emailControllerSendEmailsAsyncWithHttpInfo($body) + { + $returnType = 'int'; + $request = $this->emailControllerSendEmailsRequest($body); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + 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(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'emailControllerSendEmails' + * + * @param \Yoast\MyYoastApiClient\Model\BulkSendEmailDto $body (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function emailControllerSendEmailsRequest($body) + { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling emailControllerSendEmails' + ); + } + + $resourcePath = '/api/Emails/bulk-send'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // body params + $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $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/src/Api/ExportOrdersApi.php b/src/Api/ExportOrdersApi.php index 7a2fe49..1d5777e 100644 --- a/src/Api/ExportOrdersApi.php +++ b/src/Api/ExportOrdersApi.php @@ -17,9 +17,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -88,43 +87,43 @@ public function getConfig() } /** - * Operation exportOrdersV2FromToTypeGet + * Operation exportOrdersControllerExportOrders * * Creates an export for orders * - * @param string $from from (required) - * @param string $to to (required) + * @param string $year year (required) + * @param string $month month (required) * @param string $type type (required) * @param string $password password (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \SplFileObject + * @return string */ - public function exportOrdersV2FromToTypeGet($from, $to, $type, $password = null) + public function exportOrdersControllerExportOrders($year, $month, $type, $password = null) { - list($response) = $this->exportOrdersV2FromToTypeGetWithHttpInfo($from, $to, $type, $password); + list($response) = $this->exportOrdersControllerExportOrdersWithHttpInfo($year, $month, $type, $password); return $response; } /** - * Operation exportOrdersV2FromToTypeGetWithHttpInfo + * Operation exportOrdersControllerExportOrdersWithHttpInfo * * Creates an export for orders * - * @param string $from (required) - * @param string $to (required) + * @param string $year (required) + * @param string $month (required) * @param string $type (required) * @param string $password (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \SplFileObject, HTTP status code, HTTP response headers (array of strings) + * @return array of string, HTTP status code, HTTP response headers (array of strings) */ - public function exportOrdersV2FromToTypeGetWithHttpInfo($from, $to, $type, $password = null) + public function exportOrdersControllerExportOrdersWithHttpInfo($year, $month, $type, $password = null) { - $returnType = '\SplFileObject'; - $request = $this->exportOrdersV2FromToTypeGetRequest($from, $to, $type, $password); + $returnType = 'string'; + $request = $this->exportOrdersControllerExportOrdersRequest($year, $month, $type, $password); try { $options = $this->createHttpClientOption(); @@ -159,7 +158,7 @@ public function exportOrdersV2FromToTypeGetWithHttpInfo($from, $to, $type, $pass $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -175,7 +174,7 @@ public function exportOrdersV2FromToTypeGetWithHttpInfo($from, $to, $type, $pass case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\SplFileObject', + 'string', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -186,21 +185,21 @@ public function exportOrdersV2FromToTypeGetWithHttpInfo($from, $to, $type, $pass } /** - * Operation exportOrdersV2FromToTypeGetAsync + * Operation exportOrdersControllerExportOrdersAsync * * Creates an export for orders * - * @param string $from (required) - * @param string $to (required) + * @param string $year (required) + * @param string $month (required) * @param string $type (required) * @param string $password (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportOrdersV2FromToTypeGetAsync($from, $to, $type, $password = null) + public function exportOrdersControllerExportOrdersAsync($year, $month, $type, $password = null) { - return $this->exportOrdersV2FromToTypeGetAsyncWithHttpInfo($from, $to, $type, $password) + return $this->exportOrdersControllerExportOrdersAsyncWithHttpInfo($year, $month, $type, $password) ->then( function ($response) { return $response[0]; @@ -209,22 +208,22 @@ function ($response) { } /** - * Operation exportOrdersV2FromToTypeGetAsyncWithHttpInfo + * Operation exportOrdersControllerExportOrdersAsyncWithHttpInfo * * Creates an export for orders * - * @param string $from (required) - * @param string $to (required) + * @param string $year (required) + * @param string $month (required) * @param string $type (required) * @param string $password (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportOrdersV2FromToTypeGetAsyncWithHttpInfo($from, $to, $type, $password = null) + public function exportOrdersControllerExportOrdersAsyncWithHttpInfo($year, $month, $type, $password = null) { - $returnType = '\SplFileObject'; - $request = $this->exportOrdersV2FromToTypeGetRequest($from, $to, $type, $password); + $returnType = 'string'; + $request = $this->exportOrdersControllerExportOrdersRequest($year, $month, $type, $password); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -264,38 +263,38 @@ function ($exception) { } /** - * Create request for operation 'exportOrdersV2FromToTypeGet' + * Create request for operation 'exportOrdersControllerExportOrders' * - * @param string $from (required) - * @param string $to (required) + * @param string $year (required) + * @param string $month (required) * @param string $type (required) * @param string $password (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function exportOrdersV2FromToTypeGetRequest($from, $to, $type, $password = null) + protected function exportOrdersControllerExportOrdersRequest($year, $month, $type, $password = null) { - // verify the required parameter 'from' is set - if ($from === null || (is_array($from) && count($from) === 0)) { + // verify the required parameter 'year' is set + if ($year === null || (is_array($year) && count($year) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $from when calling exportOrdersV2FromToTypeGet' + 'Missing the required parameter $year when calling exportOrdersControllerExportOrders' ); } - // verify the required parameter 'to' is set - if ($to === null || (is_array($to) && count($to) === 0)) { + // verify the required parameter 'month' is set + if ($month === null || (is_array($month) && count($month) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $to when calling exportOrdersV2FromToTypeGet' + 'Missing the required parameter $month when calling exportOrdersControllerExportOrders' ); } // verify the required parameter 'type' is set if ($type === null || (is_array($type) && count($type) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $type when calling exportOrdersV2FromToTypeGet' + 'Missing the required parameter $type when calling exportOrdersControllerExportOrders' ); } - $resourcePath = '/export-orders/v2/{from}/{to}/{type}'; + $resourcePath = '/export-orders/{year}/{month}/{type}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -304,22 +303,22 @@ protected function exportOrdersV2FromToTypeGetRequest($from, $to, $type, $passwo // query params if ($password !== null) { - $queryParams['password'] = ObjectSerializer::toQueryValue($password); + $queryParams['password'] = ObjectSerializer::toQueryValue($password, null); } // path params - if ($from !== null) { + if ($year !== null) { $resourcePath = str_replace( - '{' . 'from' . '}', - ObjectSerializer::toPathValue($from), + '{' . 'year' . '}', + ObjectSerializer::toPathValue($year), $resourcePath ); } // path params - if ($to !== null) { + if ($month !== null) { $resourcePath = str_replace( - '{' . 'to' . '}', - ObjectSerializer::toPathValue($to), + '{' . 'month' . '}', + ObjectSerializer::toPathValue($month), $resourcePath ); } @@ -342,7 +341,7 @@ protected function exportOrdersV2FromToTypeGetRequest($from, $to, $type, $passwo } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -350,16 +349,9 @@ protected function exportOrdersV2FromToTypeGetRequest($from, $to, $type, $passwo if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -404,43 +396,43 @@ protected function exportOrdersV2FromToTypeGetRequest($from, $to, $type, $passwo } /** - * Operation exportOrdersYearMonthTypeGet + * Operation exportOrdersControllerExportOrdersV2 * * Creates an export for orders * - * @param string $year year (required) - * @param string $month month (required) + * @param string $from from (required) + * @param string $to to (required) * @param string $type type (required) * @param string $password password (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \SplFileObject + * @return string */ - public function exportOrdersYearMonthTypeGet($year, $month, $type, $password = null) + public function exportOrdersControllerExportOrdersV2($from, $to, $type, $password = null) { - list($response) = $this->exportOrdersYearMonthTypeGetWithHttpInfo($year, $month, $type, $password); + list($response) = $this->exportOrdersControllerExportOrdersV2WithHttpInfo($from, $to, $type, $password); return $response; } /** - * Operation exportOrdersYearMonthTypeGetWithHttpInfo + * Operation exportOrdersControllerExportOrdersV2WithHttpInfo * * Creates an export for orders * - * @param string $year (required) - * @param string $month (required) + * @param string $from (required) + * @param string $to (required) * @param string $type (required) * @param string $password (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \SplFileObject, HTTP status code, HTTP response headers (array of strings) + * @return array of string, HTTP status code, HTTP response headers (array of strings) */ - public function exportOrdersYearMonthTypeGetWithHttpInfo($year, $month, $type, $password = null) + public function exportOrdersControllerExportOrdersV2WithHttpInfo($from, $to, $type, $password = null) { - $returnType = '\SplFileObject'; - $request = $this->exportOrdersYearMonthTypeGetRequest($year, $month, $type, $password); + $returnType = 'string'; + $request = $this->exportOrdersControllerExportOrdersV2Request($from, $to, $type, $password); try { $options = $this->createHttpClientOption(); @@ -475,7 +467,7 @@ public function exportOrdersYearMonthTypeGetWithHttpInfo($year, $month, $type, $ $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -491,7 +483,7 @@ public function exportOrdersYearMonthTypeGetWithHttpInfo($year, $month, $type, $ case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\SplFileObject', + 'string', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -502,21 +494,21 @@ public function exportOrdersYearMonthTypeGetWithHttpInfo($year, $month, $type, $ } /** - * Operation exportOrdersYearMonthTypeGetAsync + * Operation exportOrdersControllerExportOrdersV2Async * * Creates an export for orders * - * @param string $year (required) - * @param string $month (required) + * @param string $from (required) + * @param string $to (required) * @param string $type (required) * @param string $password (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportOrdersYearMonthTypeGetAsync($year, $month, $type, $password = null) + public function exportOrdersControllerExportOrdersV2Async($from, $to, $type, $password = null) { - return $this->exportOrdersYearMonthTypeGetAsyncWithHttpInfo($year, $month, $type, $password) + return $this->exportOrdersControllerExportOrdersV2AsyncWithHttpInfo($from, $to, $type, $password) ->then( function ($response) { return $response[0]; @@ -525,22 +517,22 @@ function ($response) { } /** - * Operation exportOrdersYearMonthTypeGetAsyncWithHttpInfo + * Operation exportOrdersControllerExportOrdersV2AsyncWithHttpInfo * * Creates an export for orders * - * @param string $year (required) - * @param string $month (required) + * @param string $from (required) + * @param string $to (required) * @param string $type (required) * @param string $password (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function exportOrdersYearMonthTypeGetAsyncWithHttpInfo($year, $month, $type, $password = null) + public function exportOrdersControllerExportOrdersV2AsyncWithHttpInfo($from, $to, $type, $password = null) { - $returnType = '\SplFileObject'; - $request = $this->exportOrdersYearMonthTypeGetRequest($year, $month, $type, $password); + $returnType = 'string'; + $request = $this->exportOrdersControllerExportOrdersV2Request($from, $to, $type, $password); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -580,38 +572,38 @@ function ($exception) { } /** - * Create request for operation 'exportOrdersYearMonthTypeGet' + * Create request for operation 'exportOrdersControllerExportOrdersV2' * - * @param string $year (required) - * @param string $month (required) + * @param string $from (required) + * @param string $to (required) * @param string $type (required) * @param string $password (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function exportOrdersYearMonthTypeGetRequest($year, $month, $type, $password = null) + protected function exportOrdersControllerExportOrdersV2Request($from, $to, $type, $password = null) { - // verify the required parameter 'year' is set - if ($year === null || (is_array($year) && count($year) === 0)) { + // verify the required parameter 'from' is set + if ($from === null || (is_array($from) && count($from) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $year when calling exportOrdersYearMonthTypeGet' + 'Missing the required parameter $from when calling exportOrdersControllerExportOrdersV2' ); } - // verify the required parameter 'month' is set - if ($month === null || (is_array($month) && count($month) === 0)) { + // verify the required parameter 'to' is set + if ($to === null || (is_array($to) && count($to) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $month when calling exportOrdersYearMonthTypeGet' + 'Missing the required parameter $to when calling exportOrdersControllerExportOrdersV2' ); } // verify the required parameter 'type' is set if ($type === null || (is_array($type) && count($type) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $type when calling exportOrdersYearMonthTypeGet' + 'Missing the required parameter $type when calling exportOrdersControllerExportOrdersV2' ); } - $resourcePath = '/export-orders/{year}/{month}/{type}'; + $resourcePath = '/export-orders/v2/{from}/{to}/{type}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -620,22 +612,22 @@ protected function exportOrdersYearMonthTypeGetRequest($year, $month, $type, $pa // query params if ($password !== null) { - $queryParams['password'] = ObjectSerializer::toQueryValue($password); + $queryParams['password'] = ObjectSerializer::toQueryValue($password, null); } // path params - if ($year !== null) { + if ($from !== null) { $resourcePath = str_replace( - '{' . 'year' . '}', - ObjectSerializer::toPathValue($year), + '{' . 'from' . '}', + ObjectSerializer::toPathValue($from), $resourcePath ); } // path params - if ($month !== null) { + if ($to !== null) { $resourcePath = str_replace( - '{' . 'month' . '}', - ObjectSerializer::toPathValue($month), + '{' . 'to' . '}', + ObjectSerializer::toPathValue($to), $resourcePath ); } @@ -658,7 +650,7 @@ protected function exportOrdersYearMonthTypeGetRequest($year, $month, $type, $pa } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -666,16 +658,9 @@ protected function exportOrdersYearMonthTypeGetRequest($year, $month, $type, $pa if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { diff --git a/src/Api/FromWooCommerceApi.php b/src/Api/FromWooCommerceApi.php index f51fa4c..6ab0263 100644 --- a/src/Api/FromWooCommerceApi.php +++ b/src/Api/FromWooCommerceApi.php @@ -17,9 +17,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -88,37 +87,37 @@ public function getConfig() } /** - * Operation apiCustomersFromWooCommercePut + * Operation fromWooCommerceControllerCustomerFromWooCommerce * * Update or create a customer * - * @param \Yoast\MyYoastApiClient\Model\CustomerFromWooDto $customerFromWooDto customerFromWooDto (required) + * @param \Yoast\MyYoastApiClient\Model\CustomerFromWooDto $body body (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Yoast\MyYoastApiClient\Model\Customer */ - public function apiCustomersFromWooCommercePut($customerFromWooDto) + public function fromWooCommerceControllerCustomerFromWooCommerce($body) { - list($response) = $this->apiCustomersFromWooCommercePutWithHttpInfo($customerFromWooDto); + list($response) = $this->fromWooCommerceControllerCustomerFromWooCommerceWithHttpInfo($body); return $response; } /** - * Operation apiCustomersFromWooCommercePutWithHttpInfo + * Operation fromWooCommerceControllerCustomerFromWooCommerceWithHttpInfo * * Update or create a customer * - * @param \Yoast\MyYoastApiClient\Model\CustomerFromWooDto $customerFromWooDto (required) + * @param \Yoast\MyYoastApiClient\Model\CustomerFromWooDto $body (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Yoast\MyYoastApiClient\Model\Customer, HTTP status code, HTTP response headers (array of strings) */ - public function apiCustomersFromWooCommercePutWithHttpInfo($customerFromWooDto) + public function fromWooCommerceControllerCustomerFromWooCommerceWithHttpInfo($body) { $returnType = '\Yoast\MyYoastApiClient\Model\Customer'; - $request = $this->apiCustomersFromWooCommercePutRequest($customerFromWooDto); + $request = $this->fromWooCommerceControllerCustomerFromWooCommerceRequest($body); try { $options = $this->createHttpClientOption(); @@ -153,7 +152,7 @@ public function apiCustomersFromWooCommercePutWithHttpInfo($customerFromWooDto) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -180,18 +179,18 @@ public function apiCustomersFromWooCommercePutWithHttpInfo($customerFromWooDto) } /** - * Operation apiCustomersFromWooCommercePutAsync + * Operation fromWooCommerceControllerCustomerFromWooCommerceAsync * * Update or create a customer * - * @param \Yoast\MyYoastApiClient\Model\CustomerFromWooDto $customerFromWooDto (required) + * @param \Yoast\MyYoastApiClient\Model\CustomerFromWooDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersFromWooCommercePutAsync($customerFromWooDto) + public function fromWooCommerceControllerCustomerFromWooCommerceAsync($body) { - return $this->apiCustomersFromWooCommercePutAsyncWithHttpInfo($customerFromWooDto) + return $this->fromWooCommerceControllerCustomerFromWooCommerceAsyncWithHttpInfo($body) ->then( function ($response) { return $response[0]; @@ -200,19 +199,19 @@ function ($response) { } /** - * Operation apiCustomersFromWooCommercePutAsyncWithHttpInfo + * Operation fromWooCommerceControllerCustomerFromWooCommerceAsyncWithHttpInfo * * Update or create a customer * - * @param \Yoast\MyYoastApiClient\Model\CustomerFromWooDto $customerFromWooDto (required) + * @param \Yoast\MyYoastApiClient\Model\CustomerFromWooDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiCustomersFromWooCommercePutAsyncWithHttpInfo($customerFromWooDto) + public function fromWooCommerceControllerCustomerFromWooCommerceAsyncWithHttpInfo($body) { $returnType = '\Yoast\MyYoastApiClient\Model\Customer'; - $request = $this->apiCustomersFromWooCommercePutRequest($customerFromWooDto); + $request = $this->fromWooCommerceControllerCustomerFromWooCommerceRequest($body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -252,19 +251,19 @@ function ($exception) { } /** - * Create request for operation 'apiCustomersFromWooCommercePut' + * Create request for operation 'fromWooCommerceControllerCustomerFromWooCommerce' * - * @param \Yoast\MyYoastApiClient\Model\CustomerFromWooDto $customerFromWooDto (required) + * @param \Yoast\MyYoastApiClient\Model\CustomerFromWooDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiCustomersFromWooCommercePutRequest($customerFromWooDto) + protected function fromWooCommerceControllerCustomerFromWooCommerceRequest($body) { - // verify the required parameter 'customerFromWooDto' is set - if ($customerFromWooDto === null || (is_array($customerFromWooDto) && count($customerFromWooDto) === 0)) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $customerFromWooDto when calling apiCustomersFromWooCommercePut' + 'Missing the required parameter $body when calling fromWooCommerceControllerCustomerFromWooCommerce' ); } @@ -279,8 +278,8 @@ protected function apiCustomersFromWooCommercePutRequest($customerFromWooDto) // body params $_tempBody = null; - if (isset($customerFromWooDto)) { - $_tempBody = $customerFromWooDto; + if (isset($body)) { + $_tempBody = $body; } if ($multipart) { @@ -298,16 +297,9 @@ protected function apiCustomersFromWooCommercePutRequest($customerFromWooDto) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -330,11 +322,10 @@ protected function apiCustomersFromWooCommercePutRequest($customerFromWooDto) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -357,37 +348,37 @@ protected function apiCustomersFromWooCommercePutRequest($customerFromWooDto) } /** - * Operation apiOrdersFromWooCommercePut + * Operation fromWooCommerceControllerOrderFromWooCommerce * * Sync orders to MyYoast. * - * @param \Yoast\MyYoastApiClient\Model\OrderFromWooDto $orderFromWooDto orderFromWooDto (required) + * @param \Yoast\MyYoastApiClient\Model\OrderFromWooDto $body body (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Yoast\MyYoastApiClient\Model\Order */ - public function apiOrdersFromWooCommercePut($orderFromWooDto) + public function fromWooCommerceControllerOrderFromWooCommerce($body) { - list($response) = $this->apiOrdersFromWooCommercePutWithHttpInfo($orderFromWooDto); + list($response) = $this->fromWooCommerceControllerOrderFromWooCommerceWithHttpInfo($body); return $response; } /** - * Operation apiOrdersFromWooCommercePutWithHttpInfo + * Operation fromWooCommerceControllerOrderFromWooCommerceWithHttpInfo * * Sync orders to MyYoast. * - * @param \Yoast\MyYoastApiClient\Model\OrderFromWooDto $orderFromWooDto (required) + * @param \Yoast\MyYoastApiClient\Model\OrderFromWooDto $body (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Yoast\MyYoastApiClient\Model\Order, HTTP status code, HTTP response headers (array of strings) */ - public function apiOrdersFromWooCommercePutWithHttpInfo($orderFromWooDto) + public function fromWooCommerceControllerOrderFromWooCommerceWithHttpInfo($body) { $returnType = '\Yoast\MyYoastApiClient\Model\Order'; - $request = $this->apiOrdersFromWooCommercePutRequest($orderFromWooDto); + $request = $this->fromWooCommerceControllerOrderFromWooCommerceRequest($body); try { $options = $this->createHttpClientOption(); @@ -422,7 +413,7 @@ public function apiOrdersFromWooCommercePutWithHttpInfo($orderFromWooDto) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -449,18 +440,18 @@ public function apiOrdersFromWooCommercePutWithHttpInfo($orderFromWooDto) } /** - * Operation apiOrdersFromWooCommercePutAsync + * Operation fromWooCommerceControllerOrderFromWooCommerceAsync * * Sync orders to MyYoast. * - * @param \Yoast\MyYoastApiClient\Model\OrderFromWooDto $orderFromWooDto (required) + * @param \Yoast\MyYoastApiClient\Model\OrderFromWooDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiOrdersFromWooCommercePutAsync($orderFromWooDto) + public function fromWooCommerceControllerOrderFromWooCommerceAsync($body) { - return $this->apiOrdersFromWooCommercePutAsyncWithHttpInfo($orderFromWooDto) + return $this->fromWooCommerceControllerOrderFromWooCommerceAsyncWithHttpInfo($body) ->then( function ($response) { return $response[0]; @@ -469,19 +460,19 @@ function ($response) { } /** - * Operation apiOrdersFromWooCommercePutAsyncWithHttpInfo + * Operation fromWooCommerceControllerOrderFromWooCommerceAsyncWithHttpInfo * * Sync orders to MyYoast. * - * @param \Yoast\MyYoastApiClient\Model\OrderFromWooDto $orderFromWooDto (required) + * @param \Yoast\MyYoastApiClient\Model\OrderFromWooDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiOrdersFromWooCommercePutAsyncWithHttpInfo($orderFromWooDto) + public function fromWooCommerceControllerOrderFromWooCommerceAsyncWithHttpInfo($body) { $returnType = '\Yoast\MyYoastApiClient\Model\Order'; - $request = $this->apiOrdersFromWooCommercePutRequest($orderFromWooDto); + $request = $this->fromWooCommerceControllerOrderFromWooCommerceRequest($body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -521,19 +512,19 @@ function ($exception) { } /** - * Create request for operation 'apiOrdersFromWooCommercePut' + * Create request for operation 'fromWooCommerceControllerOrderFromWooCommerce' * - * @param \Yoast\MyYoastApiClient\Model\OrderFromWooDto $orderFromWooDto (required) + * @param \Yoast\MyYoastApiClient\Model\OrderFromWooDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiOrdersFromWooCommercePutRequest($orderFromWooDto) + protected function fromWooCommerceControllerOrderFromWooCommerceRequest($body) { - // verify the required parameter 'orderFromWooDto' is set - if ($orderFromWooDto === null || (is_array($orderFromWooDto) && count($orderFromWooDto) === 0)) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $orderFromWooDto when calling apiOrdersFromWooCommercePut' + 'Missing the required parameter $body when calling fromWooCommerceControllerOrderFromWooCommerce' ); } @@ -548,8 +539,8 @@ protected function apiOrdersFromWooCommercePutRequest($orderFromWooDto) // body params $_tempBody = null; - if (isset($orderFromWooDto)) { - $_tempBody = $orderFromWooDto; + if (isset($body)) { + $_tempBody = $body; } if ($multipart) { @@ -567,16 +558,9 @@ protected function apiOrdersFromWooCommercePutRequest($orderFromWooDto) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -599,11 +583,10 @@ protected function apiOrdersFromWooCommercePutRequest($orderFromWooDto) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -626,37 +609,37 @@ protected function apiOrdersFromWooCommercePutRequest($orderFromWooDto) } /** - * Operation apiProductGroupsFromWooCommercePut + * Operation fromWooCommerceControllerProductFromWooCommerce * * Sync products to MyYoast. * - * @param \Yoast\MyYoastApiClient\Model\ProductGroupFromWooDto $productGroupFromWooDto productGroupFromWooDto (required) + * @param \Yoast\MyYoastApiClient\Model\ProductFromWooDto $body body (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\ProductGroup + * @return \Yoast\MyYoastApiClient\Model\Product */ - public function apiProductGroupsFromWooCommercePut($productGroupFromWooDto) + public function fromWooCommerceControllerProductFromWooCommerce($body) { - list($response) = $this->apiProductGroupsFromWooCommercePutWithHttpInfo($productGroupFromWooDto); + list($response) = $this->fromWooCommerceControllerProductFromWooCommerceWithHttpInfo($body); return $response; } /** - * Operation apiProductGroupsFromWooCommercePutWithHttpInfo + * Operation fromWooCommerceControllerProductFromWooCommerceWithHttpInfo * * Sync products to MyYoast. * - * @param \Yoast\MyYoastApiClient\Model\ProductGroupFromWooDto $productGroupFromWooDto (required) + * @param \Yoast\MyYoastApiClient\Model\ProductFromWooDto $body (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Yoast\MyYoastApiClient\Model\ProductGroup, HTTP status code, HTTP response headers (array of strings) + * @return array of \Yoast\MyYoastApiClient\Model\Product, HTTP status code, HTTP response headers (array of strings) */ - public function apiProductGroupsFromWooCommercePutWithHttpInfo($productGroupFromWooDto) + public function fromWooCommerceControllerProductFromWooCommerceWithHttpInfo($body) { - $returnType = '\Yoast\MyYoastApiClient\Model\ProductGroup'; - $request = $this->apiProductGroupsFromWooCommercePutRequest($productGroupFromWooDto); + $returnType = '\Yoast\MyYoastApiClient\Model\Product'; + $request = $this->fromWooCommerceControllerProductFromWooCommerceRequest($body); try { $options = $this->createHttpClientOption(); @@ -691,7 +674,7 @@ public function apiProductGroupsFromWooCommercePutWithHttpInfo($productGroupFrom $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -707,7 +690,7 @@ public function apiProductGroupsFromWooCommercePutWithHttpInfo($productGroupFrom case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Yoast\MyYoastApiClient\Model\ProductGroup', + '\Yoast\MyYoastApiClient\Model\Product', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -718,18 +701,18 @@ public function apiProductGroupsFromWooCommercePutWithHttpInfo($productGroupFrom } /** - * Operation apiProductGroupsFromWooCommercePutAsync + * Operation fromWooCommerceControllerProductFromWooCommerceAsync * * Sync products to MyYoast. * - * @param \Yoast\MyYoastApiClient\Model\ProductGroupFromWooDto $productGroupFromWooDto (required) + * @param \Yoast\MyYoastApiClient\Model\ProductFromWooDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiProductGroupsFromWooCommercePutAsync($productGroupFromWooDto) + public function fromWooCommerceControllerProductFromWooCommerceAsync($body) { - return $this->apiProductGroupsFromWooCommercePutAsyncWithHttpInfo($productGroupFromWooDto) + return $this->fromWooCommerceControllerProductFromWooCommerceAsyncWithHttpInfo($body) ->then( function ($response) { return $response[0]; @@ -738,19 +721,19 @@ function ($response) { } /** - * Operation apiProductGroupsFromWooCommercePutAsyncWithHttpInfo + * Operation fromWooCommerceControllerProductFromWooCommerceAsyncWithHttpInfo * * Sync products to MyYoast. * - * @param \Yoast\MyYoastApiClient\Model\ProductGroupFromWooDto $productGroupFromWooDto (required) + * @param \Yoast\MyYoastApiClient\Model\ProductFromWooDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiProductGroupsFromWooCommercePutAsyncWithHttpInfo($productGroupFromWooDto) + public function fromWooCommerceControllerProductFromWooCommerceAsyncWithHttpInfo($body) { - $returnType = '\Yoast\MyYoastApiClient\Model\ProductGroup'; - $request = $this->apiProductGroupsFromWooCommercePutRequest($productGroupFromWooDto); + $returnType = '\Yoast\MyYoastApiClient\Model\Product'; + $request = $this->fromWooCommerceControllerProductFromWooCommerceRequest($body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -790,23 +773,23 @@ function ($exception) { } /** - * Create request for operation 'apiProductGroupsFromWooCommercePut' + * Create request for operation 'fromWooCommerceControllerProductFromWooCommerce' * - * @param \Yoast\MyYoastApiClient\Model\ProductGroupFromWooDto $productGroupFromWooDto (required) + * @param \Yoast\MyYoastApiClient\Model\ProductFromWooDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiProductGroupsFromWooCommercePutRequest($productGroupFromWooDto) + protected function fromWooCommerceControllerProductFromWooCommerceRequest($body) { - // verify the required parameter 'productGroupFromWooDto' is set - if ($productGroupFromWooDto === null || (is_array($productGroupFromWooDto) && count($productGroupFromWooDto) === 0)) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $productGroupFromWooDto when calling apiProductGroupsFromWooCommercePut' + 'Missing the required parameter $body when calling fromWooCommerceControllerProductFromWooCommerce' ); } - $resourcePath = '/api/ProductGroups/fromWooCommerce'; + $resourcePath = '/api/Products/fromWooCommerce'; $formParams = []; $queryParams = []; $headerParams = []; @@ -817,8 +800,8 @@ protected function apiProductGroupsFromWooCommercePutRequest($productGroupFromWo // body params $_tempBody = null; - if (isset($productGroupFromWooDto)) { - $_tempBody = $productGroupFromWooDto; + if (isset($body)) { + $_tempBody = $body; } if ($multipart) { @@ -836,16 +819,9 @@ protected function apiProductGroupsFromWooCommercePutRequest($productGroupFromWo if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -868,11 +844,10 @@ protected function apiProductGroupsFromWooCommercePutRequest($productGroupFromWo } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -895,37 +870,37 @@ protected function apiProductGroupsFromWooCommercePutRequest($productGroupFromWo } /** - * Operation apiProductsFromWooCommercePut + * Operation fromWooCommerceControllerProductGroupFromWooCommerce * * Sync products to MyYoast. * - * @param \Yoast\MyYoastApiClient\Model\ProductFromWooDto $productFromWooDto productFromWooDto (required) + * @param \Yoast\MyYoastApiClient\Model\ProductGroupFromWooDto $body body (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\Product + * @return \Yoast\MyYoastApiClient\Model\ProductGroup */ - public function apiProductsFromWooCommercePut($productFromWooDto) + public function fromWooCommerceControllerProductGroupFromWooCommerce($body) { - list($response) = $this->apiProductsFromWooCommercePutWithHttpInfo($productFromWooDto); + list($response) = $this->fromWooCommerceControllerProductGroupFromWooCommerceWithHttpInfo($body); return $response; } /** - * Operation apiProductsFromWooCommercePutWithHttpInfo + * Operation fromWooCommerceControllerProductGroupFromWooCommerceWithHttpInfo * * Sync products to MyYoast. * - * @param \Yoast\MyYoastApiClient\Model\ProductFromWooDto $productFromWooDto (required) + * @param \Yoast\MyYoastApiClient\Model\ProductGroupFromWooDto $body (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Yoast\MyYoastApiClient\Model\Product, HTTP status code, HTTP response headers (array of strings) + * @return array of \Yoast\MyYoastApiClient\Model\ProductGroup, HTTP status code, HTTP response headers (array of strings) */ - public function apiProductsFromWooCommercePutWithHttpInfo($productFromWooDto) + public function fromWooCommerceControllerProductGroupFromWooCommerceWithHttpInfo($body) { - $returnType = '\Yoast\MyYoastApiClient\Model\Product'; - $request = $this->apiProductsFromWooCommercePutRequest($productFromWooDto); + $returnType = '\Yoast\MyYoastApiClient\Model\ProductGroup'; + $request = $this->fromWooCommerceControllerProductGroupFromWooCommerceRequest($body); try { $options = $this->createHttpClientOption(); @@ -960,7 +935,7 @@ public function apiProductsFromWooCommercePutWithHttpInfo($productFromWooDto) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -976,7 +951,7 @@ public function apiProductsFromWooCommercePutWithHttpInfo($productFromWooDto) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Yoast\MyYoastApiClient\Model\Product', + '\Yoast\MyYoastApiClient\Model\ProductGroup', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -987,18 +962,18 @@ public function apiProductsFromWooCommercePutWithHttpInfo($productFromWooDto) } /** - * Operation apiProductsFromWooCommercePutAsync + * Operation fromWooCommerceControllerProductGroupFromWooCommerceAsync * * Sync products to MyYoast. * - * @param \Yoast\MyYoastApiClient\Model\ProductFromWooDto $productFromWooDto (required) + * @param \Yoast\MyYoastApiClient\Model\ProductGroupFromWooDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiProductsFromWooCommercePutAsync($productFromWooDto) + public function fromWooCommerceControllerProductGroupFromWooCommerceAsync($body) { - return $this->apiProductsFromWooCommercePutAsyncWithHttpInfo($productFromWooDto) + return $this->fromWooCommerceControllerProductGroupFromWooCommerceAsyncWithHttpInfo($body) ->then( function ($response) { return $response[0]; @@ -1007,19 +982,19 @@ function ($response) { } /** - * Operation apiProductsFromWooCommercePutAsyncWithHttpInfo + * Operation fromWooCommerceControllerProductGroupFromWooCommerceAsyncWithHttpInfo * * Sync products to MyYoast. * - * @param \Yoast\MyYoastApiClient\Model\ProductFromWooDto $productFromWooDto (required) + * @param \Yoast\MyYoastApiClient\Model\ProductGroupFromWooDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiProductsFromWooCommercePutAsyncWithHttpInfo($productFromWooDto) + public function fromWooCommerceControllerProductGroupFromWooCommerceAsyncWithHttpInfo($body) { - $returnType = '\Yoast\MyYoastApiClient\Model\Product'; - $request = $this->apiProductsFromWooCommercePutRequest($productFromWooDto); + $returnType = '\Yoast\MyYoastApiClient\Model\ProductGroup'; + $request = $this->fromWooCommerceControllerProductGroupFromWooCommerceRequest($body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1059,23 +1034,23 @@ function ($exception) { } /** - * Create request for operation 'apiProductsFromWooCommercePut' + * Create request for operation 'fromWooCommerceControllerProductGroupFromWooCommerce' * - * @param \Yoast\MyYoastApiClient\Model\ProductFromWooDto $productFromWooDto (required) + * @param \Yoast\MyYoastApiClient\Model\ProductGroupFromWooDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiProductsFromWooCommercePutRequest($productFromWooDto) + protected function fromWooCommerceControllerProductGroupFromWooCommerceRequest($body) { - // verify the required parameter 'productFromWooDto' is set - if ($productFromWooDto === null || (is_array($productFromWooDto) && count($productFromWooDto) === 0)) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $productFromWooDto when calling apiProductsFromWooCommercePut' + 'Missing the required parameter $body when calling fromWooCommerceControllerProductGroupFromWooCommerce' ); } - $resourcePath = '/api/Products/fromWooCommerce'; + $resourcePath = '/api/ProductGroups/fromWooCommerce'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1086,8 +1061,8 @@ protected function apiProductsFromWooCommercePutRequest($productFromWooDto) // body params $_tempBody = null; - if (isset($productFromWooDto)) { - $_tempBody = $productFromWooDto; + if (isset($body)) { + $_tempBody = $body; } if ($multipart) { @@ -1105,16 +1080,9 @@ protected function apiProductsFromWooCommercePutRequest($productFromWooDto) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -1137,11 +1105,10 @@ protected function apiProductsFromWooCommercePutRequest($productFromWooDto) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { diff --git a/src/Api/GDPRApi.php b/src/Api/GDPRApi.php new file mode 100644 index 0000000..84f4d08 --- /dev/null +++ b/src/Api/GDPRApi.php @@ -0,0 +1,373 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation customerGDPRControllerDeleteCustomer + * + * Performs a \"GDPR forget me\" request. + * + * @param string $id id (required) + * + * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return string + */ + public function customerGDPRControllerDeleteCustomer($id) + { + list($response) = $this->customerGDPRControllerDeleteCustomerWithHttpInfo($id); + return $response; + } + + /** + * Operation customerGDPRControllerDeleteCustomerWithHttpInfo + * + * Performs a \"GDPR forget me\" request. + * + * @param string $id (required) + * + * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of string, HTTP status code, HTTP response headers (array of strings) + */ + public function customerGDPRControllerDeleteCustomerWithHttpInfo($id) + { + $returnType = 'string'; + $request = $this->customerGDPRControllerDeleteCustomerRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if (!in_array($returnType, ['string','integer','bool'])) { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'string', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation customerGDPRControllerDeleteCustomerAsync + * + * Performs a \"GDPR forget me\" request. + * + * @param string $id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function customerGDPRControllerDeleteCustomerAsync($id) + { + return $this->customerGDPRControllerDeleteCustomerAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation customerGDPRControllerDeleteCustomerAsyncWithHttpInfo + * + * Performs a \"GDPR forget me\" request. + * + * @param string $id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function customerGDPRControllerDeleteCustomerAsyncWithHttpInfo($id) + { + $returnType = 'string'; + $request = $this->customerGDPRControllerDeleteCustomerRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + 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(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'customerGDPRControllerDeleteCustomer' + * + * @param string $id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function customerGDPRControllerDeleteCustomerRequest($id) + { + // 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 customerGDPRControllerDeleteCustomer' + ); + } + + $resourcePath = '/api/Customers/{id}/gdpr-delete'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $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/src/Api/HelpscoutApi.php b/src/Api/HelpscoutApi.php index 1176b94..080f9fe 100644 --- a/src/Api/HelpscoutApi.php +++ b/src/Api/HelpscoutApi.php @@ -17,9 +17,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -88,39 +87,39 @@ public function getConfig() } /** - * Operation helpscoutPost + * Operation helpScoutControllerHelpscout * * Get information about a customer * - * @param \Yoast\MyYoastApiClient\Model\HelpScoutDto $helpScoutDto helpScoutDto (required) + * @param \Yoast\MyYoastApiClient\Model\HelpScoutDto $body body (required) * @param string $xHelpScoutSignature The Helpscout signature (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return object */ - public function helpscoutPost($helpScoutDto, $xHelpScoutSignature) + public function helpScoutControllerHelpscout($body, $xHelpScoutSignature) { - list($response) = $this->helpscoutPostWithHttpInfo($helpScoutDto, $xHelpScoutSignature); + list($response) = $this->helpScoutControllerHelpscoutWithHttpInfo($body, $xHelpScoutSignature); return $response; } /** - * Operation helpscoutPostWithHttpInfo + * Operation helpScoutControllerHelpscoutWithHttpInfo * * Get information about a customer * - * @param \Yoast\MyYoastApiClient\Model\HelpScoutDto $helpScoutDto (required) + * @param \Yoast\MyYoastApiClient\Model\HelpScoutDto $body (required) * @param string $xHelpScoutSignature The Helpscout signature (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of object, HTTP status code, HTTP response headers (array of strings) */ - public function helpscoutPostWithHttpInfo($helpScoutDto, $xHelpScoutSignature) + public function helpScoutControllerHelpscoutWithHttpInfo($body, $xHelpScoutSignature) { $returnType = 'object'; - $request = $this->helpscoutPostRequest($helpScoutDto, $xHelpScoutSignature); + $request = $this->helpScoutControllerHelpscoutRequest($body, $xHelpScoutSignature); try { $options = $this->createHttpClientOption(); @@ -155,7 +154,7 @@ public function helpscoutPostWithHttpInfo($helpScoutDto, $xHelpScoutSignature) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -182,19 +181,19 @@ public function helpscoutPostWithHttpInfo($helpScoutDto, $xHelpScoutSignature) } /** - * Operation helpscoutPostAsync + * Operation helpScoutControllerHelpscoutAsync * * Get information about a customer * - * @param \Yoast\MyYoastApiClient\Model\HelpScoutDto $helpScoutDto (required) + * @param \Yoast\MyYoastApiClient\Model\HelpScoutDto $body (required) * @param string $xHelpScoutSignature The Helpscout signature (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function helpscoutPostAsync($helpScoutDto, $xHelpScoutSignature) + public function helpScoutControllerHelpscoutAsync($body, $xHelpScoutSignature) { - return $this->helpscoutPostAsyncWithHttpInfo($helpScoutDto, $xHelpScoutSignature) + return $this->helpScoutControllerHelpscoutAsyncWithHttpInfo($body, $xHelpScoutSignature) ->then( function ($response) { return $response[0]; @@ -203,20 +202,20 @@ function ($response) { } /** - * Operation helpscoutPostAsyncWithHttpInfo + * Operation helpScoutControllerHelpscoutAsyncWithHttpInfo * * Get information about a customer * - * @param \Yoast\MyYoastApiClient\Model\HelpScoutDto $helpScoutDto (required) + * @param \Yoast\MyYoastApiClient\Model\HelpScoutDto $body (required) * @param string $xHelpScoutSignature The Helpscout signature (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function helpscoutPostAsyncWithHttpInfo($helpScoutDto, $xHelpScoutSignature) + public function helpScoutControllerHelpscoutAsyncWithHttpInfo($body, $xHelpScoutSignature) { $returnType = 'object'; - $request = $this->helpscoutPostRequest($helpScoutDto, $xHelpScoutSignature); + $request = $this->helpScoutControllerHelpscoutRequest($body, $xHelpScoutSignature); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -256,26 +255,26 @@ function ($exception) { } /** - * Create request for operation 'helpscoutPost' + * Create request for operation 'helpScoutControllerHelpscout' * - * @param \Yoast\MyYoastApiClient\Model\HelpScoutDto $helpScoutDto (required) + * @param \Yoast\MyYoastApiClient\Model\HelpScoutDto $body (required) * @param string $xHelpScoutSignature The Helpscout signature (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function helpscoutPostRequest($helpScoutDto, $xHelpScoutSignature) + protected function helpScoutControllerHelpscoutRequest($body, $xHelpScoutSignature) { - // verify the required parameter 'helpScoutDto' is set - if ($helpScoutDto === null || (is_array($helpScoutDto) && count($helpScoutDto) === 0)) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $helpScoutDto when calling helpscoutPost' + 'Missing the required parameter $body when calling helpScoutControllerHelpscout' ); } // verify the required parameter 'xHelpScoutSignature' is set if ($xHelpScoutSignature === null || (is_array($xHelpScoutSignature) && count($xHelpScoutSignature) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $xHelpScoutSignature when calling helpscoutPost' + 'Missing the required parameter $xHelpScoutSignature when calling helpScoutControllerHelpscout' ); } @@ -294,8 +293,8 @@ protected function helpscoutPostRequest($helpScoutDto, $xHelpScoutSignature) // body params $_tempBody = null; - if (isset($helpScoutDto)) { - $_tempBody = $helpScoutDto; + if (isset($body)) { + $_tempBody = $body; } if ($multipart) { @@ -313,16 +312,9 @@ protected function helpscoutPostRequest($helpScoutDto, $xHelpScoutSignature) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { diff --git a/src/Api/OrderApi.php b/src/Api/OrderApi.php index 5232d7d..81e530d 100644 --- a/src/Api/OrderApi.php +++ b/src/Api/OrderApi.php @@ -17,9 +17,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -88,37 +87,39 @@ public function getConfig() } /** - * Operation apiOrdersAutoRenewalCountGet + * Operation orderControllerExport + * + * Get orders * * @param \DateTime $startDate startDate (required) * @param \DateTime $endDate endDate (required) - * @param string $secret secret (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\AutoRenewalCountResponseDto + * @return \Yoast\MyYoastApiClient\Model\Order[] */ - public function apiOrdersAutoRenewalCountGet($startDate, $endDate, $secret) + public function orderControllerExport($startDate, $endDate) { - list($response) = $this->apiOrdersAutoRenewalCountGetWithHttpInfo($startDate, $endDate, $secret); + list($response) = $this->orderControllerExportWithHttpInfo($startDate, $endDate); return $response; } /** - * Operation apiOrdersAutoRenewalCountGetWithHttpInfo + * Operation orderControllerExportWithHttpInfo + * + * Get orders * * @param \DateTime $startDate (required) * @param \DateTime $endDate (required) - * @param string $secret (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Yoast\MyYoastApiClient\Model\AutoRenewalCountResponseDto, HTTP status code, HTTP response headers (array of strings) + * @return array of \Yoast\MyYoastApiClient\Model\Order[], HTTP status code, HTTP response headers (array of strings) */ - public function apiOrdersAutoRenewalCountGetWithHttpInfo($startDate, $endDate, $secret) + public function orderControllerExportWithHttpInfo($startDate, $endDate) { - $returnType = '\Yoast\MyYoastApiClient\Model\AutoRenewalCountResponseDto'; - $request = $this->apiOrdersAutoRenewalCountGetRequest($startDate, $endDate, $secret); + $returnType = '\Yoast\MyYoastApiClient\Model\Order[]'; + $request = $this->orderControllerExportRequest($startDate, $endDate); try { $options = $this->createHttpClientOption(); @@ -153,7 +154,7 @@ public function apiOrdersAutoRenewalCountGetWithHttpInfo($startDate, $endDate, $ $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -169,7 +170,7 @@ public function apiOrdersAutoRenewalCountGetWithHttpInfo($startDate, $endDate, $ case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Yoast\MyYoastApiClient\Model\AutoRenewalCountResponseDto', + '\Yoast\MyYoastApiClient\Model\Order[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -180,20 +181,19 @@ public function apiOrdersAutoRenewalCountGetWithHttpInfo($startDate, $endDate, $ } /** - * Operation apiOrdersAutoRenewalCountGetAsync + * Operation orderControllerExportAsync * - * + * Get orders * * @param \DateTime $startDate (required) * @param \DateTime $endDate (required) - * @param string $secret (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiOrdersAutoRenewalCountGetAsync($startDate, $endDate, $secret) + public function orderControllerExportAsync($startDate, $endDate) { - return $this->apiOrdersAutoRenewalCountGetAsyncWithHttpInfo($startDate, $endDate, $secret) + return $this->orderControllerExportAsyncWithHttpInfo($startDate, $endDate) ->then( function ($response) { return $response[0]; @@ -202,21 +202,20 @@ function ($response) { } /** - * Operation apiOrdersAutoRenewalCountGetAsyncWithHttpInfo + * Operation orderControllerExportAsyncWithHttpInfo * - * + * Get orders * * @param \DateTime $startDate (required) * @param \DateTime $endDate (required) - * @param string $secret (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiOrdersAutoRenewalCountGetAsyncWithHttpInfo($startDate, $endDate, $secret) + public function orderControllerExportAsyncWithHttpInfo($startDate, $endDate) { - $returnType = '\Yoast\MyYoastApiClient\Model\AutoRenewalCountResponseDto'; - $request = $this->apiOrdersAutoRenewalCountGetRequest($startDate, $endDate, $secret); + $returnType = '\Yoast\MyYoastApiClient\Model\Order[]'; + $request = $this->orderControllerExportRequest($startDate, $endDate); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -256,37 +255,30 @@ function ($exception) { } /** - * Create request for operation 'apiOrdersAutoRenewalCountGet' + * Create request for operation 'orderControllerExport' * * @param \DateTime $startDate (required) * @param \DateTime $endDate (required) - * @param string $secret (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiOrdersAutoRenewalCountGetRequest($startDate, $endDate, $secret) + protected function orderControllerExportRequest($startDate, $endDate) { // verify the required parameter 'startDate' is set if ($startDate === null || (is_array($startDate) && count($startDate) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $startDate when calling apiOrdersAutoRenewalCountGet' + 'Missing the required parameter $startDate when calling orderControllerExport' ); } // verify the required parameter 'endDate' is set if ($endDate === null || (is_array($endDate) && count($endDate) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $endDate when calling apiOrdersAutoRenewalCountGet' - ); - } - // verify the required parameter 'secret' is set - if ($secret === null || (is_array($secret) && count($secret) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $secret when calling apiOrdersAutoRenewalCountGet' + 'Missing the required parameter $endDate when calling orderControllerExport' ); } - $resourcePath = '/api/Orders/auto-renewal-count'; + $resourcePath = '/api/Orders/export'; $formParams = []; $queryParams = []; $headerParams = []; @@ -295,15 +287,11 @@ protected function apiOrdersAutoRenewalCountGetRequest($startDate, $endDate, $se // query params if ($startDate !== null) { - $queryParams['start_date'] = ObjectSerializer::toQueryValue($startDate); + $queryParams['start_date'] = ObjectSerializer::toQueryValue($startDate, 'date-time'); } // query params if ($endDate !== null) { - $queryParams['end_date'] = ObjectSerializer::toQueryValue($endDate); - } - // query params - if ($secret !== null) { - $queryParams['secret'] = ObjectSerializer::toQueryValue($secret); + $queryParams['end_date'] = ObjectSerializer::toQueryValue($endDate, 'date-time'); } @@ -317,7 +305,7 @@ protected function apiOrdersAutoRenewalCountGetRequest($startDate, $endDate, $se } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -325,16 +313,9 @@ protected function apiOrdersAutoRenewalCountGetRequest($startDate, $endDate, $se if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -357,11 +338,10 @@ protected function apiOrdersAutoRenewalCountGetRequest($startDate, $endDate, $se } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -384,39 +364,37 @@ protected function apiOrdersAutoRenewalCountGetRequest($startDate, $endDate, $se } /** - * Operation apiOrdersExportGet - * - * Get orders + * Operation orderControllerGetAutoRenewalCount * * @param \DateTime $startDate startDate (required) * @param \DateTime $endDate endDate (required) + * @param string $secret secret (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\Order[] + * @return \Yoast\MyYoastApiClient\Model\AutoRenewalCountResponseDto */ - public function apiOrdersExportGet($startDate, $endDate) + public function orderControllerGetAutoRenewalCount($startDate, $endDate, $secret) { - list($response) = $this->apiOrdersExportGetWithHttpInfo($startDate, $endDate); + list($response) = $this->orderControllerGetAutoRenewalCountWithHttpInfo($startDate, $endDate, $secret); return $response; } /** - * Operation apiOrdersExportGetWithHttpInfo - * - * Get orders + * Operation orderControllerGetAutoRenewalCountWithHttpInfo * * @param \DateTime $startDate (required) * @param \DateTime $endDate (required) + * @param string $secret (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Yoast\MyYoastApiClient\Model\Order[], HTTP status code, HTTP response headers (array of strings) + * @return array of \Yoast\MyYoastApiClient\Model\AutoRenewalCountResponseDto, HTTP status code, HTTP response headers (array of strings) */ - public function apiOrdersExportGetWithHttpInfo($startDate, $endDate) + public function orderControllerGetAutoRenewalCountWithHttpInfo($startDate, $endDate, $secret) { - $returnType = '\Yoast\MyYoastApiClient\Model\Order[]'; - $request = $this->apiOrdersExportGetRequest($startDate, $endDate); + $returnType = '\Yoast\MyYoastApiClient\Model\AutoRenewalCountResponseDto'; + $request = $this->orderControllerGetAutoRenewalCountRequest($startDate, $endDate, $secret); try { $options = $this->createHttpClientOption(); @@ -451,7 +429,7 @@ public function apiOrdersExportGetWithHttpInfo($startDate, $endDate) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -467,7 +445,7 @@ public function apiOrdersExportGetWithHttpInfo($startDate, $endDate) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Yoast\MyYoastApiClient\Model\Order[]', + '\Yoast\MyYoastApiClient\Model\AutoRenewalCountResponseDto', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -478,19 +456,20 @@ public function apiOrdersExportGetWithHttpInfo($startDate, $endDate) } /** - * Operation apiOrdersExportGetAsync + * Operation orderControllerGetAutoRenewalCountAsync * - * Get orders + * * * @param \DateTime $startDate (required) * @param \DateTime $endDate (required) + * @param string $secret (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiOrdersExportGetAsync($startDate, $endDate) + public function orderControllerGetAutoRenewalCountAsync($startDate, $endDate, $secret) { - return $this->apiOrdersExportGetAsyncWithHttpInfo($startDate, $endDate) + return $this->orderControllerGetAutoRenewalCountAsyncWithHttpInfo($startDate, $endDate, $secret) ->then( function ($response) { return $response[0]; @@ -499,20 +478,21 @@ function ($response) { } /** - * Operation apiOrdersExportGetAsyncWithHttpInfo + * Operation orderControllerGetAutoRenewalCountAsyncWithHttpInfo * - * Get orders + * * * @param \DateTime $startDate (required) * @param \DateTime $endDate (required) + * @param string $secret (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiOrdersExportGetAsyncWithHttpInfo($startDate, $endDate) + public function orderControllerGetAutoRenewalCountAsyncWithHttpInfo($startDate, $endDate, $secret) { - $returnType = '\Yoast\MyYoastApiClient\Model\Order[]'; - $request = $this->apiOrdersExportGetRequest($startDate, $endDate); + $returnType = '\Yoast\MyYoastApiClient\Model\AutoRenewalCountResponseDto'; + $request = $this->orderControllerGetAutoRenewalCountRequest($startDate, $endDate, $secret); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -552,30 +532,37 @@ function ($exception) { } /** - * Create request for operation 'apiOrdersExportGet' + * Create request for operation 'orderControllerGetAutoRenewalCount' * * @param \DateTime $startDate (required) * @param \DateTime $endDate (required) + * @param string $secret (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiOrdersExportGetRequest($startDate, $endDate) + protected function orderControllerGetAutoRenewalCountRequest($startDate, $endDate, $secret) { // verify the required parameter 'startDate' is set if ($startDate === null || (is_array($startDate) && count($startDate) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $startDate when calling apiOrdersExportGet' + 'Missing the required parameter $startDate when calling orderControllerGetAutoRenewalCount' ); } // verify the required parameter 'endDate' is set if ($endDate === null || (is_array($endDate) && count($endDate) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $endDate when calling apiOrdersExportGet' + 'Missing the required parameter $endDate when calling orderControllerGetAutoRenewalCount' + ); + } + // verify the required parameter 'secret' is set + if ($secret === null || (is_array($secret) && count($secret) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $secret when calling orderControllerGetAutoRenewalCount' ); } - $resourcePath = '/api/Orders/export'; + $resourcePath = '/api/Orders/auto-renewal-count'; $formParams = []; $queryParams = []; $headerParams = []; @@ -584,11 +571,15 @@ protected function apiOrdersExportGetRequest($startDate, $endDate) // query params if ($startDate !== null) { - $queryParams['start_date'] = ObjectSerializer::toQueryValue($startDate); + $queryParams['start_date'] = ObjectSerializer::toQueryValue($startDate, 'date-time'); } // query params if ($endDate !== null) { - $queryParams['end_date'] = ObjectSerializer::toQueryValue($endDate); + $queryParams['end_date'] = ObjectSerializer::toQueryValue($endDate, 'date-time'); + } + // query params + if ($secret !== null) { + $queryParams['secret'] = ObjectSerializer::toQueryValue($secret, null); } @@ -602,7 +593,7 @@ protected function apiOrdersExportGetRequest($startDate, $endDate) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -610,16 +601,9 @@ protected function apiOrdersExportGetRequest($startDate, $endDate) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -642,11 +626,10 @@ protected function apiOrdersExportGetRequest($startDate, $endDate) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -669,37 +652,37 @@ protected function apiOrdersExportGetRequest($startDate, $endDate) } /** - * Operation apiOrdersGet + * Operation orderControllerGetMany * * Get orders * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Yoast\MyYoastApiClient\Model\Order[] */ - public function apiOrdersGet($filter = null) + public function orderControllerGetMany($filter = null) { - list($response) = $this->apiOrdersGetWithHttpInfo($filter); + list($response) = $this->orderControllerGetManyWithHttpInfo($filter); return $response; } /** - * Operation apiOrdersGetWithHttpInfo + * Operation orderControllerGetManyWithHttpInfo * * Get orders * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Yoast\MyYoastApiClient\Model\Order[], HTTP status code, HTTP response headers (array of strings) */ - public function apiOrdersGetWithHttpInfo($filter = null) + public function orderControllerGetManyWithHttpInfo($filter = null) { $returnType = '\Yoast\MyYoastApiClient\Model\Order[]'; - $request = $this->apiOrdersGetRequest($filter); + $request = $this->orderControllerGetManyRequest($filter); try { $options = $this->createHttpClientOption(); @@ -734,7 +717,7 @@ public function apiOrdersGetWithHttpInfo($filter = null) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -761,18 +744,18 @@ public function apiOrdersGetWithHttpInfo($filter = null) } /** - * Operation apiOrdersGetAsync + * Operation orderControllerGetManyAsync * * Get orders * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiOrdersGetAsync($filter = null) + public function orderControllerGetManyAsync($filter = null) { - return $this->apiOrdersGetAsyncWithHttpInfo($filter) + return $this->orderControllerGetManyAsyncWithHttpInfo($filter) ->then( function ($response) { return $response[0]; @@ -781,19 +764,19 @@ function ($response) { } /** - * Operation apiOrdersGetAsyncWithHttpInfo + * Operation orderControllerGetManyAsyncWithHttpInfo * * Get orders * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiOrdersGetAsyncWithHttpInfo($filter = null) + public function orderControllerGetManyAsyncWithHttpInfo($filter = null) { $returnType = '\Yoast\MyYoastApiClient\Model\Order[]'; - $request = $this->apiOrdersGetRequest($filter); + $request = $this->orderControllerGetManyRequest($filter); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -833,14 +816,14 @@ function ($exception) { } /** - * Create request for operation 'apiOrdersGet' + * Create request for operation 'orderControllerGetMany' * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiOrdersGetRequest($filter = null) + protected function orderControllerGetManyRequest($filter = null) { $resourcePath = '/api/Orders'; @@ -852,7 +835,7 @@ protected function apiOrdersGetRequest($filter = null) // query params if ($filter !== null) { - $queryParams['filter'] = ObjectSerializer::toQueryValue($filter); + $queryParams['filter'] = ObjectSerializer::toQueryValue($filter, null); } @@ -866,7 +849,7 @@ protected function apiOrdersGetRequest($filter = null) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -874,16 +857,228 @@ protected function apiOrdersGetRequest($filter = null) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation orderControllerGetManyPaged + * + * Get orders + * + * @param object $filter Used for filtering/joining the results. (optional) + * + * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function orderControllerGetManyPaged($filter = null) + { + $this->orderControllerGetManyPagedWithHttpInfo($filter); + } + + /** + * Operation orderControllerGetManyPagedWithHttpInfo + * + * Get orders + * + * @param object $filter Used for filtering/joining the results. (optional) + * + * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function orderControllerGetManyPagedWithHttpInfo($filter = null) + { + $returnType = ''; + $request = $this->orderControllerGetManyPagedRequest($filter); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation orderControllerGetManyPagedAsync + * + * Get orders + * + * @param object $filter Used for filtering/joining the results. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function orderControllerGetManyPagedAsync($filter = null) + { + return $this->orderControllerGetManyPagedAsyncWithHttpInfo($filter) + ->then( + function ($response) { + return $response[0]; } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); + ); + } + + /** + * Operation orderControllerGetManyPagedAsyncWithHttpInfo + * + * Get orders + * + * @param object $filter Used for filtering/joining the results. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function orderControllerGetManyPagedAsyncWithHttpInfo($filter = null) + { + $returnType = ''; + $request = $this->orderControllerGetManyPagedRequest($filter); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $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(), + $response->getBody() + ); } + ); + } + + /** + * Create request for operation 'orderControllerGetManyPaged' + * + * @param object $filter Used for filtering/joining the results. (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function orderControllerGetManyPagedRequest($filter = null) + { + + $resourcePath = '/api/Orders/paged'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($filter !== null) { + $queryParams['filter'] = ObjectSerializer::toQueryValue($filter, null); + } + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + [] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + [], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -906,11 +1101,10 @@ protected function apiOrdersGetRequest($filter = null) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -933,39 +1127,39 @@ protected function apiOrdersGetRequest($filter = null) } /** - * Operation apiOrdersIdGet + * Operation orderControllerGetOne * * Get a order * * @param string $id id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Yoast\MyYoastApiClient\Model\Order */ - public function apiOrdersIdGet($id, $filter = null) + public function orderControllerGetOne($id, $filter = null) { - list($response) = $this->apiOrdersIdGetWithHttpInfo($id, $filter); + list($response) = $this->orderControllerGetOneWithHttpInfo($id, $filter); return $response; } /** - * Operation apiOrdersIdGetWithHttpInfo + * Operation orderControllerGetOneWithHttpInfo * * Get a order * * @param string $id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Yoast\MyYoastApiClient\Model\Order, HTTP status code, HTTP response headers (array of strings) */ - public function apiOrdersIdGetWithHttpInfo($id, $filter = null) + public function orderControllerGetOneWithHttpInfo($id, $filter = null) { $returnType = '\Yoast\MyYoastApiClient\Model\Order'; - $request = $this->apiOrdersIdGetRequest($id, $filter); + $request = $this->orderControllerGetOneRequest($id, $filter); try { $options = $this->createHttpClientOption(); @@ -1000,7 +1194,7 @@ public function apiOrdersIdGetWithHttpInfo($id, $filter = null) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -1027,19 +1221,19 @@ public function apiOrdersIdGetWithHttpInfo($id, $filter = null) } /** - * Operation apiOrdersIdGetAsync + * Operation orderControllerGetOneAsync * * Get a order * * @param string $id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiOrdersIdGetAsync($id, $filter = null) + public function orderControllerGetOneAsync($id, $filter = null) { - return $this->apiOrdersIdGetAsyncWithHttpInfo($id, $filter) + return $this->orderControllerGetOneAsyncWithHttpInfo($id, $filter) ->then( function ($response) { return $response[0]; @@ -1048,20 +1242,20 @@ function ($response) { } /** - * Operation apiOrdersIdGetAsyncWithHttpInfo + * Operation orderControllerGetOneAsyncWithHttpInfo * * Get a order * * @param string $id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiOrdersIdGetAsyncWithHttpInfo($id, $filter = null) + public function orderControllerGetOneAsyncWithHttpInfo($id, $filter = null) { $returnType = '\Yoast\MyYoastApiClient\Model\Order'; - $request = $this->apiOrdersIdGetRequest($id, $filter); + $request = $this->orderControllerGetOneRequest($id, $filter); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1101,20 +1295,20 @@ function ($exception) { } /** - * Create request for operation 'apiOrdersIdGet' + * Create request for operation 'orderControllerGetOne' * * @param string $id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiOrdersIdGetRequest($id, $filter = null) + protected function orderControllerGetOneRequest($id, $filter = null) { // 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 apiOrdersIdGet' + 'Missing the required parameter $id when calling orderControllerGetOne' ); } @@ -1127,7 +1321,7 @@ protected function apiOrdersIdGetRequest($id, $filter = null) // query params if ($filter !== null) { - $queryParams['filter'] = ObjectSerializer::toQueryValue($filter); + $queryParams['filter'] = ObjectSerializer::toQueryValue($filter, null); } // path params @@ -1149,7 +1343,7 @@ protected function apiOrdersIdGetRequest($id, $filter = null) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -1157,16 +1351,9 @@ protected function apiOrdersIdGetRequest($id, $filter = null) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -1189,11 +1376,10 @@ protected function apiOrdersIdGetRequest($id, $filter = null) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1216,7 +1402,7 @@ protected function apiOrdersIdGetRequest($id, $filter = null) } /** - * Operation apiOrdersIdInvoiceGet + * Operation orderControllerInvoice * * Create invoice * @@ -1226,13 +1412,13 @@ protected function apiOrdersIdGetRequest($id, $filter = null) * @throws \InvalidArgumentException * @return void */ - public function apiOrdersIdInvoiceGet($id) + public function orderControllerInvoice($id) { - $this->apiOrdersIdInvoiceGetWithHttpInfo($id); + $this->orderControllerInvoiceWithHttpInfo($id); } /** - * Operation apiOrdersIdInvoiceGetWithHttpInfo + * Operation orderControllerInvoiceWithHttpInfo * * Create invoice * @@ -1242,10 +1428,10 @@ public function apiOrdersIdInvoiceGet($id) * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function apiOrdersIdInvoiceGetWithHttpInfo($id) + public function orderControllerInvoiceWithHttpInfo($id) { $returnType = ''; - $request = $this->apiOrdersIdInvoiceGetRequest($id); + $request = $this->orderControllerInvoiceRequest($id); try { $options = $this->createHttpClientOption(); @@ -1285,7 +1471,7 @@ public function apiOrdersIdInvoiceGetWithHttpInfo($id) } /** - * Operation apiOrdersIdInvoiceGetAsync + * Operation orderControllerInvoiceAsync * * Create invoice * @@ -1294,9 +1480,9 @@ public function apiOrdersIdInvoiceGetWithHttpInfo($id) * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiOrdersIdInvoiceGetAsync($id) + public function orderControllerInvoiceAsync($id) { - return $this->apiOrdersIdInvoiceGetAsyncWithHttpInfo($id) + return $this->orderControllerInvoiceAsyncWithHttpInfo($id) ->then( function ($response) { return $response[0]; @@ -1305,7 +1491,7 @@ function ($response) { } /** - * Operation apiOrdersIdInvoiceGetAsyncWithHttpInfo + * Operation orderControllerInvoiceAsyncWithHttpInfo * * Create invoice * @@ -1314,10 +1500,10 @@ function ($response) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiOrdersIdInvoiceGetAsyncWithHttpInfo($id) + public function orderControllerInvoiceAsyncWithHttpInfo($id) { $returnType = ''; - $request = $this->apiOrdersIdInvoiceGetRequest($id); + $request = $this->orderControllerInvoiceRequest($id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1343,19 +1529,19 @@ function ($exception) { } /** - * Create request for operation 'apiOrdersIdInvoiceGet' + * Create request for operation 'orderControllerInvoice' * * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiOrdersIdInvoiceGetRequest($id) + protected function orderControllerInvoiceRequest($id) { // 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 apiOrdersIdInvoiceGet' + 'Missing the required parameter $id when calling orderControllerInvoice' ); } @@ -1381,12 +1567,12 @@ protected function apiOrdersIdInvoiceGetRequest($id) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + [] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + [], + [] ); } @@ -1394,16 +1580,9 @@ protected function apiOrdersIdInvoiceGetRequest($id) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -1426,11 +1605,10 @@ protected function apiOrdersIdInvoiceGetRequest($id) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1453,7 +1631,7 @@ protected function apiOrdersIdInvoiceGetRequest($id) } /** - * Operation apiOrdersIdRefundsRefundIdInvoiceGet + * Operation orderControllerRefundInvoice * * Creates a credit note * @@ -1464,13 +1642,13 @@ protected function apiOrdersIdInvoiceGetRequest($id) * @throws \InvalidArgumentException * @return void */ - public function apiOrdersIdRefundsRefundIdInvoiceGet($id, $refundId) + public function orderControllerRefundInvoice($id, $refundId) { - $this->apiOrdersIdRefundsRefundIdInvoiceGetWithHttpInfo($id, $refundId); + $this->orderControllerRefundInvoiceWithHttpInfo($id, $refundId); } /** - * Operation apiOrdersIdRefundsRefundIdInvoiceGetWithHttpInfo + * Operation orderControllerRefundInvoiceWithHttpInfo * * Creates a credit note * @@ -1481,10 +1659,10 @@ public function apiOrdersIdRefundsRefundIdInvoiceGet($id, $refundId) * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function apiOrdersIdRefundsRefundIdInvoiceGetWithHttpInfo($id, $refundId) + public function orderControllerRefundInvoiceWithHttpInfo($id, $refundId) { $returnType = ''; - $request = $this->apiOrdersIdRefundsRefundIdInvoiceGetRequest($id, $refundId); + $request = $this->orderControllerRefundInvoiceRequest($id, $refundId); try { $options = $this->createHttpClientOption(); @@ -1524,7 +1702,7 @@ public function apiOrdersIdRefundsRefundIdInvoiceGetWithHttpInfo($id, $refundId) } /** - * Operation apiOrdersIdRefundsRefundIdInvoiceGetAsync + * Operation orderControllerRefundInvoiceAsync * * Creates a credit note * @@ -1534,9 +1712,9 @@ public function apiOrdersIdRefundsRefundIdInvoiceGetWithHttpInfo($id, $refundId) * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiOrdersIdRefundsRefundIdInvoiceGetAsync($id, $refundId) + public function orderControllerRefundInvoiceAsync($id, $refundId) { - return $this->apiOrdersIdRefundsRefundIdInvoiceGetAsyncWithHttpInfo($id, $refundId) + return $this->orderControllerRefundInvoiceAsyncWithHttpInfo($id, $refundId) ->then( function ($response) { return $response[0]; @@ -1545,7 +1723,7 @@ function ($response) { } /** - * Operation apiOrdersIdRefundsRefundIdInvoiceGetAsyncWithHttpInfo + * Operation orderControllerRefundInvoiceAsyncWithHttpInfo * * Creates a credit note * @@ -1555,10 +1733,10 @@ function ($response) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiOrdersIdRefundsRefundIdInvoiceGetAsyncWithHttpInfo($id, $refundId) + public function orderControllerRefundInvoiceAsyncWithHttpInfo($id, $refundId) { $returnType = ''; - $request = $this->apiOrdersIdRefundsRefundIdInvoiceGetRequest($id, $refundId); + $request = $this->orderControllerRefundInvoiceRequest($id, $refundId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1584,7 +1762,7 @@ function ($exception) { } /** - * Create request for operation 'apiOrdersIdRefundsRefundIdInvoiceGet' + * Create request for operation 'orderControllerRefundInvoice' * * @param string $id (required) * @param string $refundId (required) @@ -1592,18 +1770,18 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiOrdersIdRefundsRefundIdInvoiceGetRequest($id, $refundId) + protected function orderControllerRefundInvoiceRequest($id, $refundId) { // 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 apiOrdersIdRefundsRefundIdInvoiceGet' + 'Missing the required parameter $id when calling orderControllerRefundInvoice' ); } // verify the required parameter 'refundId' is set if ($refundId === null || (is_array($refundId) && count($refundId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $refundId when calling apiOrdersIdRefundsRefundIdInvoiceGet' + 'Missing the required parameter $refundId when calling orderControllerRefundInvoice' ); } @@ -1637,12 +1815,12 @@ protected function apiOrdersIdRefundsRefundIdInvoiceGetRequest($id, $refundId) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + [] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + [], + [] ); } @@ -1650,16 +1828,9 @@ protected function apiOrdersIdRefundsRefundIdInvoiceGetRequest($id, $refundId) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -1682,11 +1853,10 @@ protected function apiOrdersIdRefundsRefundIdInvoiceGetRequest($id, $refundId) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { diff --git a/src/Api/PackagesApi.php b/src/Api/PackagesApi.php index c7b3620..a0db08b 100644 --- a/src/Api/PackagesApi.php +++ b/src/Api/PackagesApi.php @@ -17,9 +17,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -88,7 +87,7 @@ public function getConfig() } /** - * Operation packagesDistOrgNameArchiveZipGet + * Operation packagesControllerServeArchiveZIP * * Serves an .zip of the plugin. * @@ -98,16 +97,16 @@ public function getConfig() * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \SplFileObject + * @return string */ - public function packagesDistOrgNameArchiveZipGet($org, $archive, $name) + public function packagesControllerServeArchiveZIP($org, $archive, $name) { - list($response) = $this->packagesDistOrgNameArchiveZipGetWithHttpInfo($org, $archive, $name); + list($response) = $this->packagesControllerServeArchiveZIPWithHttpInfo($org, $archive, $name); return $response; } /** - * Operation packagesDistOrgNameArchiveZipGetWithHttpInfo + * Operation packagesControllerServeArchiveZIPWithHttpInfo * * Serves an .zip of the plugin. * @@ -117,12 +116,12 @@ public function packagesDistOrgNameArchiveZipGet($org, $archive, $name) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \SplFileObject, HTTP status code, HTTP response headers (array of strings) + * @return array of string, HTTP status code, HTTP response headers (array of strings) */ - public function packagesDistOrgNameArchiveZipGetWithHttpInfo($org, $archive, $name) + public function packagesControllerServeArchiveZIPWithHttpInfo($org, $archive, $name) { - $returnType = '\SplFileObject'; - $request = $this->packagesDistOrgNameArchiveZipGetRequest($org, $archive, $name); + $returnType = 'string'; + $request = $this->packagesControllerServeArchiveZIPRequest($org, $archive, $name); try { $options = $this->createHttpClientOption(); @@ -157,7 +156,7 @@ public function packagesDistOrgNameArchiveZipGetWithHttpInfo($org, $archive, $na $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -173,7 +172,7 @@ public function packagesDistOrgNameArchiveZipGetWithHttpInfo($org, $archive, $na case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\SplFileObject', + 'string', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -184,7 +183,7 @@ public function packagesDistOrgNameArchiveZipGetWithHttpInfo($org, $archive, $na } /** - * Operation packagesDistOrgNameArchiveZipGetAsync + * Operation packagesControllerServeArchiveZIPAsync * * Serves an .zip of the plugin. * @@ -195,9 +194,9 @@ public function packagesDistOrgNameArchiveZipGetWithHttpInfo($org, $archive, $na * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function packagesDistOrgNameArchiveZipGetAsync($org, $archive, $name) + public function packagesControllerServeArchiveZIPAsync($org, $archive, $name) { - return $this->packagesDistOrgNameArchiveZipGetAsyncWithHttpInfo($org, $archive, $name) + return $this->packagesControllerServeArchiveZIPAsyncWithHttpInfo($org, $archive, $name) ->then( function ($response) { return $response[0]; @@ -206,7 +205,7 @@ function ($response) { } /** - * Operation packagesDistOrgNameArchiveZipGetAsyncWithHttpInfo + * Operation packagesControllerServeArchiveZIPAsyncWithHttpInfo * * Serves an .zip of the plugin. * @@ -217,10 +216,10 @@ function ($response) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function packagesDistOrgNameArchiveZipGetAsyncWithHttpInfo($org, $archive, $name) + public function packagesControllerServeArchiveZIPAsyncWithHttpInfo($org, $archive, $name) { - $returnType = '\SplFileObject'; - $request = $this->packagesDistOrgNameArchiveZipGetRequest($org, $archive, $name); + $returnType = 'string'; + $request = $this->packagesControllerServeArchiveZIPRequest($org, $archive, $name); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -260,7 +259,7 @@ function ($exception) { } /** - * Create request for operation 'packagesDistOrgNameArchiveZipGet' + * Create request for operation 'packagesControllerServeArchiveZIP' * * @param string $org (required) * @param string $archive (required) @@ -269,24 +268,24 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function packagesDistOrgNameArchiveZipGetRequest($org, $archive, $name) + protected function packagesControllerServeArchiveZIPRequest($org, $archive, $name) { // verify the required parameter 'org' is set if ($org === null || (is_array($org) && count($org) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $org when calling packagesDistOrgNameArchiveZipGet' + 'Missing the required parameter $org when calling packagesControllerServeArchiveZIP' ); } // verify the required parameter 'archive' is set if ($archive === null || (is_array($archive) && count($archive) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $archive when calling packagesDistOrgNameArchiveZipGet' + 'Missing the required parameter $archive when calling packagesControllerServeArchiveZIP' ); } // verify the required parameter 'name' is set if ($name === null || (is_array($name) && count($name) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $name when calling packagesDistOrgNameArchiveZipGet' + 'Missing the required parameter $name when calling packagesControllerServeArchiveZIP' ); } @@ -333,7 +332,7 @@ protected function packagesDistOrgNameArchiveZipGetRequest($org, $archive, $name } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -341,17 +340,253 @@ protected function packagesDistOrgNameArchiveZipGetRequest($org, $archive, $name if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation packagesControllerServePackagesJSON + * + * Serves the general packages.json file. + * + * + * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return string + */ + public function packagesControllerServePackagesJSON() + { + list($response) = $this->packagesControllerServePackagesJSONWithHttpInfo(); + return $response; + } + + /** + * Operation packagesControllerServePackagesJSONWithHttpInfo + * + * Serves the general packages.json file. + * + * + * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of string, HTTP status code, HTTP response headers (array of strings) + */ + public function packagesControllerServePackagesJSONWithHttpInfo() + { + $returnType = 'string'; + $request = $this->packagesControllerServePackagesJSONRequest(); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if (!in_array($returnType, ['string','integer','bool'])) { + $content = json_decode($content); } } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'string', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation packagesControllerServePackagesJSONAsync + * + * Serves the general packages.json file. + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function packagesControllerServePackagesJSONAsync() + { + return $this->packagesControllerServePackagesJSONAsyncWithHttpInfo() + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation packagesControllerServePackagesJSONAsyncWithHttpInfo + * + * Serves the general packages.json file. + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function packagesControllerServePackagesJSONAsyncWithHttpInfo() + { + $returnType = 'string'; + $request = $this->packagesControllerServePackagesJSONRequest(); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + 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(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'packagesControllerServePackagesJSON' + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function packagesControllerServePackagesJSONRequest() + { + + $resourcePath = '/packages/packages.json'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; @@ -395,39 +630,39 @@ protected function packagesDistOrgNameArchiveZipGetRequest($org, $archive, $name } /** - * Operation packagesPOrgNameAndHashJsonGet + * Operation packagesControllerServeProvider2JSON * * Serves the requested provider.json * * @param string $org org (required) - * @param string $nameAndHash The package name and package hash separated by a $ character (required) + * @param string $name The package name, optionally suffixed with -dev (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \SplFileObject + * @return string */ - public function packagesPOrgNameAndHashJsonGet($org, $nameAndHash) + public function packagesControllerServeProvider2JSON($org, $name) { - list($response) = $this->packagesPOrgNameAndHashJsonGetWithHttpInfo($org, $nameAndHash); + list($response) = $this->packagesControllerServeProvider2JSONWithHttpInfo($org, $name); return $response; } /** - * Operation packagesPOrgNameAndHashJsonGetWithHttpInfo + * Operation packagesControllerServeProvider2JSONWithHttpInfo * * Serves the requested provider.json * * @param string $org (required) - * @param string $nameAndHash The package name and package hash separated by a $ character (required) + * @param string $name The package name, optionally suffixed with -dev (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \SplFileObject, HTTP status code, HTTP response headers (array of strings) + * @return array of string, HTTP status code, HTTP response headers (array of strings) */ - public function packagesPOrgNameAndHashJsonGetWithHttpInfo($org, $nameAndHash) + public function packagesControllerServeProvider2JSONWithHttpInfo($org, $name) { - $returnType = '\SplFileObject'; - $request = $this->packagesPOrgNameAndHashJsonGetRequest($org, $nameAndHash); + $returnType = 'string'; + $request = $this->packagesControllerServeProvider2JSONRequest($org, $name); try { $options = $this->createHttpClientOption(); @@ -462,7 +697,7 @@ public function packagesPOrgNameAndHashJsonGetWithHttpInfo($org, $nameAndHash) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -478,7 +713,7 @@ public function packagesPOrgNameAndHashJsonGetWithHttpInfo($org, $nameAndHash) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\SplFileObject', + 'string', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -489,19 +724,19 @@ public function packagesPOrgNameAndHashJsonGetWithHttpInfo($org, $nameAndHash) } /** - * Operation packagesPOrgNameAndHashJsonGetAsync + * Operation packagesControllerServeProvider2JSONAsync * * Serves the requested provider.json * * @param string $org (required) - * @param string $nameAndHash The package name and package hash separated by a $ character (required) + * @param string $name The package name, optionally suffixed with -dev (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function packagesPOrgNameAndHashJsonGetAsync($org, $nameAndHash) + public function packagesControllerServeProvider2JSONAsync($org, $name) { - return $this->packagesPOrgNameAndHashJsonGetAsyncWithHttpInfo($org, $nameAndHash) + return $this->packagesControllerServeProvider2JSONAsyncWithHttpInfo($org, $name) ->then( function ($response) { return $response[0]; @@ -510,20 +745,20 @@ function ($response) { } /** - * Operation packagesPOrgNameAndHashJsonGetAsyncWithHttpInfo + * Operation packagesControllerServeProvider2JSONAsyncWithHttpInfo * * Serves the requested provider.json * * @param string $org (required) - * @param string $nameAndHash The package name and package hash separated by a $ character (required) + * @param string $name The package name, optionally suffixed with -dev (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function packagesPOrgNameAndHashJsonGetAsyncWithHttpInfo($org, $nameAndHash) + public function packagesControllerServeProvider2JSONAsyncWithHttpInfo($org, $name) { - $returnType = '\SplFileObject'; - $request = $this->packagesPOrgNameAndHashJsonGetRequest($org, $nameAndHash); + $returnType = 'string'; + $request = $this->packagesControllerServeProvider2JSONRequest($org, $name); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -563,30 +798,30 @@ function ($exception) { } /** - * Create request for operation 'packagesPOrgNameAndHashJsonGet' + * Create request for operation 'packagesControllerServeProvider2JSON' * * @param string $org (required) - * @param string $nameAndHash The package name and package hash separated by a $ character (required) + * @param string $name The package name, optionally suffixed with -dev (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function packagesPOrgNameAndHashJsonGetRequest($org, $nameAndHash) + protected function packagesControllerServeProvider2JSONRequest($org, $name) { // verify the required parameter 'org' is set if ($org === null || (is_array($org) && count($org) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $org when calling packagesPOrgNameAndHashJsonGet' + 'Missing the required parameter $org when calling packagesControllerServeProvider2JSON' ); } - // verify the required parameter 'nameAndHash' is set - if ($nameAndHash === null || (is_array($nameAndHash) && count($nameAndHash) === 0)) { + // verify the required parameter 'name' is set + if ($name === null || (is_array($name) && count($name) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $nameAndHash when calling packagesPOrgNameAndHashJsonGet' + 'Missing the required parameter $name when calling packagesControllerServeProvider2JSON' ); } - $resourcePath = '/packages/p/{org}/{nameAndHash}.json'; + $resourcePath = '/packages/p2/{org}/{name}.json'; $formParams = []; $queryParams = []; $headerParams = []; @@ -603,10 +838,10 @@ protected function packagesPOrgNameAndHashJsonGetRequest($org, $nameAndHash) ); } // path params - if ($nameAndHash !== null) { + if ($name !== null) { $resourcePath = str_replace( - '{' . 'nameAndHash' . '}', - ObjectSerializer::toPathValue($nameAndHash), + '{' . 'name' . '}', + ObjectSerializer::toPathValue($name), $resourcePath ); } @@ -621,7 +856,7 @@ protected function packagesPOrgNameAndHashJsonGetRequest($org, $nameAndHash) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -629,16 +864,9 @@ protected function packagesPOrgNameAndHashJsonGetRequest($org, $nameAndHash) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -683,35 +911,39 @@ protected function packagesPOrgNameAndHashJsonGetRequest($org, $nameAndHash) } /** - * Operation packagesPackagesJsonGet + * Operation packagesControllerServeProviderJSON * - * Serves the general packages.json file. + * Serves the requested provider.json * + * @param string $org org (required) + * @param string $nameAndHash The package name and package hash separated by a $ character (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \SplFileObject + * @return string */ - public function packagesPackagesJsonGet() + public function packagesControllerServeProviderJSON($org, $nameAndHash) { - list($response) = $this->packagesPackagesJsonGetWithHttpInfo(); + list($response) = $this->packagesControllerServeProviderJSONWithHttpInfo($org, $nameAndHash); return $response; } /** - * Operation packagesPackagesJsonGetWithHttpInfo + * Operation packagesControllerServeProviderJSONWithHttpInfo * - * Serves the general packages.json file. + * Serves the requested provider.json * + * @param string $org (required) + * @param string $nameAndHash The package name and package hash separated by a $ character (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \SplFileObject, HTTP status code, HTTP response headers (array of strings) + * @return array of string, HTTP status code, HTTP response headers (array of strings) */ - public function packagesPackagesJsonGetWithHttpInfo() + public function packagesControllerServeProviderJSONWithHttpInfo($org, $nameAndHash) { - $returnType = '\SplFileObject'; - $request = $this->packagesPackagesJsonGetRequest(); + $returnType = 'string'; + $request = $this->packagesControllerServeProviderJSONRequest($org, $nameAndHash); try { $options = $this->createHttpClientOption(); @@ -746,7 +978,7 @@ public function packagesPackagesJsonGetWithHttpInfo() $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -762,7 +994,7 @@ public function packagesPackagesJsonGetWithHttpInfo() case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\SplFileObject', + 'string', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -773,17 +1005,19 @@ public function packagesPackagesJsonGetWithHttpInfo() } /** - * Operation packagesPackagesJsonGetAsync + * Operation packagesControllerServeProviderJSONAsync * - * Serves the general packages.json file. + * Serves the requested provider.json * + * @param string $org (required) + * @param string $nameAndHash The package name and package hash separated by a $ character (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function packagesPackagesJsonGetAsync() + public function packagesControllerServeProviderJSONAsync($org, $nameAndHash) { - return $this->packagesPackagesJsonGetAsyncWithHttpInfo() + return $this->packagesControllerServeProviderJSONAsyncWithHttpInfo($org, $nameAndHash) ->then( function ($response) { return $response[0]; @@ -792,18 +1026,20 @@ function ($response) { } /** - * Operation packagesPackagesJsonGetAsyncWithHttpInfo + * Operation packagesControllerServeProviderJSONAsyncWithHttpInfo * - * Serves the general packages.json file. + * Serves the requested provider.json * + * @param string $org (required) + * @param string $nameAndHash The package name and package hash separated by a $ character (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function packagesPackagesJsonGetAsyncWithHttpInfo() + public function packagesControllerServeProviderJSONAsyncWithHttpInfo($org, $nameAndHash) { - $returnType = '\SplFileObject'; - $request = $this->packagesPackagesJsonGetRequest(); + $returnType = 'string'; + $request = $this->packagesControllerServeProviderJSONRequest($org, $nameAndHash); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -843,16 +1079,30 @@ function ($exception) { } /** - * Create request for operation 'packagesPackagesJsonGet' + * Create request for operation 'packagesControllerServeProviderJSON' * + * @param string $org (required) + * @param string $nameAndHash The package name and package hash separated by a $ character (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function packagesPackagesJsonGetRequest() + protected function packagesControllerServeProviderJSONRequest($org, $nameAndHash) { + // verify the required parameter 'org' is set + if ($org === null || (is_array($org) && count($org) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $org when calling packagesControllerServeProviderJSON' + ); + } + // verify the required parameter 'nameAndHash' is set + if ($nameAndHash === null || (is_array($nameAndHash) && count($nameAndHash) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $nameAndHash when calling packagesControllerServeProviderJSON' + ); + } - $resourcePath = '/packages/packages.json'; + $resourcePath = '/packages/p/{org}/{nameAndHash}.json'; $formParams = []; $queryParams = []; $headerParams = []; @@ -860,6 +1110,22 @@ protected function packagesPackagesJsonGetRequest() $multipart = false; + // path params + if ($org !== null) { + $resourcePath = str_replace( + '{' . 'org' . '}', + ObjectSerializer::toPathValue($org), + $resourcePath + ); + } + // path params + if ($nameAndHash !== null) { + $resourcePath = str_replace( + '{' . 'nameAndHash' . '}', + ObjectSerializer::toPathValue($nameAndHash), + $resourcePath + ); + } // body params $_tempBody = null; @@ -871,7 +1137,7 @@ protected function packagesPackagesJsonGetRequest() } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -879,16 +1145,9 @@ protected function packagesPackagesJsonGetRequest() if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { diff --git a/src/Api/ProductApi.php b/src/Api/ProductApi.php index 47ac053..03ea1a3 100644 --- a/src/Api/ProductApi.php +++ b/src/Api/ProductApi.php @@ -17,9 +17,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -88,37 +87,32 @@ public function getConfig() } /** - * Operation apiProductsGet - * - * Get products + * Operation productControllerDeleteOne * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param string $id id (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\Product[] + * @return void */ - public function apiProductsGet($filter = null) + public function productControllerDeleteOne($id) { - list($response) = $this->apiProductsGetWithHttpInfo($filter); - return $response; + $this->productControllerDeleteOneWithHttpInfo($id); } /** - * Operation apiProductsGetWithHttpInfo + * Operation productControllerDeleteOneWithHttpInfo * - * Get products - * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param string $id (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Yoast\MyYoastApiClient\Model\Product[], HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function apiProductsGetWithHttpInfo($filter = null) + public function productControllerDeleteOneWithHttpInfo($id) { - $returnType = '\Yoast\MyYoastApiClient\Model\Product[]'; - $request = $this->apiProductsGetRequest($filter); + $returnType = ''; + $request = $this->productControllerDeleteOneRequest($id); try { $options = $this->createHttpClientOption(); @@ -148,50 +142,28 @@ public function apiProductsGetWithHttpInfo($filter = null) ); } - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Yoast\MyYoastApiClient\Model\Product[]', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; } throw $e; } } /** - * Operation apiProductsGetAsync + * Operation productControllerDeleteOneAsync * - * Get products + * * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiProductsGetAsync($filter = null) + public function productControllerDeleteOneAsync($id) { - return $this->apiProductsGetAsyncWithHttpInfo($filter) + return $this->productControllerDeleteOneAsyncWithHttpInfo($id) ->then( function ($response) { return $response[0]; @@ -200,39 +172,25 @@ function ($response) { } /** - * Operation apiProductsGetAsyncWithHttpInfo + * Operation productControllerDeleteOneAsyncWithHttpInfo * - * Get products + * * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiProductsGetAsyncWithHttpInfo($filter = null) + public function productControllerDeleteOneAsyncWithHttpInfo($id) { - $returnType = '\Yoast\MyYoastApiClient\Model\Product[]'; - $request = $this->apiProductsGetRequest($filter); + $returnType = ''; + $request = $this->productControllerDeleteOneRequest($id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -252,40 +210,50 @@ function ($exception) { } /** - * Create request for operation 'apiProductsGet' + * Create request for operation 'productControllerDeleteOne' * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiProductsGetRequest($filter = null) + protected function productControllerDeleteOneRequest($id) { + // 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 productControllerDeleteOne' + ); + } - $resourcePath = '/api/Products'; + $resourcePath = '/api/Products/{productId}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if ($filter !== null) { - $queryParams['filter'] = ObjectSerializer::toQueryValue($filter); - } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } // body params $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + [] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + [], + [] ); } @@ -293,16 +261,9 @@ protected function apiProductsGetRequest($filter = null) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -339,7 +300,7 @@ protected function apiProductsGetRequest($filter = null) $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'GET', + 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -347,39 +308,37 @@ protected function apiProductsGetRequest($filter = null) } /** - * Operation apiProductsIdGet + * Operation productControllerGetMany * - * Get a product + * Get products * - * @param string $id id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\Product + * @return \Yoast\MyYoastApiClient\Model\Product[] */ - public function apiProductsIdGet($id, $filter = null) + public function productControllerGetMany($filter = null) { - list($response) = $this->apiProductsIdGetWithHttpInfo($id, $filter); + list($response) = $this->productControllerGetManyWithHttpInfo($filter); return $response; } /** - * Operation apiProductsIdGetWithHttpInfo + * Operation productControllerGetManyWithHttpInfo * - * Get a product + * Get products * - * @param string $id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Yoast\MyYoastApiClient\Model\Product, HTTP status code, HTTP response headers (array of strings) + * @return array of \Yoast\MyYoastApiClient\Model\Product[], HTTP status code, HTTP response headers (array of strings) */ - public function apiProductsIdGetWithHttpInfo($id, $filter = null) + public function productControllerGetManyWithHttpInfo($filter = null) { - $returnType = '\Yoast\MyYoastApiClient\Model\Product'; - $request = $this->apiProductsIdGetRequest($id, $filter); + $returnType = '\Yoast\MyYoastApiClient\Model\Product[]'; + $request = $this->productControllerGetManyRequest($filter); try { $options = $this->createHttpClientOption(); @@ -414,7 +373,7 @@ public function apiProductsIdGetWithHttpInfo($id, $filter = null) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -430,7 +389,7 @@ public function apiProductsIdGetWithHttpInfo($id, $filter = null) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Yoast\MyYoastApiClient\Model\Product', + '\Yoast\MyYoastApiClient\Model\Product[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -441,19 +400,18 @@ public function apiProductsIdGetWithHttpInfo($id, $filter = null) } /** - * Operation apiProductsIdGetAsync + * Operation productControllerGetManyAsync * - * Get a product + * Get products * - * @param string $id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiProductsIdGetAsync($id, $filter = null) + public function productControllerGetManyAsync($filter = null) { - return $this->apiProductsIdGetAsyncWithHttpInfo($id, $filter) + return $this->productControllerGetManyAsyncWithHttpInfo($filter) ->then( function ($response) { return $response[0]; @@ -462,20 +420,19 @@ function ($response) { } /** - * Operation apiProductsIdGetAsyncWithHttpInfo + * Operation productControllerGetManyAsyncWithHttpInfo * - * Get a product + * Get products * - * @param string $id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiProductsIdGetAsyncWithHttpInfo($id, $filter = null) + public function productControllerGetManyAsyncWithHttpInfo($filter = null) { - $returnType = '\Yoast\MyYoastApiClient\Model\Product'; - $request = $this->apiProductsIdGetRequest($id, $filter); + $returnType = '\Yoast\MyYoastApiClient\Model\Product[]'; + $request = $this->productControllerGetManyRequest($filter); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -515,24 +472,17 @@ function ($exception) { } /** - * Create request for operation 'apiProductsIdGet' + * Create request for operation 'productControllerGetMany' * - * @param string $id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiProductsIdGetRequest($id, $filter = null) + protected function productControllerGetManyRequest($filter = null) { - // 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 apiProductsIdGet' - ); - } - $resourcePath = '/api/Products/{id}'; + $resourcePath = '/api/Products'; $formParams = []; $queryParams = []; $headerParams = []; @@ -541,17 +491,9 @@ protected function apiProductsIdGetRequest($id, $filter = null) // query params if ($filter !== null) { - $queryParams['filter'] = ObjectSerializer::toQueryValue($filter); + $queryParams['filter'] = ObjectSerializer::toQueryValue($filter, null); } - // path params - if ($id !== null) { - $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), - $resourcePath - ); - } // body params $_tempBody = null; @@ -563,7 +505,7 @@ protected function apiProductsIdGetRequest($id, $filter = null) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -571,16 +513,9 @@ protected function apiProductsIdGetRequest($id, $filter = null) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -625,32 +560,39 @@ protected function apiProductsIdGetRequest($id, $filter = null) } /** - * Operation apiProductsProductIdDelete + * Operation productControllerGetOne + * + * Get a product * * @param string $id id (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return \Yoast\MyYoastApiClient\Model\Product */ - public function apiProductsProductIdDelete($id) + public function productControllerGetOne($id, $filter = null) { - $this->apiProductsProductIdDeleteWithHttpInfo($id); + list($response) = $this->productControllerGetOneWithHttpInfo($id, $filter); + return $response; } /** - * Operation apiProductsProductIdDeleteWithHttpInfo + * Operation productControllerGetOneWithHttpInfo + * + * Get a product * * @param string $id (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of \Yoast\MyYoastApiClient\Model\Product, HTTP status code, HTTP response headers (array of strings) */ - public function apiProductsProductIdDeleteWithHttpInfo($id) + public function productControllerGetOneWithHttpInfo($id, $filter = null) { - $returnType = ''; - $request = $this->apiProductsProductIdDeleteRequest($id); + $returnType = '\Yoast\MyYoastApiClient\Model\Product'; + $request = $this->productControllerGetOneRequest($id, $filter); try { $options = $this->createHttpClientOption(); @@ -680,28 +622,51 @@ public function apiProductsProductIdDeleteWithHttpInfo($id) ); } - return [null, $statusCode, $response->getHeaders()]; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if (!in_array($returnType, ['string','integer','bool'])) { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; } catch (ApiException $e) { switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Yoast\MyYoastApiClient\Model\Product', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } } /** - * Operation apiProductsProductIdDeleteAsync + * Operation productControllerGetOneAsync * - * + * Get a product * * @param string $id (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiProductsProductIdDeleteAsync($id) + public function productControllerGetOneAsync($id, $filter = null) { - return $this->apiProductsProductIdDeleteAsyncWithHttpInfo($id) + return $this->productControllerGetOneAsyncWithHttpInfo($id, $filter) ->then( function ($response) { return $response[0]; @@ -710,25 +675,40 @@ function ($response) { } /** - * Operation apiProductsProductIdDeleteAsyncWithHttpInfo + * Operation productControllerGetOneAsyncWithHttpInfo * - * + * Get a product * * @param string $id (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiProductsProductIdDeleteAsyncWithHttpInfo($id) + public function productControllerGetOneAsyncWithHttpInfo($id, $filter = null) { - $returnType = ''; - $request = $this->apiProductsProductIdDeleteRequest($id); + $returnType = '\Yoast\MyYoastApiClient\Model\Product'; + $request = $this->productControllerGetOneRequest($id, $filter); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -748,29 +728,34 @@ function ($exception) { } /** - * Create request for operation 'apiProductsProductIdDelete' + * Create request for operation 'productControllerGetOne' * * @param string $id (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiProductsProductIdDeleteRequest($id) + protected function productControllerGetOneRequest($id, $filter = null) { // 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 apiProductsProductIdDelete' + 'Missing the required parameter $id when calling productControllerGetOne' ); } - $resourcePath = '/api/Products/{productId}'; + $resourcePath = '/api/Products/{id}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + if ($filter !== null) { + $queryParams['filter'] = ObjectSerializer::toQueryValue($filter, null); + } // path params if ($id !== null) { @@ -791,7 +776,7 @@ protected function apiProductsProductIdDeleteRequest($id) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -799,16 +784,9 @@ protected function apiProductsProductIdDeleteRequest($id) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -845,7 +823,7 @@ protected function apiProductsProductIdDeleteRequest($id) $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'DELETE', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -853,7 +831,7 @@ protected function apiProductsProductIdDeleteRequest($id) } /** - * Operation apiProductsWordpressPluginVersionDetailsGet + * Operation productControllerPluginVersionDetails * * @param string $password password (optional) * @@ -861,13 +839,13 @@ protected function apiProductsProductIdDeleteRequest($id) * @throws \InvalidArgumentException * @return void */ - public function apiProductsWordpressPluginVersionDetailsGet($password = null) + public function productControllerPluginVersionDetails($password = null) { - $this->apiProductsWordpressPluginVersionDetailsGetWithHttpInfo($password); + $this->productControllerPluginVersionDetailsWithHttpInfo($password); } /** - * Operation apiProductsWordpressPluginVersionDetailsGetWithHttpInfo + * Operation productControllerPluginVersionDetailsWithHttpInfo * * @param string $password (optional) * @@ -875,10 +853,10 @@ public function apiProductsWordpressPluginVersionDetailsGet($password = null) * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function apiProductsWordpressPluginVersionDetailsGetWithHttpInfo($password = null) + public function productControllerPluginVersionDetailsWithHttpInfo($password = null) { $returnType = ''; - $request = $this->apiProductsWordpressPluginVersionDetailsGetRequest($password); + $request = $this->productControllerPluginVersionDetailsRequest($password); try { $options = $this->createHttpClientOption(); @@ -918,7 +896,7 @@ public function apiProductsWordpressPluginVersionDetailsGetWithHttpInfo($passwor } /** - * Operation apiProductsWordpressPluginVersionDetailsGetAsync + * Operation productControllerPluginVersionDetailsAsync * * * @@ -927,9 +905,9 @@ public function apiProductsWordpressPluginVersionDetailsGetWithHttpInfo($passwor * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiProductsWordpressPluginVersionDetailsGetAsync($password = null) + public function productControllerPluginVersionDetailsAsync($password = null) { - return $this->apiProductsWordpressPluginVersionDetailsGetAsyncWithHttpInfo($password) + return $this->productControllerPluginVersionDetailsAsyncWithHttpInfo($password) ->then( function ($response) { return $response[0]; @@ -938,7 +916,7 @@ function ($response) { } /** - * Operation apiProductsWordpressPluginVersionDetailsGetAsyncWithHttpInfo + * Operation productControllerPluginVersionDetailsAsyncWithHttpInfo * * * @@ -947,10 +925,10 @@ function ($response) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiProductsWordpressPluginVersionDetailsGetAsyncWithHttpInfo($password = null) + public function productControllerPluginVersionDetailsAsyncWithHttpInfo($password = null) { $returnType = ''; - $request = $this->apiProductsWordpressPluginVersionDetailsGetRequest($password); + $request = $this->productControllerPluginVersionDetailsRequest($password); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -976,14 +954,14 @@ function ($exception) { } /** - * Create request for operation 'apiProductsWordpressPluginVersionDetailsGet' + * Create request for operation 'productControllerPluginVersionDetails' * * @param string $password (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiProductsWordpressPluginVersionDetailsGetRequest($password = null) + protected function productControllerPluginVersionDetailsRequest($password = null) { $resourcePath = '/api/Products/wordpressPluginVersionDetails'; @@ -995,7 +973,7 @@ protected function apiProductsWordpressPluginVersionDetailsGetRequest($password // query params if ($password !== null) { - $queryParams['password'] = ObjectSerializer::toQueryValue($password); + $queryParams['password'] = ObjectSerializer::toQueryValue($password, null); } @@ -1004,12 +982,12 @@ protected function apiProductsWordpressPluginVersionDetailsGetRequest($password if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + [] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + [], + [] ); } @@ -1017,16 +995,9 @@ protected function apiProductsWordpressPluginVersionDetailsGetRequest($password if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { diff --git a/src/Api/ProductGroupApi.php b/src/Api/ProductGroupApi.php index 617dd35..1a2192f 100644 --- a/src/Api/ProductGroupApi.php +++ b/src/Api/ProductGroupApi.php @@ -17,9 +17,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -88,37 +87,37 @@ public function getConfig() } /** - * Operation apiProductGroupsGet + * Operation productGroupControllerGetMany * * Get productgroups * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Yoast\MyYoastApiClient\Model\ProductGroup[] */ - public function apiProductGroupsGet($filter = null) + public function productGroupControllerGetMany($filter = null) { - list($response) = $this->apiProductGroupsGetWithHttpInfo($filter); + list($response) = $this->productGroupControllerGetManyWithHttpInfo($filter); return $response; } /** - * Operation apiProductGroupsGetWithHttpInfo + * Operation productGroupControllerGetManyWithHttpInfo * * Get productgroups * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Yoast\MyYoastApiClient\Model\ProductGroup[], HTTP status code, HTTP response headers (array of strings) */ - public function apiProductGroupsGetWithHttpInfo($filter = null) + public function productGroupControllerGetManyWithHttpInfo($filter = null) { $returnType = '\Yoast\MyYoastApiClient\Model\ProductGroup[]'; - $request = $this->apiProductGroupsGetRequest($filter); + $request = $this->productGroupControllerGetManyRequest($filter); try { $options = $this->createHttpClientOption(); @@ -153,7 +152,7 @@ public function apiProductGroupsGetWithHttpInfo($filter = null) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -180,18 +179,18 @@ public function apiProductGroupsGetWithHttpInfo($filter = null) } /** - * Operation apiProductGroupsGetAsync + * Operation productGroupControllerGetManyAsync * * Get productgroups * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiProductGroupsGetAsync($filter = null) + public function productGroupControllerGetManyAsync($filter = null) { - return $this->apiProductGroupsGetAsyncWithHttpInfo($filter) + return $this->productGroupControllerGetManyAsyncWithHttpInfo($filter) ->then( function ($response) { return $response[0]; @@ -200,19 +199,19 @@ function ($response) { } /** - * Operation apiProductGroupsGetAsyncWithHttpInfo + * Operation productGroupControllerGetManyAsyncWithHttpInfo * * Get productgroups * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiProductGroupsGetAsyncWithHttpInfo($filter = null) + public function productGroupControllerGetManyAsyncWithHttpInfo($filter = null) { $returnType = '\Yoast\MyYoastApiClient\Model\ProductGroup[]'; - $request = $this->apiProductGroupsGetRequest($filter); + $request = $this->productGroupControllerGetManyRequest($filter); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -252,14 +251,14 @@ function ($exception) { } /** - * Create request for operation 'apiProductGroupsGet' + * Create request for operation 'productGroupControllerGetMany' * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiProductGroupsGetRequest($filter = null) + protected function productGroupControllerGetManyRequest($filter = null) { $resourcePath = '/api/ProductGroups'; @@ -271,7 +270,7 @@ protected function apiProductGroupsGetRequest($filter = null) // query params if ($filter !== null) { - $queryParams['filter'] = ObjectSerializer::toQueryValue($filter); + $queryParams['filter'] = ObjectSerializer::toQueryValue($filter, null); } @@ -285,7 +284,7 @@ protected function apiProductGroupsGetRequest($filter = null) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -293,16 +292,9 @@ protected function apiProductGroupsGetRequest($filter = null) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -325,11 +317,10 @@ protected function apiProductGroupsGetRequest($filter = null) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { diff --git a/src/Api/ProvisionerApi.php b/src/Api/ProvisionerApi.php new file mode 100644 index 0000000..b221bc5 --- /dev/null +++ b/src/Api/ProvisionerApi.php @@ -0,0 +1,620 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation provisionerDataControllerGetMany + * + * Get provisioner data + * + * + * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Yoast\MyYoastApiClient\Model\ProvisionerData[] + */ + public function provisionerDataControllerGetMany() + { + list($response) = $this->provisionerDataControllerGetManyWithHttpInfo(); + return $response; + } + + /** + * Operation provisionerDataControllerGetManyWithHttpInfo + * + * Get provisioner data + * + * + * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Yoast\MyYoastApiClient\Model\ProvisionerData[], HTTP status code, HTTP response headers (array of strings) + */ + public function provisionerDataControllerGetManyWithHttpInfo() + { + $returnType = '\Yoast\MyYoastApiClient\Model\ProvisionerData[]'; + $request = $this->provisionerDataControllerGetManyRequest(); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if (!in_array($returnType, ['string','integer','bool'])) { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Yoast\MyYoastApiClient\Model\ProvisionerData[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation provisionerDataControllerGetManyAsync + * + * Get provisioner data + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function provisionerDataControllerGetManyAsync() + { + return $this->provisionerDataControllerGetManyAsyncWithHttpInfo() + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation provisionerDataControllerGetManyAsyncWithHttpInfo + * + * Get provisioner data + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function provisionerDataControllerGetManyAsyncWithHttpInfo() + { + $returnType = '\Yoast\MyYoastApiClient\Model\ProvisionerData[]'; + $request = $this->provisionerDataControllerGetManyRequest(); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + 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(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'provisionerDataControllerGetMany' + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function provisionerDataControllerGetManyRequest() + { + + $resourcePath = '/api/ProvisionerData'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation provisionerDataControllerGetOne + * + * Get provisioner data + * + * @param string $id id (required) + * + * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Yoast\MyYoastApiClient\Model\Subscription + */ + public function provisionerDataControllerGetOne($id) + { + list($response) = $this->provisionerDataControllerGetOneWithHttpInfo($id); + return $response; + } + + /** + * Operation provisionerDataControllerGetOneWithHttpInfo + * + * Get provisioner data + * + * @param string $id (required) + * + * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Yoast\MyYoastApiClient\Model\Subscription, HTTP status code, HTTP response headers (array of strings) + */ + public function provisionerDataControllerGetOneWithHttpInfo($id) + { + $returnType = '\Yoast\MyYoastApiClient\Model\Subscription'; + $request = $this->provisionerDataControllerGetOneRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if (!in_array($returnType, ['string','integer','bool'])) { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Yoast\MyYoastApiClient\Model\Subscription', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation provisionerDataControllerGetOneAsync + * + * Get provisioner data + * + * @param string $id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function provisionerDataControllerGetOneAsync($id) + { + return $this->provisionerDataControllerGetOneAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation provisionerDataControllerGetOneAsyncWithHttpInfo + * + * Get provisioner data + * + * @param string $id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function provisionerDataControllerGetOneAsyncWithHttpInfo($id) + { + $returnType = '\Yoast\MyYoastApiClient\Model\Subscription'; + $request = $this->provisionerDataControllerGetOneRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + 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(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'provisionerDataControllerGetOne' + * + * @param string $id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function provisionerDataControllerGetOneRequest($id) + { + // 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 provisionerDataControllerGetOne' + ); + } + + $resourcePath = '/api/ProvisionerData/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $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/src/Api/RefundApi.php b/src/Api/RefundApi.php index 5a8c604..6af87a7 100644 --- a/src/Api/RefundApi.php +++ b/src/Api/RefundApi.php @@ -17,9 +17,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -88,7 +87,7 @@ public function getConfig() } /** - * Operation apiRefundsExportGet + * Operation refundControllerExport * * Get refunds * @@ -99,14 +98,14 @@ public function getConfig() * @throws \InvalidArgumentException * @return \Yoast\MyYoastApiClient\Model\Refund[] */ - public function apiRefundsExportGet($startDate, $endDate) + public function refundControllerExport($startDate, $endDate) { - list($response) = $this->apiRefundsExportGetWithHttpInfo($startDate, $endDate); + list($response) = $this->refundControllerExportWithHttpInfo($startDate, $endDate); return $response; } /** - * Operation apiRefundsExportGetWithHttpInfo + * Operation refundControllerExportWithHttpInfo * * Get refunds * @@ -117,10 +116,10 @@ public function apiRefundsExportGet($startDate, $endDate) * @throws \InvalidArgumentException * @return array of \Yoast\MyYoastApiClient\Model\Refund[], HTTP status code, HTTP response headers (array of strings) */ - public function apiRefundsExportGetWithHttpInfo($startDate, $endDate) + public function refundControllerExportWithHttpInfo($startDate, $endDate) { $returnType = '\Yoast\MyYoastApiClient\Model\Refund[]'; - $request = $this->apiRefundsExportGetRequest($startDate, $endDate); + $request = $this->refundControllerExportRequest($startDate, $endDate); try { $options = $this->createHttpClientOption(); @@ -155,7 +154,7 @@ public function apiRefundsExportGetWithHttpInfo($startDate, $endDate) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -182,7 +181,7 @@ public function apiRefundsExportGetWithHttpInfo($startDate, $endDate) } /** - * Operation apiRefundsExportGetAsync + * Operation refundControllerExportAsync * * Get refunds * @@ -192,9 +191,9 @@ public function apiRefundsExportGetWithHttpInfo($startDate, $endDate) * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiRefundsExportGetAsync($startDate, $endDate) + public function refundControllerExportAsync($startDate, $endDate) { - return $this->apiRefundsExportGetAsyncWithHttpInfo($startDate, $endDate) + return $this->refundControllerExportAsyncWithHttpInfo($startDate, $endDate) ->then( function ($response) { return $response[0]; @@ -203,7 +202,7 @@ function ($response) { } /** - * Operation apiRefundsExportGetAsyncWithHttpInfo + * Operation refundControllerExportAsyncWithHttpInfo * * Get refunds * @@ -213,10 +212,10 @@ function ($response) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiRefundsExportGetAsyncWithHttpInfo($startDate, $endDate) + public function refundControllerExportAsyncWithHttpInfo($startDate, $endDate) { $returnType = '\Yoast\MyYoastApiClient\Model\Refund[]'; - $request = $this->apiRefundsExportGetRequest($startDate, $endDate); + $request = $this->refundControllerExportRequest($startDate, $endDate); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -256,7 +255,7 @@ function ($exception) { } /** - * Create request for operation 'apiRefundsExportGet' + * Create request for operation 'refundControllerExport' * * @param \DateTime $startDate (required) * @param \DateTime $endDate (required) @@ -264,18 +263,18 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiRefundsExportGetRequest($startDate, $endDate) + protected function refundControllerExportRequest($startDate, $endDate) { // verify the required parameter 'startDate' is set if ($startDate === null || (is_array($startDate) && count($startDate) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $startDate when calling apiRefundsExportGet' + 'Missing the required parameter $startDate when calling refundControllerExport' ); } // verify the required parameter 'endDate' is set if ($endDate === null || (is_array($endDate) && count($endDate) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $endDate when calling apiRefundsExportGet' + 'Missing the required parameter $endDate when calling refundControllerExport' ); } @@ -288,11 +287,11 @@ protected function apiRefundsExportGetRequest($startDate, $endDate) // query params if ($startDate !== null) { - $queryParams['start_date'] = ObjectSerializer::toQueryValue($startDate); + $queryParams['start_date'] = ObjectSerializer::toQueryValue($startDate, 'date-time'); } // query params if ($endDate !== null) { - $queryParams['end_date'] = ObjectSerializer::toQueryValue($endDate); + $queryParams['end_date'] = ObjectSerializer::toQueryValue($endDate, 'date-time'); } @@ -306,7 +305,7 @@ protected function apiRefundsExportGetRequest($startDate, $endDate) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -314,16 +313,9 @@ protected function apiRefundsExportGetRequest($startDate, $endDate) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -346,11 +338,10 @@ protected function apiRefundsExportGetRequest($startDate, $endDate) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -373,37 +364,37 @@ protected function apiRefundsExportGetRequest($startDate, $endDate) } /** - * Operation apiRefundsGet + * Operation refundControllerGetMany * * Get refunds * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Yoast\MyYoastApiClient\Model\Refund[] */ - public function apiRefundsGet($filter = null) + public function refundControllerGetMany($filter = null) { - list($response) = $this->apiRefundsGetWithHttpInfo($filter); + list($response) = $this->refundControllerGetManyWithHttpInfo($filter); return $response; } /** - * Operation apiRefundsGetWithHttpInfo + * Operation refundControllerGetManyWithHttpInfo * * Get refunds * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Yoast\MyYoastApiClient\Model\Refund[], HTTP status code, HTTP response headers (array of strings) */ - public function apiRefundsGetWithHttpInfo($filter = null) + public function refundControllerGetManyWithHttpInfo($filter = null) { $returnType = '\Yoast\MyYoastApiClient\Model\Refund[]'; - $request = $this->apiRefundsGetRequest($filter); + $request = $this->refundControllerGetManyRequest($filter); try { $options = $this->createHttpClientOption(); @@ -438,7 +429,7 @@ public function apiRefundsGetWithHttpInfo($filter = null) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -465,18 +456,18 @@ public function apiRefundsGetWithHttpInfo($filter = null) } /** - * Operation apiRefundsGetAsync + * Operation refundControllerGetManyAsync * * Get refunds * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiRefundsGetAsync($filter = null) + public function refundControllerGetManyAsync($filter = null) { - return $this->apiRefundsGetAsyncWithHttpInfo($filter) + return $this->refundControllerGetManyAsyncWithHttpInfo($filter) ->then( function ($response) { return $response[0]; @@ -485,19 +476,19 @@ function ($response) { } /** - * Operation apiRefundsGetAsyncWithHttpInfo + * Operation refundControllerGetManyAsyncWithHttpInfo * * Get refunds * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiRefundsGetAsyncWithHttpInfo($filter = null) + public function refundControllerGetManyAsyncWithHttpInfo($filter = null) { $returnType = '\Yoast\MyYoastApiClient\Model\Refund[]'; - $request = $this->apiRefundsGetRequest($filter); + $request = $this->refundControllerGetManyRequest($filter); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -537,14 +528,14 @@ function ($exception) { } /** - * Create request for operation 'apiRefundsGet' + * Create request for operation 'refundControllerGetMany' * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiRefundsGetRequest($filter = null) + protected function refundControllerGetManyRequest($filter = null) { $resourcePath = '/api/Refunds'; @@ -556,7 +547,7 @@ protected function apiRefundsGetRequest($filter = null) // query params if ($filter !== null) { - $queryParams['filter'] = ObjectSerializer::toQueryValue($filter); + $queryParams['filter'] = ObjectSerializer::toQueryValue($filter, null); } @@ -570,7 +561,7 @@ protected function apiRefundsGetRequest($filter = null) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -578,16 +569,9 @@ protected function apiRefundsGetRequest($filter = null) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -610,11 +594,10 @@ protected function apiRefundsGetRequest($filter = null) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -637,39 +620,39 @@ protected function apiRefundsGetRequest($filter = null) } /** - * Operation apiRefundsIdGet + * Operation refundControllerGetOne * * Get a refund * * @param string $id id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Yoast\MyYoastApiClient\Model\Refund */ - public function apiRefundsIdGet($id, $filter = null) + public function refundControllerGetOne($id, $filter = null) { - list($response) = $this->apiRefundsIdGetWithHttpInfo($id, $filter); + list($response) = $this->refundControllerGetOneWithHttpInfo($id, $filter); return $response; } /** - * Operation apiRefundsIdGetWithHttpInfo + * Operation refundControllerGetOneWithHttpInfo * * Get a refund * * @param string $id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Yoast\MyYoastApiClient\Model\Refund, HTTP status code, HTTP response headers (array of strings) */ - public function apiRefundsIdGetWithHttpInfo($id, $filter = null) + public function refundControllerGetOneWithHttpInfo($id, $filter = null) { $returnType = '\Yoast\MyYoastApiClient\Model\Refund'; - $request = $this->apiRefundsIdGetRequest($id, $filter); + $request = $this->refundControllerGetOneRequest($id, $filter); try { $options = $this->createHttpClientOption(); @@ -704,7 +687,7 @@ public function apiRefundsIdGetWithHttpInfo($id, $filter = null) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -731,19 +714,19 @@ public function apiRefundsIdGetWithHttpInfo($id, $filter = null) } /** - * Operation apiRefundsIdGetAsync + * Operation refundControllerGetOneAsync * * Get a refund * * @param string $id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiRefundsIdGetAsync($id, $filter = null) + public function refundControllerGetOneAsync($id, $filter = null) { - return $this->apiRefundsIdGetAsyncWithHttpInfo($id, $filter) + return $this->refundControllerGetOneAsyncWithHttpInfo($id, $filter) ->then( function ($response) { return $response[0]; @@ -752,20 +735,20 @@ function ($response) { } /** - * Operation apiRefundsIdGetAsyncWithHttpInfo + * Operation refundControllerGetOneAsyncWithHttpInfo * * Get a refund * * @param string $id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiRefundsIdGetAsyncWithHttpInfo($id, $filter = null) + public function refundControllerGetOneAsyncWithHttpInfo($id, $filter = null) { $returnType = '\Yoast\MyYoastApiClient\Model\Refund'; - $request = $this->apiRefundsIdGetRequest($id, $filter); + $request = $this->refundControllerGetOneRequest($id, $filter); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -805,20 +788,20 @@ function ($exception) { } /** - * Create request for operation 'apiRefundsIdGet' + * Create request for operation 'refundControllerGetOne' * * @param string $id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiRefundsIdGetRequest($id, $filter = null) + protected function refundControllerGetOneRequest($id, $filter = null) { // 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 apiRefundsIdGet' + 'Missing the required parameter $id when calling refundControllerGetOne' ); } @@ -831,7 +814,7 @@ protected function apiRefundsIdGetRequest($id, $filter = null) // query params if ($filter !== null) { - $queryParams['filter'] = ObjectSerializer::toQueryValue($filter); + $queryParams['filter'] = ObjectSerializer::toQueryValue($filter, null); } // path params @@ -853,7 +836,7 @@ protected function apiRefundsIdGetRequest($id, $filter = null) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -861,16 +844,9 @@ protected function apiRefundsIdGetRequest($id, $filter = null) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -893,11 +869,10 @@ protected function apiRefundsIdGetRequest($id, $filter = null) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { diff --git a/src/Api/RobotsApi.php b/src/Api/RobotsApi.php index 7a63adf..e5ce3d1 100644 --- a/src/Api/RobotsApi.php +++ b/src/Api/RobotsApi.php @@ -17,9 +17,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -88,31 +87,31 @@ public function getConfig() } /** - * Operation robotsTxtGet + * Operation robotsControllerServeRobots * * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \SplFileObject + * @return string */ - public function robotsTxtGet() + public function robotsControllerServeRobots() { - list($response) = $this->robotsTxtGetWithHttpInfo(); + list($response) = $this->robotsControllerServeRobotsWithHttpInfo(); return $response; } /** - * Operation robotsTxtGetWithHttpInfo + * Operation robotsControllerServeRobotsWithHttpInfo * * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \SplFileObject, HTTP status code, HTTP response headers (array of strings) + * @return array of string, HTTP status code, HTTP response headers (array of strings) */ - public function robotsTxtGetWithHttpInfo() + public function robotsControllerServeRobotsWithHttpInfo() { - $returnType = '\SplFileObject'; - $request = $this->robotsTxtGetRequest(); + $returnType = 'string'; + $request = $this->robotsControllerServeRobotsRequest(); try { $options = $this->createHttpClientOption(); @@ -147,7 +146,7 @@ public function robotsTxtGetWithHttpInfo() $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -163,7 +162,7 @@ public function robotsTxtGetWithHttpInfo() case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\SplFileObject', + 'string', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -174,7 +173,7 @@ public function robotsTxtGetWithHttpInfo() } /** - * Operation robotsTxtGetAsync + * Operation robotsControllerServeRobotsAsync * * * @@ -182,9 +181,9 @@ public function robotsTxtGetWithHttpInfo() * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function robotsTxtGetAsync() + public function robotsControllerServeRobotsAsync() { - return $this->robotsTxtGetAsyncWithHttpInfo() + return $this->robotsControllerServeRobotsAsyncWithHttpInfo() ->then( function ($response) { return $response[0]; @@ -193,7 +192,7 @@ function ($response) { } /** - * Operation robotsTxtGetAsyncWithHttpInfo + * Operation robotsControllerServeRobotsAsyncWithHttpInfo * * * @@ -201,10 +200,10 @@ function ($response) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function robotsTxtGetAsyncWithHttpInfo() + public function robotsControllerServeRobotsAsyncWithHttpInfo() { - $returnType = '\SplFileObject'; - $request = $this->robotsTxtGetRequest(); + $returnType = 'string'; + $request = $this->robotsControllerServeRobotsRequest(); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -244,13 +243,13 @@ function ($exception) { } /** - * Create request for operation 'robotsTxtGet' + * Create request for operation 'robotsControllerServeRobots' * * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function robotsTxtGetRequest() + protected function robotsControllerServeRobotsRequest() { $resourcePath = '/robots.txt'; @@ -272,7 +271,7 @@ protected function robotsTxtGetRequest() } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -280,16 +279,9 @@ protected function robotsTxtGetRequest() if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { diff --git a/src/Api/ServerCheckApi.php b/src/Api/ServerCheckApi.php index fc4f3bd..9c14ce3 100644 --- a/src/Api/ServerCheckApi.php +++ b/src/Api/ServerCheckApi.php @@ -17,9 +17,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -88,7 +87,7 @@ public function getConfig() } /** - * Operation serverCheckGet + * Operation serverHealthControllerCheckHealth * * Server health check * @@ -97,14 +96,14 @@ public function getConfig() * @throws \InvalidArgumentException * @return string */ - public function serverCheckGet() + public function serverHealthControllerCheckHealth() { - list($response) = $this->serverCheckGetWithHttpInfo(); + list($response) = $this->serverHealthControllerCheckHealthWithHttpInfo(); return $response; } /** - * Operation serverCheckGetWithHttpInfo + * Operation serverHealthControllerCheckHealthWithHttpInfo * * Server health check * @@ -113,10 +112,10 @@ public function serverCheckGet() * @throws \InvalidArgumentException * @return array of string, HTTP status code, HTTP response headers (array of strings) */ - public function serverCheckGetWithHttpInfo() + public function serverHealthControllerCheckHealthWithHttpInfo() { $returnType = 'string'; - $request = $this->serverCheckGetRequest(); + $request = $this->serverHealthControllerCheckHealthRequest(); try { $options = $this->createHttpClientOption(); @@ -151,7 +150,7 @@ public function serverCheckGetWithHttpInfo() $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -178,7 +177,7 @@ public function serverCheckGetWithHttpInfo() } /** - * Operation serverCheckGetAsync + * Operation serverHealthControllerCheckHealthAsync * * Server health check * @@ -186,9 +185,9 @@ public function serverCheckGetWithHttpInfo() * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function serverCheckGetAsync() + public function serverHealthControllerCheckHealthAsync() { - return $this->serverCheckGetAsyncWithHttpInfo() + return $this->serverHealthControllerCheckHealthAsyncWithHttpInfo() ->then( function ($response) { return $response[0]; @@ -197,7 +196,7 @@ function ($response) { } /** - * Operation serverCheckGetAsyncWithHttpInfo + * Operation serverHealthControllerCheckHealthAsyncWithHttpInfo * * Server health check * @@ -205,10 +204,10 @@ function ($response) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function serverCheckGetAsyncWithHttpInfo() + public function serverHealthControllerCheckHealthAsyncWithHttpInfo() { $returnType = 'string'; - $request = $this->serverCheckGetRequest(); + $request = $this->serverHealthControllerCheckHealthRequest(); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -248,13 +247,13 @@ function ($exception) { } /** - * Create request for operation 'serverCheckGet' + * Create request for operation 'serverHealthControllerCheckHealth' * * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function serverCheckGetRequest() + protected function serverHealthControllerCheckHealthRequest() { $resourcePath = '/server-check'; @@ -276,7 +275,7 @@ protected function serverCheckGetRequest() } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -284,16 +283,9 @@ protected function serverCheckGetRequest() if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { diff --git a/src/Api/SiteApi.php b/src/Api/SiteApi.php index fafa8da..0cd9e18 100644 --- a/src/Api/SiteApi.php +++ b/src/Api/SiteApi.php @@ -17,9 +17,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -88,7 +87,7 @@ public function getConfig() } /** - * Operation apiSitesCurrentGet + * Operation siteControllerCurrent * * Get the current connected site for an access token. * @@ -99,14 +98,14 @@ public function getConfig() * @throws \InvalidArgumentException * @return object */ - public function apiSitesCurrentGet($token = null, $url = null) + public function siteControllerCurrent($token = null, $url = null) { - list($response) = $this->apiSitesCurrentGetWithHttpInfo($token, $url); + list($response) = $this->siteControllerCurrentWithHttpInfo($token, $url); return $response; } /** - * Operation apiSitesCurrentGetWithHttpInfo + * Operation siteControllerCurrentWithHttpInfo * * Get the current connected site for an access token. * @@ -117,10 +116,10 @@ public function apiSitesCurrentGet($token = null, $url = null) * @throws \InvalidArgumentException * @return array of object, HTTP status code, HTTP response headers (array of strings) */ - public function apiSitesCurrentGetWithHttpInfo($token = null, $url = null) + public function siteControllerCurrentWithHttpInfo($token = null, $url = null) { $returnType = 'object'; - $request = $this->apiSitesCurrentGetRequest($token, $url); + $request = $this->siteControllerCurrentRequest($token, $url); try { $options = $this->createHttpClientOption(); @@ -155,7 +154,7 @@ public function apiSitesCurrentGetWithHttpInfo($token = null, $url = null) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -182,7 +181,7 @@ public function apiSitesCurrentGetWithHttpInfo($token = null, $url = null) } /** - * Operation apiSitesCurrentGetAsync + * Operation siteControllerCurrentAsync * * Get the current connected site for an access token. * @@ -192,9 +191,9 @@ public function apiSitesCurrentGetWithHttpInfo($token = null, $url = null) * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiSitesCurrentGetAsync($token = null, $url = null) + public function siteControllerCurrentAsync($token = null, $url = null) { - return $this->apiSitesCurrentGetAsyncWithHttpInfo($token, $url) + return $this->siteControllerCurrentAsyncWithHttpInfo($token, $url) ->then( function ($response) { return $response[0]; @@ -203,7 +202,7 @@ function ($response) { } /** - * Operation apiSitesCurrentGetAsyncWithHttpInfo + * Operation siteControllerCurrentAsyncWithHttpInfo * * Get the current connected site for an access token. * @@ -213,10 +212,10 @@ function ($response) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiSitesCurrentGetAsyncWithHttpInfo($token = null, $url = null) + public function siteControllerCurrentAsyncWithHttpInfo($token = null, $url = null) { $returnType = 'object'; - $request = $this->apiSitesCurrentGetRequest($token, $url); + $request = $this->siteControllerCurrentRequest($token, $url); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -256,7 +255,7 @@ function ($exception) { } /** - * Create request for operation 'apiSitesCurrentGet' + * Create request for operation 'siteControllerCurrent' * * @param string $token (optional) * @param string $url (optional) @@ -264,7 +263,7 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiSitesCurrentGetRequest($token = null, $url = null) + protected function siteControllerCurrentRequest($token = null, $url = null) { $resourcePath = '/api/Sites/current'; @@ -276,11 +275,11 @@ protected function apiSitesCurrentGetRequest($token = null, $url = null) // query params if ($token !== null) { - $queryParams['token'] = ObjectSerializer::toQueryValue($token); + $queryParams['token'] = ObjectSerializer::toQueryValue($token, null); } // query params if ($url !== null) { - $queryParams['url'] = ObjectSerializer::toQueryValue($url); + $queryParams['url'] = ObjectSerializer::toQueryValue($url, null); } @@ -294,7 +293,7 @@ protected function apiSitesCurrentGetRequest($token = null, $url = null) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -302,16 +301,9 @@ protected function apiSitesCurrentGetRequest($token = null, $url = null) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -334,11 +326,10 @@ protected function apiSitesCurrentGetRequest($token = null, $url = null) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -361,37 +352,39 @@ protected function apiSitesCurrentGetRequest($token = null, $url = null) } /** - * Operation apiSitesGet + * Operation siteControllerCurrentClone * - * Get sites + * Get the current connected site for an access token. * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param string $token token (optional) + * @param string $url url (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\Site[] + * @return object */ - public function apiSitesGet($filter = null) + public function siteControllerCurrentClone($token = null, $url = null) { - list($response) = $this->apiSitesGetWithHttpInfo($filter); + list($response) = $this->siteControllerCurrentCloneWithHttpInfo($token, $url); return $response; } /** - * Operation apiSitesGetWithHttpInfo + * Operation siteControllerCurrentCloneWithHttpInfo * - * Get sites + * Get the current connected site for an access token. * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param string $token (optional) + * @param string $url (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Yoast\MyYoastApiClient\Model\Site[], HTTP status code, HTTP response headers (array of strings) + * @return array of object, HTTP status code, HTTP response headers (array of strings) */ - public function apiSitesGetWithHttpInfo($filter = null) + public function siteControllerCurrentCloneWithHttpInfo($token = null, $url = null) { - $returnType = '\Yoast\MyYoastApiClient\Model\Site[]'; - $request = $this->apiSitesGetRequest($filter); + $returnType = 'object'; + $request = $this->siteControllerCurrentCloneRequest($token, $url); try { $options = $this->createHttpClientOption(); @@ -426,7 +419,7 @@ public function apiSitesGetWithHttpInfo($filter = null) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -442,7 +435,7 @@ public function apiSitesGetWithHttpInfo($filter = null) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Yoast\MyYoastApiClient\Model\Site[]', + 'object', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -453,18 +446,19 @@ public function apiSitesGetWithHttpInfo($filter = null) } /** - * Operation apiSitesGetAsync + * Operation siteControllerCurrentCloneAsync * - * Get sites + * Get the current connected site for an access token. * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param string $token (optional) + * @param string $url (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiSitesGetAsync($filter = null) + public function siteControllerCurrentCloneAsync($token = null, $url = null) { - return $this->apiSitesGetAsyncWithHttpInfo($filter) + return $this->siteControllerCurrentCloneAsyncWithHttpInfo($token, $url) ->then( function ($response) { return $response[0]; @@ -473,19 +467,20 @@ function ($response) { } /** - * Operation apiSitesGetAsyncWithHttpInfo + * Operation siteControllerCurrentCloneAsyncWithHttpInfo * - * Get sites + * Get the current connected site for an access token. * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param string $token (optional) + * @param string $url (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiSitesGetAsyncWithHttpInfo($filter = null) + public function siteControllerCurrentCloneAsyncWithHttpInfo($token = null, $url = null) { - $returnType = '\Yoast\MyYoastApiClient\Model\Site[]'; - $request = $this->apiSitesGetRequest($filter); + $returnType = 'object'; + $request = $this->siteControllerCurrentCloneRequest($token, $url); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -525,17 +520,18 @@ function ($exception) { } /** - * Create request for operation 'apiSitesGet' + * Create request for operation 'siteControllerCurrentClone' * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param string $token (optional) + * @param string $url (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiSitesGetRequest($filter = null) + protected function siteControllerCurrentCloneRequest($token = null, $url = null) { - $resourcePath = '/api/Sites'; + $resourcePath = '/api/Sites/info'; $formParams = []; $queryParams = []; $headerParams = []; @@ -543,8 +539,12 @@ protected function apiSitesGetRequest($filter = null) $multipart = false; // query params - if ($filter !== null) { - $queryParams['filter'] = ObjectSerializer::toQueryValue($filter); + if ($token !== null) { + $queryParams['token'] = ObjectSerializer::toQueryValue($token, null); + } + // query params + if ($url !== null) { + $queryParams['url'] = ObjectSerializer::toQueryValue($url, null); } @@ -558,7 +558,7 @@ protected function apiSitesGetRequest($filter = null) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -566,16 +566,9 @@ protected function apiSitesGetRequest($filter = null) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -598,11 +591,10 @@ protected function apiSitesGetRequest($filter = null) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -625,32 +617,33 @@ protected function apiSitesGetRequest($filter = null) } /** - * Operation apiSitesIdDelete + * Operation siteControllerDeleteOne * * @param string $id id (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return \Yoast\MyYoastApiClient\Model\Site */ - public function apiSitesIdDelete($id) + public function siteControllerDeleteOne($id) { - $this->apiSitesIdDeleteWithHttpInfo($id); + list($response) = $this->siteControllerDeleteOneWithHttpInfo($id); + return $response; } /** - * Operation apiSitesIdDeleteWithHttpInfo + * Operation siteControllerDeleteOneWithHttpInfo * * @param string $id (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of \Yoast\MyYoastApiClient\Model\Site, HTTP status code, HTTP response headers (array of strings) */ - public function apiSitesIdDeleteWithHttpInfo($id) + public function siteControllerDeleteOneWithHttpInfo($id) { - $returnType = ''; - $request = $this->apiSitesIdDeleteRequest($id); + $returnType = '\Yoast\MyYoastApiClient\Model\Site'; + $request = $this->siteControllerDeleteOneRequest($id); try { $options = $this->createHttpClientOption(); @@ -680,17 +673,39 @@ public function apiSitesIdDeleteWithHttpInfo($id) ); } - return [null, $statusCode, $response->getHeaders()]; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if (!in_array($returnType, ['string','integer','bool'])) { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; } catch (ApiException $e) { switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Yoast\MyYoastApiClient\Model\Site', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } } /** - * Operation apiSitesIdDeleteAsync + * Operation siteControllerDeleteOneAsync * * * @@ -699,9 +714,9 @@ public function apiSitesIdDeleteWithHttpInfo($id) * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiSitesIdDeleteAsync($id) + public function siteControllerDeleteOneAsync($id) { - return $this->apiSitesIdDeleteAsyncWithHttpInfo($id) + return $this->siteControllerDeleteOneAsyncWithHttpInfo($id) ->then( function ($response) { return $response[0]; @@ -710,7 +725,7 @@ function ($response) { } /** - * Operation apiSitesIdDeleteAsyncWithHttpInfo + * Operation siteControllerDeleteOneAsyncWithHttpInfo * * * @@ -719,16 +734,30 @@ function ($response) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiSitesIdDeleteAsyncWithHttpInfo($id) + public function siteControllerDeleteOneAsyncWithHttpInfo($id) { - $returnType = ''; - $request = $this->apiSitesIdDeleteRequest($id); + $returnType = '\Yoast\MyYoastApiClient\Model\Site'; + $request = $this->siteControllerDeleteOneRequest($id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -748,19 +777,19 @@ function ($exception) { } /** - * Create request for operation 'apiSitesIdDelete' + * Create request for operation 'siteControllerDeleteOne' * * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiSitesIdDeleteRequest($id) + protected function siteControllerDeleteOneRequest($id) { // 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 apiSitesIdDelete' + 'Missing the required parameter $id when calling siteControllerDeleteOne' ); } @@ -791,7 +820,7 @@ protected function apiSitesIdDeleteRequest($id) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -799,16 +828,9 @@ protected function apiSitesIdDeleteRequest($id) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -831,11 +853,10 @@ protected function apiSitesIdDeleteRequest($id) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -858,39 +879,37 @@ protected function apiSitesIdDeleteRequest($id) } /** - * Operation apiSitesIdGet + * Operation siteControllerGetMany * - * Get a site + * Get sites * - * @param string $id id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\Site + * @return \Yoast\MyYoastApiClient\Model\Site[] */ - public function apiSitesIdGet($id, $filter = null) + public function siteControllerGetMany($filter = null) { - list($response) = $this->apiSitesIdGetWithHttpInfo($id, $filter); + list($response) = $this->siteControllerGetManyWithHttpInfo($filter); return $response; } /** - * Operation apiSitesIdGetWithHttpInfo + * Operation siteControllerGetManyWithHttpInfo * - * Get a site + * Get sites * - * @param string $id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Yoast\MyYoastApiClient\Model\Site, HTTP status code, HTTP response headers (array of strings) + * @return array of \Yoast\MyYoastApiClient\Model\Site[], HTTP status code, HTTP response headers (array of strings) */ - public function apiSitesIdGetWithHttpInfo($id, $filter = null) + public function siteControllerGetManyWithHttpInfo($filter = null) { - $returnType = '\Yoast\MyYoastApiClient\Model\Site'; - $request = $this->apiSitesIdGetRequest($id, $filter); + $returnType = '\Yoast\MyYoastApiClient\Model\Site[]'; + $request = $this->siteControllerGetManyRequest($filter); try { $options = $this->createHttpClientOption(); @@ -925,7 +944,7 @@ public function apiSitesIdGetWithHttpInfo($id, $filter = null) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -941,7 +960,7 @@ public function apiSitesIdGetWithHttpInfo($id, $filter = null) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Yoast\MyYoastApiClient\Model\Site', + '\Yoast\MyYoastApiClient\Model\Site[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -952,19 +971,18 @@ public function apiSitesIdGetWithHttpInfo($id, $filter = null) } /** - * Operation apiSitesIdGetAsync + * Operation siteControllerGetManyAsync * - * Get a site + * Get sites * - * @param string $id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiSitesIdGetAsync($id, $filter = null) + public function siteControllerGetManyAsync($filter = null) { - return $this->apiSitesIdGetAsyncWithHttpInfo($id, $filter) + return $this->siteControllerGetManyAsyncWithHttpInfo($filter) ->then( function ($response) { return $response[0]; @@ -973,20 +991,19 @@ function ($response) { } /** - * Operation apiSitesIdGetAsyncWithHttpInfo + * Operation siteControllerGetManyAsyncWithHttpInfo * - * Get a site + * Get sites * - * @param string $id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiSitesIdGetAsyncWithHttpInfo($id, $filter = null) + public function siteControllerGetManyAsyncWithHttpInfo($filter = null) { - $returnType = '\Yoast\MyYoastApiClient\Model\Site'; - $request = $this->apiSitesIdGetRequest($id, $filter); + $returnType = '\Yoast\MyYoastApiClient\Model\Site[]'; + $request = $this->siteControllerGetManyRequest($filter); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1026,24 +1043,17 @@ function ($exception) { } /** - * Create request for operation 'apiSitesIdGet' + * Create request for operation 'siteControllerGetMany' * - * @param string $id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiSitesIdGetRequest($id, $filter = null) + protected function siteControllerGetManyRequest($filter = null) { - // 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 apiSitesIdGet' - ); - } - $resourcePath = '/api/Sites/{id}'; + $resourcePath = '/api/Sites'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1052,17 +1062,9 @@ protected function apiSitesIdGetRequest($id, $filter = null) // query params if ($filter !== null) { - $queryParams['filter'] = ObjectSerializer::toQueryValue($filter); + $queryParams['filter'] = ObjectSerializer::toQueryValue($filter, null); } - // path params - if ($id !== null) { - $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), - $resourcePath - ); - } // body params $_tempBody = null; @@ -1074,7 +1076,7 @@ protected function apiSitesIdGetRequest($id, $filter = null) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -1082,16 +1084,9 @@ protected function apiSitesIdGetRequest($id, $filter = null) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -1114,11 +1109,10 @@ protected function apiSitesIdGetRequest($id, $filter = null) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1141,34 +1135,37 @@ protected function apiSitesIdGetRequest($id, $filter = null) } /** - * Operation apiSitesIdPatch + * Operation siteControllerGetManyPaged * - * @param \Yoast\MyYoastApiClient\Model\UpdateSiteDto $updateSiteDto updateSiteDto (required) - * @param string $id id (required) + * Get sites + * + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return void + * @return object */ - public function apiSitesIdPatch($updateSiteDto, $id) + public function siteControllerGetManyPaged($filter = null) { - $this->apiSitesIdPatchWithHttpInfo($updateSiteDto, $id); + list($response) = $this->siteControllerGetManyPagedWithHttpInfo($filter); + return $response; } /** - * Operation apiSitesIdPatchWithHttpInfo + * Operation siteControllerGetManyPagedWithHttpInfo * - * @param \Yoast\MyYoastApiClient\Model\UpdateSiteDto $updateSiteDto (required) - * @param string $id (required) + * Get sites + * + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of object, HTTP status code, HTTP response headers (array of strings) */ - public function apiSitesIdPatchWithHttpInfo($updateSiteDto, $id) + public function siteControllerGetManyPagedWithHttpInfo($filter = null) { - $returnType = ''; - $request = $this->apiSitesIdPatchRequest($updateSiteDto, $id); + $returnType = 'object'; + $request = $this->siteControllerGetManyPagedRequest($filter); try { $options = $this->createHttpClientOption(); @@ -1198,29 +1195,50 @@ public function apiSitesIdPatchWithHttpInfo($updateSiteDto, $id) ); } - return [null, $statusCode, $response->getHeaders()]; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if (!in_array($returnType, ['string','integer','bool'])) { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; } catch (ApiException $e) { switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'object', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } } /** - * Operation apiSitesIdPatchAsync + * Operation siteControllerGetManyPagedAsync * - * + * Get sites * - * @param \Yoast\MyYoastApiClient\Model\UpdateSiteDto $updateSiteDto (required) - * @param string $id (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiSitesIdPatchAsync($updateSiteDto, $id) + public function siteControllerGetManyPagedAsync($filter = null) { - return $this->apiSitesIdPatchAsyncWithHttpInfo($updateSiteDto, $id) + return $this->siteControllerGetManyPagedAsyncWithHttpInfo($filter) ->then( function ($response) { return $response[0]; @@ -1229,26 +1247,39 @@ function ($response) { } /** - * Operation apiSitesIdPatchAsyncWithHttpInfo + * Operation siteControllerGetManyPagedAsyncWithHttpInfo * - * + * Get sites * - * @param \Yoast\MyYoastApiClient\Model\UpdateSiteDto $updateSiteDto (required) - * @param string $id (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiSitesIdPatchAsyncWithHttpInfo($updateSiteDto, $id) + public function siteControllerGetManyPagedAsyncWithHttpInfo($filter = null) { - $returnType = ''; - $request = $this->apiSitesIdPatchRequest($updateSiteDto, $id); + $returnType = 'object'; + $request = $this->siteControllerGetManyPagedRequest($filter); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -1268,51 +1299,31 @@ function ($exception) { } /** - * Create request for operation 'apiSitesIdPatch' + * Create request for operation 'siteControllerGetManyPaged' * - * @param \Yoast\MyYoastApiClient\Model\UpdateSiteDto $updateSiteDto (required) - * @param string $id (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiSitesIdPatchRequest($updateSiteDto, $id) + protected function siteControllerGetManyPagedRequest($filter = null) { - // verify the required parameter 'updateSiteDto' is set - if ($updateSiteDto === null || (is_array($updateSiteDto) && count($updateSiteDto) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $updateSiteDto when calling apiSitesIdPatch' - ); - } - // 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 apiSitesIdPatch' - ); - } - $resourcePath = '/api/Sites/{id}'; + $resourcePath = '/api/Sites/paged'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - - // path params - if ($id !== null) { - $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), - $resourcePath - ); + // query params + if ($filter !== null) { + $queryParams['filter'] = ObjectSerializer::toQueryValue($filter, null); } + // body params $_tempBody = null; - if (isset($updateSiteDto)) { - $_tempBody = $updateSiteDto; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -1321,7 +1332,7 @@ protected function apiSitesIdPatchRequest($updateSiteDto, $id) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -1329,16 +1340,9 @@ protected function apiSitesIdPatchRequest($updateSiteDto, $id) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -1361,11 +1365,10 @@ protected function apiSitesIdPatchRequest($updateSiteDto, $id) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1380,7 +1383,7 @@ protected function apiSitesIdPatchRequest($updateSiteDto, $id) $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'PATCH', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -1388,39 +1391,39 @@ protected function apiSitesIdPatchRequest($updateSiteDto, $id) } /** - * Operation apiSitesIdSubscriptionsPut + * Operation siteControllerGetOne * - * Adds a subscription to a site + * Get a site * - * @param \Yoast\MyYoastApiClient\Model\AddSubscriptionDto $addSubscriptionDto addSubscriptionDto (required) * @param string $id id (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Yoast\MyYoastApiClient\Model\Site */ - public function apiSitesIdSubscriptionsPut($addSubscriptionDto, $id) + public function siteControllerGetOne($id, $filter = null) { - list($response) = $this->apiSitesIdSubscriptionsPutWithHttpInfo($addSubscriptionDto, $id); + list($response) = $this->siteControllerGetOneWithHttpInfo($id, $filter); return $response; } /** - * Operation apiSitesIdSubscriptionsPutWithHttpInfo + * Operation siteControllerGetOneWithHttpInfo * - * Adds a subscription to a site + * Get a site * - * @param \Yoast\MyYoastApiClient\Model\AddSubscriptionDto $addSubscriptionDto (required) * @param string $id (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Yoast\MyYoastApiClient\Model\Site, HTTP status code, HTTP response headers (array of strings) */ - public function apiSitesIdSubscriptionsPutWithHttpInfo($addSubscriptionDto, $id) + public function siteControllerGetOneWithHttpInfo($id, $filter = null) { $returnType = '\Yoast\MyYoastApiClient\Model\Site'; - $request = $this->apiSitesIdSubscriptionsPutRequest($addSubscriptionDto, $id); + $request = $this->siteControllerGetOneRequest($id, $filter); try { $options = $this->createHttpClientOption(); @@ -1455,7 +1458,7 @@ public function apiSitesIdSubscriptionsPutWithHttpInfo($addSubscriptionDto, $id) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -1482,19 +1485,19 @@ public function apiSitesIdSubscriptionsPutWithHttpInfo($addSubscriptionDto, $id) } /** - * Operation apiSitesIdSubscriptionsPutAsync + * Operation siteControllerGetOneAsync * - * Adds a subscription to a site + * Get a site * - * @param \Yoast\MyYoastApiClient\Model\AddSubscriptionDto $addSubscriptionDto (required) * @param string $id (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiSitesIdSubscriptionsPutAsync($addSubscriptionDto, $id) + public function siteControllerGetOneAsync($id, $filter = null) { - return $this->apiSitesIdSubscriptionsPutAsyncWithHttpInfo($addSubscriptionDto, $id) + return $this->siteControllerGetOneAsyncWithHttpInfo($id, $filter) ->then( function ($response) { return $response[0]; @@ -1503,20 +1506,20 @@ function ($response) { } /** - * Operation apiSitesIdSubscriptionsPutAsyncWithHttpInfo + * Operation siteControllerGetOneAsyncWithHttpInfo * - * Adds a subscription to a site + * Get a site * - * @param \Yoast\MyYoastApiClient\Model\AddSubscriptionDto $addSubscriptionDto (required) * @param string $id (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiSitesIdSubscriptionsPutAsyncWithHttpInfo($addSubscriptionDto, $id) + public function siteControllerGetOneAsyncWithHttpInfo($id, $filter = null) { $returnType = '\Yoast\MyYoastApiClient\Model\Site'; - $request = $this->apiSitesIdSubscriptionsPutRequest($addSubscriptionDto, $id); + $request = $this->siteControllerGetOneRequest($id, $filter); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1556,36 +1559,34 @@ function ($exception) { } /** - * Create request for operation 'apiSitesIdSubscriptionsPut' + * Create request for operation 'siteControllerGetOne' * - * @param \Yoast\MyYoastApiClient\Model\AddSubscriptionDto $addSubscriptionDto (required) * @param string $id (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiSitesIdSubscriptionsPutRequest($addSubscriptionDto, $id) + protected function siteControllerGetOneRequest($id, $filter = null) { - // verify the required parameter 'addSubscriptionDto' is set - if ($addSubscriptionDto === null || (is_array($addSubscriptionDto) && count($addSubscriptionDto) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $addSubscriptionDto when calling apiSitesIdSubscriptionsPut' - ); - } // 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 apiSitesIdSubscriptionsPut' + 'Missing the required parameter $id when calling siteControllerGetOne' ); } - $resourcePath = '/api/Sites/{id}/subscriptions'; + $resourcePath = '/api/Sites/{id}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + if ($filter !== null) { + $queryParams['filter'] = ObjectSerializer::toQueryValue($filter, null); + } // path params if ($id !== null) { @@ -1598,9 +1599,6 @@ protected function apiSitesIdSubscriptionsPutRequest($addSubscriptionDto, $id) // body params $_tempBody = null; - if (isset($addSubscriptionDto)) { - $_tempBody = $addSubscriptionDto; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -1609,7 +1607,7 @@ protected function apiSitesIdSubscriptionsPutRequest($addSubscriptionDto, $id) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -1617,16 +1615,9 @@ protected function apiSitesIdSubscriptionsPutRequest($addSubscriptionDto, $id) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -1649,11 +1640,10 @@ protected function apiSitesIdSubscriptionsPutRequest($addSubscriptionDto, $id) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1668,7 +1658,7 @@ protected function apiSitesIdSubscriptionsPutRequest($addSubscriptionDto, $id) $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'PUT', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -1676,39 +1666,37 @@ protected function apiSitesIdSubscriptionsPutRequest($addSubscriptionDto, $id) } /** - * Operation apiSitesIdSubscriptionsSubscriptionIdDelete - * - * Removes a subscription from a site + * Operation siteControllerIndex * - * @param string $id id (required) - * @param string $subscriptionId subscriptionId (required) + * @param string $token token (required) + * @param string $url url (required) + * @param string $method method (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\Site + * @return object */ - public function apiSitesIdSubscriptionsSubscriptionIdDelete($id, $subscriptionId) + public function siteControllerIndex($token, $url, $method) { - list($response) = $this->apiSitesIdSubscriptionsSubscriptionIdDeleteWithHttpInfo($id, $subscriptionId); + list($response) = $this->siteControllerIndexWithHttpInfo($token, $url, $method); return $response; } /** - * Operation apiSitesIdSubscriptionsSubscriptionIdDeleteWithHttpInfo + * Operation siteControllerIndexWithHttpInfo * - * Removes a subscription from a site - * - * @param string $id (required) - * @param string $subscriptionId (required) + * @param string $token (required) + * @param string $url (required) + * @param string $method (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Yoast\MyYoastApiClient\Model\Site, HTTP status code, HTTP response headers (array of strings) + * @return array of object, HTTP status code, HTTP response headers (array of strings) */ - public function apiSitesIdSubscriptionsSubscriptionIdDeleteWithHttpInfo($id, $subscriptionId) + public function siteControllerIndexWithHttpInfo($token, $url, $method) { - $returnType = '\Yoast\MyYoastApiClient\Model\Site'; - $request = $this->apiSitesIdSubscriptionsSubscriptionIdDeleteRequest($id, $subscriptionId); + $returnType = 'object'; + $request = $this->siteControllerIndexRequest($token, $url, $method); try { $options = $this->createHttpClientOption(); @@ -1743,7 +1731,7 @@ public function apiSitesIdSubscriptionsSubscriptionIdDeleteWithHttpInfo($id, $su $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -1759,7 +1747,7 @@ public function apiSitesIdSubscriptionsSubscriptionIdDeleteWithHttpInfo($id, $su case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Yoast\MyYoastApiClient\Model\Site', + 'object', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1770,19 +1758,20 @@ public function apiSitesIdSubscriptionsSubscriptionIdDeleteWithHttpInfo($id, $su } /** - * Operation apiSitesIdSubscriptionsSubscriptionIdDeleteAsync + * Operation siteControllerIndexAsync * - * Removes a subscription from a site + * * - * @param string $id (required) - * @param string $subscriptionId (required) + * @param string $token (required) + * @param string $url (required) + * @param string $method (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiSitesIdSubscriptionsSubscriptionIdDeleteAsync($id, $subscriptionId) + public function siteControllerIndexAsync($token, $url, $method) { - return $this->apiSitesIdSubscriptionsSubscriptionIdDeleteAsyncWithHttpInfo($id, $subscriptionId) + return $this->siteControllerIndexAsyncWithHttpInfo($token, $url, $method) ->then( function ($response) { return $response[0]; @@ -1791,20 +1780,21 @@ function ($response) { } /** - * Operation apiSitesIdSubscriptionsSubscriptionIdDeleteAsyncWithHttpInfo + * Operation siteControllerIndexAsyncWithHttpInfo * - * Removes a subscription from a site + * * - * @param string $id (required) - * @param string $subscriptionId (required) + * @param string $token (required) + * @param string $url (required) + * @param string $method (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiSitesIdSubscriptionsSubscriptionIdDeleteAsyncWithHttpInfo($id, $subscriptionId) + public function siteControllerIndexAsyncWithHttpInfo($token, $url, $method) { - $returnType = '\Yoast\MyYoastApiClient\Model\Site'; - $request = $this->apiSitesIdSubscriptionsSubscriptionIdDeleteRequest($id, $subscriptionId); + $returnType = 'object'; + $request = $this->siteControllerIndexRequest($token, $url, $method); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1844,30 +1834,37 @@ function ($exception) { } /** - * Create request for operation 'apiSitesIdSubscriptionsSubscriptionIdDelete' + * Create request for operation 'siteControllerIndex' * - * @param string $id (required) - * @param string $subscriptionId (required) + * @param string $token (required) + * @param string $url (required) + * @param string $method (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiSitesIdSubscriptionsSubscriptionIdDeleteRequest($id, $subscriptionId) + protected function siteControllerIndexRequest($token, $url, $method) { - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { + // verify the required parameter 'token' is set + if ($token === null || (is_array($token) && count($token) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling apiSitesIdSubscriptionsSubscriptionIdDelete' + 'Missing the required parameter $token when calling siteControllerIndex' ); } - // verify the required parameter 'subscriptionId' is set - if ($subscriptionId === null || (is_array($subscriptionId) && count($subscriptionId) === 0)) { + // verify the required parameter 'url' is set + if ($url === null || (is_array($url) && count($url) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $url when calling siteControllerIndex' + ); + } + // verify the required parameter 'method' is set + if ($method === null || (is_array($method) && count($method) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $subscriptionId when calling apiSitesIdSubscriptionsSubscriptionIdDelete' + 'Missing the required parameter $method when calling siteControllerIndex' ); } - $resourcePath = '/api/Sites/{id}/subscriptions/{subscriptionId}'; + $resourcePath = '/api/Sites/index'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1876,18 +1873,26 @@ protected function apiSitesIdSubscriptionsSubscriptionIdDeleteRequest($id, $subs // path params - if ($id !== null) { + if ($token !== null) { $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), + '{' . 'token' . '}', + ObjectSerializer::toPathValue($token), $resourcePath ); } // path params - if ($subscriptionId !== null) { + if ($url !== null) { $resourcePath = str_replace( - '{' . 'subscriptionId' . '}', - ObjectSerializer::toPathValue($subscriptionId), + '{' . 'url' . '}', + ObjectSerializer::toPathValue($url), + $resourcePath + ); + } + // path params + if ($method !== null) { + $resourcePath = str_replace( + '{' . 'method' . '}', + ObjectSerializer::toPathValue($method), $resourcePath ); } @@ -1902,7 +1907,7 @@ protected function apiSitesIdSubscriptionsSubscriptionIdDeleteRequest($id, $subs } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -1910,16 +1915,9 @@ protected function apiSitesIdSubscriptionsSubscriptionIdDeleteRequest($id, $subs if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -1942,11 +1940,10 @@ protected function apiSitesIdSubscriptionsSubscriptionIdDeleteRequest($id, $subs } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1961,7 +1958,7 @@ protected function apiSitesIdSubscriptionsSubscriptionIdDeleteRequest($id, $subs $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'DELETE', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -1969,37 +1966,37 @@ protected function apiSitesIdSubscriptionsSubscriptionIdDeleteRequest($id, $subs } /** - * Operation apiSitesIndexPost + * Operation siteControllerSwitchSubscription * - * @param string $token token (required) - * @param string $url url (required) - * @param string $method method (required) + * Switches the subscription for a number of times. + * + * @param \Yoast\MyYoastApiClient\Model\TransferSiteDto $body body (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return object + * @return int */ - public function apiSitesIndexPost($token, $url, $method) + public function siteControllerSwitchSubscription($body) { - list($response) = $this->apiSitesIndexPostWithHttpInfo($token, $url, $method); + list($response) = $this->siteControllerSwitchSubscriptionWithHttpInfo($body); return $response; } /** - * Operation apiSitesIndexPostWithHttpInfo + * Operation siteControllerSwitchSubscriptionWithHttpInfo * - * @param string $token (required) - * @param string $url (required) - * @param string $method (required) + * Switches the subscription for a number of times. + * + * @param \Yoast\MyYoastApiClient\Model\TransferSiteDto $body (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of object, HTTP status code, HTTP response headers (array of strings) + * @return array of int, HTTP status code, HTTP response headers (array of strings) */ - public function apiSitesIndexPostWithHttpInfo($token, $url, $method) + public function siteControllerSwitchSubscriptionWithHttpInfo($body) { - $returnType = 'object'; - $request = $this->apiSitesIndexPostRequest($token, $url, $method); + $returnType = 'int'; + $request = $this->siteControllerSwitchSubscriptionRequest($body); try { $options = $this->createHttpClientOption(); @@ -2034,7 +2031,7 @@ public function apiSitesIndexPostWithHttpInfo($token, $url, $method) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -2050,7 +2047,7 @@ public function apiSitesIndexPostWithHttpInfo($token, $url, $method) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - 'object', + 'int', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -2061,20 +2058,18 @@ public function apiSitesIndexPostWithHttpInfo($token, $url, $method) } /** - * Operation apiSitesIndexPostAsync + * Operation siteControllerSwitchSubscriptionAsync * - * + * Switches the subscription for a number of times. * - * @param string $token (required) - * @param string $url (required) - * @param string $method (required) + * @param \Yoast\MyYoastApiClient\Model\TransferSiteDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiSitesIndexPostAsync($token, $url, $method) + public function siteControllerSwitchSubscriptionAsync($body) { - return $this->apiSitesIndexPostAsyncWithHttpInfo($token, $url, $method) + return $this->siteControllerSwitchSubscriptionAsyncWithHttpInfo($body) ->then( function ($response) { return $response[0]; @@ -2083,21 +2078,19 @@ function ($response) { } /** - * Operation apiSitesIndexPostAsyncWithHttpInfo + * Operation siteControllerSwitchSubscriptionAsyncWithHttpInfo * - * + * Switches the subscription for a number of times. * - * @param string $token (required) - * @param string $url (required) - * @param string $method (required) + * @param \Yoast\MyYoastApiClient\Model\TransferSiteDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiSitesIndexPostAsyncWithHttpInfo($token, $url, $method) + public function siteControllerSwitchSubscriptionAsyncWithHttpInfo($body) { - $returnType = 'object'; - $request = $this->apiSitesIndexPostRequest($token, $url, $method); + $returnType = 'int'; + $request = $this->siteControllerSwitchSubscriptionRequest($body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2137,37 +2130,23 @@ function ($exception) { } /** - * Create request for operation 'apiSitesIndexPost' + * Create request for operation 'siteControllerSwitchSubscription' * - * @param string $token (required) - * @param string $url (required) - * @param string $method (required) + * @param \Yoast\MyYoastApiClient\Model\TransferSiteDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiSitesIndexPostRequest($token, $url, $method) + protected function siteControllerSwitchSubscriptionRequest($body) { - // verify the required parameter 'token' is set - if ($token === null || (is_array($token) && count($token) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $token when calling apiSitesIndexPost' - ); - } - // verify the required parameter 'url' is set - if ($url === null || (is_array($url) && count($url) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $url when calling apiSitesIndexPost' - ); - } - // verify the required parameter 'method' is set - if ($method === null || (is_array($method) && count($method) === 0)) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $method when calling apiSitesIndexPost' + 'Missing the required parameter $body when calling siteControllerSwitchSubscription' ); } - $resourcePath = '/api/Sites/index'; + $resourcePath = '/api/Sites/switchSubscription'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2175,33 +2154,12 @@ protected function apiSitesIndexPostRequest($token, $url, $method) $multipart = false; - // path params - if ($token !== null) { - $resourcePath = str_replace( - '{' . 'token' . '}', - ObjectSerializer::toPathValue($token), - $resourcePath - ); - } - // path params - if ($url !== null) { - $resourcePath = str_replace( - '{' . 'url' . '}', - ObjectSerializer::toPathValue($url), - $resourcePath - ); - } - // path params - if ($method !== null) { - $resourcePath = str_replace( - '{' . 'method' . '}', - ObjectSerializer::toPathValue($method), - $resourcePath - ); - } // body params $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -2218,16 +2176,9 @@ protected function apiSitesIndexPostRequest($token, $url, $method) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -2250,11 +2201,10 @@ protected function apiSitesIndexPostRequest($token, $url, $method) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -2277,39 +2227,37 @@ protected function apiSitesIndexPostRequest($token, $url, $method) } /** - * Operation apiSitesInfoGet + * Operation siteControllerSwitchSubscriptionNumberOfTimes * - * Get the current connected site for an access token. + * Switches the subscription for a number of times. * - * @param string $token token (optional) - * @param string $url url (optional) + * @param \Yoast\MyYoastApiClient\Model\SwitchSubscriptionNumberOfTimesDto $body body (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return object + * @return int */ - public function apiSitesInfoGet($token = null, $url = null) + public function siteControllerSwitchSubscriptionNumberOfTimes($body) { - list($response) = $this->apiSitesInfoGetWithHttpInfo($token, $url); + list($response) = $this->siteControllerSwitchSubscriptionNumberOfTimesWithHttpInfo($body); return $response; } /** - * Operation apiSitesInfoGetWithHttpInfo + * Operation siteControllerSwitchSubscriptionNumberOfTimesWithHttpInfo * - * Get the current connected site for an access token. + * Switches the subscription for a number of times. * - * @param string $token (optional) - * @param string $url (optional) + * @param \Yoast\MyYoastApiClient\Model\SwitchSubscriptionNumberOfTimesDto $body (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of object, HTTP status code, HTTP response headers (array of strings) + * @return array of int, HTTP status code, HTTP response headers (array of strings) */ - public function apiSitesInfoGetWithHttpInfo($token = null, $url = null) + public function siteControllerSwitchSubscriptionNumberOfTimesWithHttpInfo($body) { - $returnType = 'object'; - $request = $this->apiSitesInfoGetRequest($token, $url); + $returnType = 'int'; + $request = $this->siteControllerSwitchSubscriptionNumberOfTimesRequest($body); try { $options = $this->createHttpClientOption(); @@ -2344,7 +2292,7 @@ public function apiSitesInfoGetWithHttpInfo($token = null, $url = null) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -2360,7 +2308,7 @@ public function apiSitesInfoGetWithHttpInfo($token = null, $url = null) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - 'object', + 'int', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -2371,19 +2319,18 @@ public function apiSitesInfoGetWithHttpInfo($token = null, $url = null) } /** - * Operation apiSitesInfoGetAsync + * Operation siteControllerSwitchSubscriptionNumberOfTimesAsync * - * Get the current connected site for an access token. + * Switches the subscription for a number of times. * - * @param string $token (optional) - * @param string $url (optional) + * @param \Yoast\MyYoastApiClient\Model\SwitchSubscriptionNumberOfTimesDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiSitesInfoGetAsync($token = null, $url = null) + public function siteControllerSwitchSubscriptionNumberOfTimesAsync($body) { - return $this->apiSitesInfoGetAsyncWithHttpInfo($token, $url) + return $this->siteControllerSwitchSubscriptionNumberOfTimesAsyncWithHttpInfo($body) ->then( function ($response) { return $response[0]; @@ -2392,20 +2339,19 @@ function ($response) { } /** - * Operation apiSitesInfoGetAsyncWithHttpInfo + * Operation siteControllerSwitchSubscriptionNumberOfTimesAsyncWithHttpInfo * - * Get the current connected site for an access token. + * Switches the subscription for a number of times. * - * @param string $token (optional) - * @param string $url (optional) + * @param \Yoast\MyYoastApiClient\Model\SwitchSubscriptionNumberOfTimesDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiSitesInfoGetAsyncWithHttpInfo($token = null, $url = null) + public function siteControllerSwitchSubscriptionNumberOfTimesAsyncWithHttpInfo($body) { - $returnType = 'object'; - $request = $this->apiSitesInfoGetRequest($token, $url); + $returnType = 'int'; + $request = $this->siteControllerSwitchSubscriptionNumberOfTimesRequest($body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2445,36 +2391,36 @@ function ($exception) { } /** - * Create request for operation 'apiSitesInfoGet' + * Create request for operation 'siteControllerSwitchSubscriptionNumberOfTimes' * - * @param string $token (optional) - * @param string $url (optional) + * @param \Yoast\MyYoastApiClient\Model\SwitchSubscriptionNumberOfTimesDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiSitesInfoGetRequest($token = null, $url = null) + protected function siteControllerSwitchSubscriptionNumberOfTimesRequest($body) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling siteControllerSwitchSubscriptionNumberOfTimes' + ); + } - $resourcePath = '/api/Sites/info'; + $resourcePath = '/api/Sites/switchSubscriptionNumberOfTimes'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if ($token !== null) { - $queryParams['token'] = ObjectSerializer::toQueryValue($token); - } - // query params - if ($url !== null) { - $queryParams['url'] = ObjectSerializer::toQueryValue($url); - } // body params $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -2491,16 +2437,9 @@ protected function apiSitesInfoGetRequest($token = null, $url = null) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -2523,11 +2462,10 @@ protected function apiSitesInfoGetRequest($token = null, $url = null) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -2542,7 +2480,7 @@ protected function apiSitesInfoGetRequest($token = null, $url = null) $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'GET', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -2550,37 +2488,37 @@ protected function apiSitesInfoGetRequest($token = null, $url = null) } /** - * Operation apiSitesSwitchSubscriptionNumberOfTimesPost + * Operation siteControllerTransfer * - * Switches the subscription for a number of times. + * Transfer sites. * - * @param \Yoast\MyYoastApiClient\Model\SwitchSubscriptionNumberOfTimesDto $switchSubscriptionNumberOfTimesDto switchSubscriptionNumberOfTimesDto (required) + * @param \Yoast\MyYoastApiClient\Model\TransferSiteDto $body body (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return object + * @return \Yoast\MyYoastApiClient\Model\Site[] */ - public function apiSitesSwitchSubscriptionNumberOfTimesPost($switchSubscriptionNumberOfTimesDto) + public function siteControllerTransfer($body) { - list($response) = $this->apiSitesSwitchSubscriptionNumberOfTimesPostWithHttpInfo($switchSubscriptionNumberOfTimesDto); + list($response) = $this->siteControllerTransferWithHttpInfo($body); return $response; } /** - * Operation apiSitesSwitchSubscriptionNumberOfTimesPostWithHttpInfo + * Operation siteControllerTransferWithHttpInfo * - * Switches the subscription for a number of times. + * Transfer sites. * - * @param \Yoast\MyYoastApiClient\Model\SwitchSubscriptionNumberOfTimesDto $switchSubscriptionNumberOfTimesDto (required) + * @param \Yoast\MyYoastApiClient\Model\TransferSiteDto $body (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of object, HTTP status code, HTTP response headers (array of strings) + * @return array of \Yoast\MyYoastApiClient\Model\Site[], HTTP status code, HTTP response headers (array of strings) */ - public function apiSitesSwitchSubscriptionNumberOfTimesPostWithHttpInfo($switchSubscriptionNumberOfTimesDto) + public function siteControllerTransferWithHttpInfo($body) { - $returnType = 'object'; - $request = $this->apiSitesSwitchSubscriptionNumberOfTimesPostRequest($switchSubscriptionNumberOfTimesDto); + $returnType = '\Yoast\MyYoastApiClient\Model\Site[]'; + $request = $this->siteControllerTransferRequest($body); try { $options = $this->createHttpClientOption(); @@ -2615,7 +2553,7 @@ public function apiSitesSwitchSubscriptionNumberOfTimesPostWithHttpInfo($switchS $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -2631,7 +2569,7 @@ public function apiSitesSwitchSubscriptionNumberOfTimesPostWithHttpInfo($switchS case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - 'object', + '\Yoast\MyYoastApiClient\Model\Site[]', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -2642,18 +2580,18 @@ public function apiSitesSwitchSubscriptionNumberOfTimesPostWithHttpInfo($switchS } /** - * Operation apiSitesSwitchSubscriptionNumberOfTimesPostAsync + * Operation siteControllerTransferAsync * - * Switches the subscription for a number of times. + * Transfer sites. * - * @param \Yoast\MyYoastApiClient\Model\SwitchSubscriptionNumberOfTimesDto $switchSubscriptionNumberOfTimesDto (required) + * @param \Yoast\MyYoastApiClient\Model\TransferSiteDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiSitesSwitchSubscriptionNumberOfTimesPostAsync($switchSubscriptionNumberOfTimesDto) + public function siteControllerTransferAsync($body) { - return $this->apiSitesSwitchSubscriptionNumberOfTimesPostAsyncWithHttpInfo($switchSubscriptionNumberOfTimesDto) + return $this->siteControllerTransferAsyncWithHttpInfo($body) ->then( function ($response) { return $response[0]; @@ -2662,19 +2600,19 @@ function ($response) { } /** - * Operation apiSitesSwitchSubscriptionNumberOfTimesPostAsyncWithHttpInfo + * Operation siteControllerTransferAsyncWithHttpInfo * - * Switches the subscription for a number of times. + * Transfer sites. * - * @param \Yoast\MyYoastApiClient\Model\SwitchSubscriptionNumberOfTimesDto $switchSubscriptionNumberOfTimesDto (required) + * @param \Yoast\MyYoastApiClient\Model\TransferSiteDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiSitesSwitchSubscriptionNumberOfTimesPostAsyncWithHttpInfo($switchSubscriptionNumberOfTimesDto) + public function siteControllerTransferAsyncWithHttpInfo($body) { - $returnType = 'object'; - $request = $this->apiSitesSwitchSubscriptionNumberOfTimesPostRequest($switchSubscriptionNumberOfTimesDto); + $returnType = '\Yoast\MyYoastApiClient\Model\Site[]'; + $request = $this->siteControllerTransferRequest($body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2714,23 +2652,23 @@ function ($exception) { } /** - * Create request for operation 'apiSitesSwitchSubscriptionNumberOfTimesPost' + * Create request for operation 'siteControllerTransfer' * - * @param \Yoast\MyYoastApiClient\Model\SwitchSubscriptionNumberOfTimesDto $switchSubscriptionNumberOfTimesDto (required) + * @param \Yoast\MyYoastApiClient\Model\TransferSiteDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiSitesSwitchSubscriptionNumberOfTimesPostRequest($switchSubscriptionNumberOfTimesDto) + protected function siteControllerTransferRequest($body) { - // verify the required parameter 'switchSubscriptionNumberOfTimesDto' is set - if ($switchSubscriptionNumberOfTimesDto === null || (is_array($switchSubscriptionNumberOfTimesDto) && count($switchSubscriptionNumberOfTimesDto) === 0)) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $switchSubscriptionNumberOfTimesDto when calling apiSitesSwitchSubscriptionNumberOfTimesPost' + 'Missing the required parameter $body when calling siteControllerTransfer' ); } - $resourcePath = '/api/Sites/switchSubscriptionNumberOfTimes'; + $resourcePath = '/api/Sites/transfer'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2741,8 +2679,8 @@ protected function apiSitesSwitchSubscriptionNumberOfTimesPostRequest($switchSub // body params $_tempBody = null; - if (isset($switchSubscriptionNumberOfTimesDto)) { - $_tempBody = $switchSubscriptionNumberOfTimesDto; + if (isset($body)) { + $_tempBody = $body; } if ($multipart) { @@ -2760,16 +2698,9 @@ protected function apiSitesSwitchSubscriptionNumberOfTimesPostRequest($switchSub if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -2792,11 +2723,10 @@ protected function apiSitesSwitchSubscriptionNumberOfTimesPostRequest($switchSub } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -2819,37 +2749,35 @@ protected function apiSitesSwitchSubscriptionNumberOfTimesPostRequest($switchSub } /** - * Operation apiSitesSwitchSubscriptionPost + * Operation siteControllerUpdateOne * - * Switches the subscription for a number of times. - * - * @param \Yoast\MyYoastApiClient\Model\TransferSiteDto $transferSiteDto transferSiteDto (required) + * @param \Yoast\MyYoastApiClient\Model\UpdateSiteDto $body body (required) + * @param string $id id (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return float + * @return \Yoast\MyYoastApiClient\Model\Site */ - public function apiSitesSwitchSubscriptionPost($transferSiteDto) + public function siteControllerUpdateOne($body, $id) { - list($response) = $this->apiSitesSwitchSubscriptionPostWithHttpInfo($transferSiteDto); + list($response) = $this->siteControllerUpdateOneWithHttpInfo($body, $id); return $response; } /** - * Operation apiSitesSwitchSubscriptionPostWithHttpInfo + * Operation siteControllerUpdateOneWithHttpInfo * - * Switches the subscription for a number of times. - * - * @param \Yoast\MyYoastApiClient\Model\TransferSiteDto $transferSiteDto (required) + * @param \Yoast\MyYoastApiClient\Model\UpdateSiteDto $body (required) + * @param string $id (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of float, HTTP status code, HTTP response headers (array of strings) + * @return array of \Yoast\MyYoastApiClient\Model\Site, HTTP status code, HTTP response headers (array of strings) */ - public function apiSitesSwitchSubscriptionPostWithHttpInfo($transferSiteDto) + public function siteControllerUpdateOneWithHttpInfo($body, $id) { - $returnType = 'float'; - $request = $this->apiSitesSwitchSubscriptionPostRequest($transferSiteDto); + $returnType = '\Yoast\MyYoastApiClient\Model\Site'; + $request = $this->siteControllerUpdateOneRequest($body, $id); try { $options = $this->createHttpClientOption(); @@ -2884,7 +2812,7 @@ public function apiSitesSwitchSubscriptionPostWithHttpInfo($transferSiteDto) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -2900,7 +2828,7 @@ public function apiSitesSwitchSubscriptionPostWithHttpInfo($transferSiteDto) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - 'float', + '\Yoast\MyYoastApiClient\Model\Site', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -2911,18 +2839,19 @@ public function apiSitesSwitchSubscriptionPostWithHttpInfo($transferSiteDto) } /** - * Operation apiSitesSwitchSubscriptionPostAsync + * Operation siteControllerUpdateOneAsync * - * Switches the subscription for a number of times. + * * - * @param \Yoast\MyYoastApiClient\Model\TransferSiteDto $transferSiteDto (required) + * @param \Yoast\MyYoastApiClient\Model\UpdateSiteDto $body (required) + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiSitesSwitchSubscriptionPostAsync($transferSiteDto) + public function siteControllerUpdateOneAsync($body, $id) { - return $this->apiSitesSwitchSubscriptionPostAsyncWithHttpInfo($transferSiteDto) + return $this->siteControllerUpdateOneAsyncWithHttpInfo($body, $id) ->then( function ($response) { return $response[0]; @@ -2931,19 +2860,20 @@ function ($response) { } /** - * Operation apiSitesSwitchSubscriptionPostAsyncWithHttpInfo + * Operation siteControllerUpdateOneAsyncWithHttpInfo * - * Switches the subscription for a number of times. + * * - * @param \Yoast\MyYoastApiClient\Model\TransferSiteDto $transferSiteDto (required) + * @param \Yoast\MyYoastApiClient\Model\UpdateSiteDto $body (required) + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiSitesSwitchSubscriptionPostAsyncWithHttpInfo($transferSiteDto) + public function siteControllerUpdateOneAsyncWithHttpInfo($body, $id) { - $returnType = 'float'; - $request = $this->apiSitesSwitchSubscriptionPostRequest($transferSiteDto); + $returnType = '\Yoast\MyYoastApiClient\Model\Site'; + $request = $this->siteControllerUpdateOneRequest($body, $id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2983,23 +2913,30 @@ function ($exception) { } /** - * Create request for operation 'apiSitesSwitchSubscriptionPost' + * Create request for operation 'siteControllerUpdateOne' * - * @param \Yoast\MyYoastApiClient\Model\TransferSiteDto $transferSiteDto (required) + * @param \Yoast\MyYoastApiClient\Model\UpdateSiteDto $body (required) + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiSitesSwitchSubscriptionPostRequest($transferSiteDto) + protected function siteControllerUpdateOneRequest($body, $id) { - // verify the required parameter 'transferSiteDto' is set - if ($transferSiteDto === null || (is_array($transferSiteDto) && count($transferSiteDto) === 0)) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling siteControllerUpdateOne' + ); + } + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $transferSiteDto when calling apiSitesSwitchSubscriptionPost' + 'Missing the required parameter $id when calling siteControllerUpdateOne' ); } - $resourcePath = '/api/Sites/switchSubscription'; + $resourcePath = '/api/Sites/{id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -3007,11 +2944,19 @@ protected function apiSitesSwitchSubscriptionPostRequest($transferSiteDto) $multipart = false; + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } // body params $_tempBody = null; - if (isset($transferSiteDto)) { - $_tempBody = $transferSiteDto; + if (isset($body)) { + $_tempBody = $body; } if ($multipart) { @@ -3029,16 +2974,9 @@ protected function apiSitesSwitchSubscriptionPostRequest($transferSiteDto) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -3061,11 +2999,10 @@ protected function apiSitesSwitchSubscriptionPostRequest($transferSiteDto) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -3080,7 +3017,7 @@ protected function apiSitesSwitchSubscriptionPostRequest($transferSiteDto) $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'POST', + 'PATCH', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -3088,37 +3025,39 @@ protected function apiSitesSwitchSubscriptionPostRequest($transferSiteDto) } /** - * Operation apiSitesTransferPost + * Operation siteSubscriptionControllerAddSubscription * - * Transfer sites. + * Adds a subscription to a site * - * @param \Yoast\MyYoastApiClient\Model\TransferSiteDto $transferSiteDto transferSiteDto (required) + * @param \Yoast\MyYoastApiClient\Model\AddSubscriptionDto $body body (required) + * @param string $id id (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\Site[] + * @return \Yoast\MyYoastApiClient\Model\Site */ - public function apiSitesTransferPost($transferSiteDto) + public function siteSubscriptionControllerAddSubscription($body, $id) { - list($response) = $this->apiSitesTransferPostWithHttpInfo($transferSiteDto); + list($response) = $this->siteSubscriptionControllerAddSubscriptionWithHttpInfo($body, $id); return $response; } /** - * Operation apiSitesTransferPostWithHttpInfo + * Operation siteSubscriptionControllerAddSubscriptionWithHttpInfo * - * Transfer sites. + * Adds a subscription to a site * - * @param \Yoast\MyYoastApiClient\Model\TransferSiteDto $transferSiteDto (required) + * @param \Yoast\MyYoastApiClient\Model\AddSubscriptionDto $body (required) + * @param string $id (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Yoast\MyYoastApiClient\Model\Site[], HTTP status code, HTTP response headers (array of strings) + * @return array of \Yoast\MyYoastApiClient\Model\Site, HTTP status code, HTTP response headers (array of strings) */ - public function apiSitesTransferPostWithHttpInfo($transferSiteDto) + public function siteSubscriptionControllerAddSubscriptionWithHttpInfo($body, $id) { - $returnType = '\Yoast\MyYoastApiClient\Model\Site[]'; - $request = $this->apiSitesTransferPostRequest($transferSiteDto); + $returnType = '\Yoast\MyYoastApiClient\Model\Site'; + $request = $this->siteSubscriptionControllerAddSubscriptionRequest($body, $id); try { $options = $this->createHttpClientOption(); @@ -3153,7 +3092,7 @@ public function apiSitesTransferPostWithHttpInfo($transferSiteDto) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -3169,7 +3108,7 @@ public function apiSitesTransferPostWithHttpInfo($transferSiteDto) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Yoast\MyYoastApiClient\Model\Site[]', + '\Yoast\MyYoastApiClient\Model\Site', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -3180,18 +3119,19 @@ public function apiSitesTransferPostWithHttpInfo($transferSiteDto) } /** - * Operation apiSitesTransferPostAsync + * Operation siteSubscriptionControllerAddSubscriptionAsync * - * Transfer sites. + * Adds a subscription to a site * - * @param \Yoast\MyYoastApiClient\Model\TransferSiteDto $transferSiteDto (required) + * @param \Yoast\MyYoastApiClient\Model\AddSubscriptionDto $body (required) + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiSitesTransferPostAsync($transferSiteDto) + public function siteSubscriptionControllerAddSubscriptionAsync($body, $id) { - return $this->apiSitesTransferPostAsyncWithHttpInfo($transferSiteDto) + return $this->siteSubscriptionControllerAddSubscriptionAsyncWithHttpInfo($body, $id) ->then( function ($response) { return $response[0]; @@ -3200,19 +3140,20 @@ function ($response) { } /** - * Operation apiSitesTransferPostAsyncWithHttpInfo + * Operation siteSubscriptionControllerAddSubscriptionAsyncWithHttpInfo * - * Transfer sites. + * Adds a subscription to a site * - * @param \Yoast\MyYoastApiClient\Model\TransferSiteDto $transferSiteDto (required) + * @param \Yoast\MyYoastApiClient\Model\AddSubscriptionDto $body (required) + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiSitesTransferPostAsyncWithHttpInfo($transferSiteDto) + public function siteSubscriptionControllerAddSubscriptionAsyncWithHttpInfo($body, $id) { - $returnType = '\Yoast\MyYoastApiClient\Model\Site[]'; - $request = $this->apiSitesTransferPostRequest($transferSiteDto); + $returnType = '\Yoast\MyYoastApiClient\Model\Site'; + $request = $this->siteSubscriptionControllerAddSubscriptionRequest($body, $id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3252,23 +3193,30 @@ function ($exception) { } /** - * Create request for operation 'apiSitesTransferPost' + * Create request for operation 'siteSubscriptionControllerAddSubscription' * - * @param \Yoast\MyYoastApiClient\Model\TransferSiteDto $transferSiteDto (required) + * @param \Yoast\MyYoastApiClient\Model\AddSubscriptionDto $body (required) + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiSitesTransferPostRequest($transferSiteDto) + protected function siteSubscriptionControllerAddSubscriptionRequest($body, $id) { - // verify the required parameter 'transferSiteDto' is set - if ($transferSiteDto === null || (is_array($transferSiteDto) && count($transferSiteDto) === 0)) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling siteSubscriptionControllerAddSubscription' + ); + } + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $transferSiteDto when calling apiSitesTransferPost' + 'Missing the required parameter $id when calling siteSubscriptionControllerAddSubscription' ); } - $resourcePath = '/api/Sites/transfer'; + $resourcePath = '/api/Sites/{id}/subscriptions'; $formParams = []; $queryParams = []; $headerParams = []; @@ -3276,11 +3224,19 @@ protected function apiSitesTransferPostRequest($transferSiteDto) $multipart = false; + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } // body params $_tempBody = null; - if (isset($transferSiteDto)) { - $_tempBody = $transferSiteDto; + if (isset($body)) { + $_tempBody = $body; } if ($multipart) { @@ -3298,16 +3254,294 @@ protected function apiSitesTransferPostRequest($transferSiteDto) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'PUT', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation siteSubscriptionControllerRemoveSubscription + * + * Removes a subscription from a site + * + * @param string $id id (required) + * @param string $subscriptionId subscriptionId (required) + * + * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Yoast\MyYoastApiClient\Model\Site + */ + public function siteSubscriptionControllerRemoveSubscription($id, $subscriptionId) + { + list($response) = $this->siteSubscriptionControllerRemoveSubscriptionWithHttpInfo($id, $subscriptionId); + return $response; + } + + /** + * Operation siteSubscriptionControllerRemoveSubscriptionWithHttpInfo + * + * Removes a subscription from a site + * + * @param string $id (required) + * @param string $subscriptionId (required) + * + * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Yoast\MyYoastApiClient\Model\Site, HTTP status code, HTTP response headers (array of strings) + */ + public function siteSubscriptionControllerRemoveSubscriptionWithHttpInfo($id, $subscriptionId) + { + $returnType = '\Yoast\MyYoastApiClient\Model\Site'; + $request = $this->siteSubscriptionControllerRemoveSubscriptionRequest($id, $subscriptionId); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if (!in_array($returnType, ['string','integer','bool'])) { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Yoast\MyYoastApiClient\Model\Site', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation siteSubscriptionControllerRemoveSubscriptionAsync + * + * Removes a subscription from a site + * + * @param string $id (required) + * @param string $subscriptionId (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function siteSubscriptionControllerRemoveSubscriptionAsync($id, $subscriptionId) + { + return $this->siteSubscriptionControllerRemoveSubscriptionAsyncWithHttpInfo($id, $subscriptionId) + ->then( + function ($response) { + return $response[0]; } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); + ); + } + + /** + * Operation siteSubscriptionControllerRemoveSubscriptionAsyncWithHttpInfo + * + * Removes a subscription from a site + * + * @param string $id (required) + * @param string $subscriptionId (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function siteSubscriptionControllerRemoveSubscriptionAsyncWithHttpInfo($id, $subscriptionId) + { + $returnType = '\Yoast\MyYoastApiClient\Model\Site'; + $request = $this->siteSubscriptionControllerRemoveSubscriptionRequest($id, $subscriptionId); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + 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(), + $response->getBody() + ); } + ); + } + + /** + * Create request for operation 'siteSubscriptionControllerRemoveSubscription' + * + * @param string $id (required) + * @param string $subscriptionId (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function siteSubscriptionControllerRemoveSubscriptionRequest($id, $subscriptionId) + { + // 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 siteSubscriptionControllerRemoveSubscription' + ); + } + // verify the required parameter 'subscriptionId' is set + if ($subscriptionId === null || (is_array($subscriptionId) && count($subscriptionId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $subscriptionId when calling siteSubscriptionControllerRemoveSubscription' + ); + } + + $resourcePath = '/api/Sites/{id}/subscriptions/{subscriptionId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($subscriptionId !== null) { + $resourcePath = str_replace( + '{' . 'subscriptionId' . '}', + ObjectSerializer::toPathValue($subscriptionId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -3330,11 +3564,10 @@ protected function apiSitesTransferPostRequest($transferSiteDto) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -3349,7 +3582,7 @@ protected function apiSitesTransferPostRequest($transferSiteDto) $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'POST', + 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody diff --git a/src/Api/SubscriptionApi.php b/src/Api/SubscriptionApi.php index 76b68dc..705fca7 100644 --- a/src/Api/SubscriptionApi.php +++ b/src/Api/SubscriptionApi.php @@ -17,9 +17,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -39,56 +38,588 @@ use Yoast\MyYoastApiClient\HeaderSelector; use Yoast\MyYoastApiClient\ObjectSerializer; -/** - * SubscriptionApi Class Doc Comment - * - * @category Class - * @package Yoast\MyYoastApiClient - * @author Swagger Codegen team - * @link https://github.com/swagger-api/swagger-codegen - */ -class SubscriptionApi -{ +/** + * SubscriptionApi Class Doc Comment + * + * @category Class + * @package Yoast\MyYoastApiClient + * @author Swagger Codegen team + * @link https://github.com/swagger-api/swagger-codegen + */ +class SubscriptionApi +{ + /** + * @var ClientInterface + */ + protected $client; + + /** + * @var Configuration + */ + protected $config; + + /** + * @var HeaderSelector + */ + protected $headerSelector; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation subscriptionControllerDeleteOne + * + * Delete a subscription + * + * @param string $id id (required) + * + * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return string + */ + public function subscriptionControllerDeleteOne($id) + { + list($response) = $this->subscriptionControllerDeleteOneWithHttpInfo($id); + return $response; + } + + /** + * Operation subscriptionControllerDeleteOneWithHttpInfo + * + * Delete a subscription + * + * @param string $id (required) + * + * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of string, HTTP status code, HTTP response headers (array of strings) + */ + public function subscriptionControllerDeleteOneWithHttpInfo($id) + { + $returnType = 'string'; + $request = $this->subscriptionControllerDeleteOneRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if (!in_array($returnType, ['string','integer','bool'])) { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + 'string', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation subscriptionControllerDeleteOneAsync + * + * Delete a subscription + * + * @param string $id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function subscriptionControllerDeleteOneAsync($id) + { + return $this->subscriptionControllerDeleteOneAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation subscriptionControllerDeleteOneAsyncWithHttpInfo + * + * Delete a subscription + * + * @param string $id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function subscriptionControllerDeleteOneAsyncWithHttpInfo($id) + { + $returnType = 'string'; + $request = $this->subscriptionControllerDeleteOneRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + 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(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'subscriptionControllerDeleteOne' + * + * @param string $id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function subscriptionControllerDeleteOneRequest($id) + { + // 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 subscriptionControllerDeleteOne' + ); + } + + $resourcePath = '/api/Subscriptions/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'DELETE', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation subscriptionControllerForceCancel + * + * Forcefully cancel a subscription + * + * @param string $id id (required) + * + * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Yoast\MyYoastApiClient\Model\Subscription + */ + public function subscriptionControllerForceCancel($id) + { + list($response) = $this->subscriptionControllerForceCancelWithHttpInfo($id); + return $response; + } + + /** + * Operation subscriptionControllerForceCancelWithHttpInfo + * + * Forcefully cancel a subscription + * + * @param string $id (required) + * + * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Yoast\MyYoastApiClient\Model\Subscription, HTTP status code, HTTP response headers (array of strings) + */ + public function subscriptionControllerForceCancelWithHttpInfo($id) + { + $returnType = '\Yoast\MyYoastApiClient\Model\Subscription'; + $request = $this->subscriptionControllerForceCancelRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if (!in_array($returnType, ['string','integer','bool'])) { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Yoast\MyYoastApiClient\Model\Subscription', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + /** - * @var ClientInterface + * Operation subscriptionControllerForceCancelAsync + * + * Forcefully cancel a subscription + * + * @param string $id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - protected $client; + public function subscriptionControllerForceCancelAsync($id) + { + return $this->subscriptionControllerForceCancelAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } /** - * @var Configuration + * Operation subscriptionControllerForceCancelAsyncWithHttpInfo + * + * Forcefully cancel a subscription + * + * @param string $id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface */ - protected $config; + public function subscriptionControllerForceCancelAsyncWithHttpInfo($id) + { + $returnType = '\Yoast\MyYoastApiClient\Model\Subscription'; + $request = $this->subscriptionControllerForceCancelRequest($id); - /** - * @var HeaderSelector - */ - protected $headerSelector; + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } - /** - * @param ClientInterface $client - * @param Configuration $config - * @param HeaderSelector $selector - */ - public function __construct( - ClientInterface $client = null, - Configuration $config = null, - HeaderSelector $selector = null - ) { - $this->client = $client ?: new Client(); - $this->config = $config ?: new Configuration(); - $this->headerSelector = $selector ?: new HeaderSelector(); + 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(), + $response->getBody() + ); + } + ); } /** - * @return Configuration + * Create request for operation 'subscriptionControllerForceCancel' + * + * @param string $id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request */ - public function getConfig() + protected function subscriptionControllerForceCancelRequest($id) { - return $this->config; + // 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 subscriptionControllerForceCancel' + ); + } + + $resourcePath = '/api/Subscriptions/{id}/force-cancel'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); } /** - * Operation apiSubscriptionsExpiringGet + * Operation subscriptionControllerGetExpiringSubscriptions * * @param \DateTime $from from (required) * @param \DateTime $until until (required) @@ -98,14 +629,14 @@ public function getConfig() * @throws \InvalidArgumentException * @return \Yoast\MyYoastApiClient\Model\Subscription[] */ - public function apiSubscriptionsExpiringGet($from, $until, $requiresManualRenewal = null) + public function subscriptionControllerGetExpiringSubscriptions($from, $until, $requiresManualRenewal = null) { - list($response) = $this->apiSubscriptionsExpiringGetWithHttpInfo($from, $until, $requiresManualRenewal); + list($response) = $this->subscriptionControllerGetExpiringSubscriptionsWithHttpInfo($from, $until, $requiresManualRenewal); return $response; } /** - * Operation apiSubscriptionsExpiringGetWithHttpInfo + * Operation subscriptionControllerGetExpiringSubscriptionsWithHttpInfo * * @param \DateTime $from (required) * @param \DateTime $until (required) @@ -115,10 +646,10 @@ public function apiSubscriptionsExpiringGet($from, $until, $requiresManualRenewa * @throws \InvalidArgumentException * @return array of \Yoast\MyYoastApiClient\Model\Subscription[], HTTP status code, HTTP response headers (array of strings) */ - public function apiSubscriptionsExpiringGetWithHttpInfo($from, $until, $requiresManualRenewal = null) + public function subscriptionControllerGetExpiringSubscriptionsWithHttpInfo($from, $until, $requiresManualRenewal = null) { $returnType = '\Yoast\MyYoastApiClient\Model\Subscription[]'; - $request = $this->apiSubscriptionsExpiringGetRequest($from, $until, $requiresManualRenewal); + $request = $this->subscriptionControllerGetExpiringSubscriptionsRequest($from, $until, $requiresManualRenewal); try { $options = $this->createHttpClientOption(); @@ -153,7 +684,7 @@ public function apiSubscriptionsExpiringGetWithHttpInfo($from, $until, $requires $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -180,7 +711,7 @@ public function apiSubscriptionsExpiringGetWithHttpInfo($from, $until, $requires } /** - * Operation apiSubscriptionsExpiringGetAsync + * Operation subscriptionControllerGetExpiringSubscriptionsAsync * * * @@ -191,9 +722,9 @@ public function apiSubscriptionsExpiringGetWithHttpInfo($from, $until, $requires * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiSubscriptionsExpiringGetAsync($from, $until, $requiresManualRenewal = null) + public function subscriptionControllerGetExpiringSubscriptionsAsync($from, $until, $requiresManualRenewal = null) { - return $this->apiSubscriptionsExpiringGetAsyncWithHttpInfo($from, $until, $requiresManualRenewal) + return $this->subscriptionControllerGetExpiringSubscriptionsAsyncWithHttpInfo($from, $until, $requiresManualRenewal) ->then( function ($response) { return $response[0]; @@ -202,7 +733,7 @@ function ($response) { } /** - * Operation apiSubscriptionsExpiringGetAsyncWithHttpInfo + * Operation subscriptionControllerGetExpiringSubscriptionsAsyncWithHttpInfo * * * @@ -213,10 +744,10 @@ function ($response) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiSubscriptionsExpiringGetAsyncWithHttpInfo($from, $until, $requiresManualRenewal = null) + public function subscriptionControllerGetExpiringSubscriptionsAsyncWithHttpInfo($from, $until, $requiresManualRenewal = null) { $returnType = '\Yoast\MyYoastApiClient\Model\Subscription[]'; - $request = $this->apiSubscriptionsExpiringGetRequest($from, $until, $requiresManualRenewal); + $request = $this->subscriptionControllerGetExpiringSubscriptionsRequest($from, $until, $requiresManualRenewal); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -256,7 +787,7 @@ function ($exception) { } /** - * Create request for operation 'apiSubscriptionsExpiringGet' + * Create request for operation 'subscriptionControllerGetExpiringSubscriptions' * * @param \DateTime $from (required) * @param \DateTime $until (required) @@ -265,18 +796,18 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiSubscriptionsExpiringGetRequest($from, $until, $requiresManualRenewal = null) + protected function subscriptionControllerGetExpiringSubscriptionsRequest($from, $until, $requiresManualRenewal = null) { // verify the required parameter 'from' is set if ($from === null || (is_array($from) && count($from) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $from when calling apiSubscriptionsExpiringGet' + 'Missing the required parameter $from when calling subscriptionControllerGetExpiringSubscriptions' ); } // verify the required parameter 'until' is set if ($until === null || (is_array($until) && count($until) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $until when calling apiSubscriptionsExpiringGet' + 'Missing the required parameter $until when calling subscriptionControllerGetExpiringSubscriptions' ); } @@ -289,15 +820,15 @@ protected function apiSubscriptionsExpiringGetRequest($from, $until, $requiresMa // query params if ($from !== null) { - $queryParams['from'] = ObjectSerializer::toQueryValue($from); + $queryParams['from'] = ObjectSerializer::toQueryValue($from, 'date-time'); } // query params if ($until !== null) { - $queryParams['until'] = ObjectSerializer::toQueryValue($until); + $queryParams['until'] = ObjectSerializer::toQueryValue($until, 'date-time'); } // query params if ($requiresManualRenewal !== null) { - $queryParams['requiresManualRenewal'] = ObjectSerializer::toQueryValue($requiresManualRenewal); + $queryParams['requiresManualRenewal'] = ObjectSerializer::toQueryValue($requiresManualRenewal, null); } @@ -311,7 +842,7 @@ protected function apiSubscriptionsExpiringGetRequest($from, $until, $requiresMa } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -319,16 +850,9 @@ protected function apiSubscriptionsExpiringGetRequest($from, $until, $requiresMa if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -351,11 +875,10 @@ protected function apiSubscriptionsExpiringGetRequest($from, $until, $requiresMa } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -378,37 +901,37 @@ protected function apiSubscriptionsExpiringGetRequest($from, $until, $requiresMa } /** - * Operation apiSubscriptionsGet + * Operation subscriptionControllerGetMany * * Get subscriptions * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Yoast\MyYoastApiClient\Model\Subscription[] */ - public function apiSubscriptionsGet($filter = null) + public function subscriptionControllerGetMany($filter = null) { - list($response) = $this->apiSubscriptionsGetWithHttpInfo($filter); + list($response) = $this->subscriptionControllerGetManyWithHttpInfo($filter); return $response; } /** - * Operation apiSubscriptionsGetWithHttpInfo + * Operation subscriptionControllerGetManyWithHttpInfo * * Get subscriptions * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Yoast\MyYoastApiClient\Model\Subscription[], HTTP status code, HTTP response headers (array of strings) */ - public function apiSubscriptionsGetWithHttpInfo($filter = null) + public function subscriptionControllerGetManyWithHttpInfo($filter = null) { $returnType = '\Yoast\MyYoastApiClient\Model\Subscription[]'; - $request = $this->apiSubscriptionsGetRequest($filter); + $request = $this->subscriptionControllerGetManyRequest($filter); try { $options = $this->createHttpClientOption(); @@ -443,7 +966,7 @@ public function apiSubscriptionsGetWithHttpInfo($filter = null) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -470,18 +993,18 @@ public function apiSubscriptionsGetWithHttpInfo($filter = null) } /** - * Operation apiSubscriptionsGetAsync + * Operation subscriptionControllerGetManyAsync * * Get subscriptions * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiSubscriptionsGetAsync($filter = null) + public function subscriptionControllerGetManyAsync($filter = null) { - return $this->apiSubscriptionsGetAsyncWithHttpInfo($filter) + return $this->subscriptionControllerGetManyAsyncWithHttpInfo($filter) ->then( function ($response) { return $response[0]; @@ -490,19 +1013,19 @@ function ($response) { } /** - * Operation apiSubscriptionsGetAsyncWithHttpInfo + * Operation subscriptionControllerGetManyAsyncWithHttpInfo * * Get subscriptions * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiSubscriptionsGetAsyncWithHttpInfo($filter = null) + public function subscriptionControllerGetManyAsyncWithHttpInfo($filter = null) { $returnType = '\Yoast\MyYoastApiClient\Model\Subscription[]'; - $request = $this->apiSubscriptionsGetRequest($filter); + $request = $this->subscriptionControllerGetManyRequest($filter); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -542,14 +1065,14 @@ function ($exception) { } /** - * Create request for operation 'apiSubscriptionsGet' + * Create request for operation 'subscriptionControllerGetMany' * - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiSubscriptionsGetRequest($filter = null) + protected function subscriptionControllerGetManyRequest($filter = null) { $resourcePath = '/api/Subscriptions'; @@ -561,7 +1084,7 @@ protected function apiSubscriptionsGetRequest($filter = null) // query params if ($filter !== null) { - $queryParams['filter'] = ObjectSerializer::toQueryValue($filter); + $queryParams['filter'] = ObjectSerializer::toQueryValue($filter, null); } @@ -575,7 +1098,7 @@ protected function apiSubscriptionsGetRequest($filter = null) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -583,16 +1106,9 @@ protected function apiSubscriptionsGetRequest($filter = null) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -615,11 +1131,10 @@ protected function apiSubscriptionsGetRequest($filter = null) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -642,37 +1157,37 @@ protected function apiSubscriptionsGetRequest($filter = null) } /** - * Operation apiSubscriptionsIdDelete + * Operation subscriptionControllerGetManyPaged * - * Delete a subscription + * Get subscriptions * - * @param string $id id (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return string + * @return object */ - public function apiSubscriptionsIdDelete($id) + public function subscriptionControllerGetManyPaged($filter = null) { - list($response) = $this->apiSubscriptionsIdDeleteWithHttpInfo($id); + list($response) = $this->subscriptionControllerGetManyPagedWithHttpInfo($filter); return $response; } /** - * Operation apiSubscriptionsIdDeleteWithHttpInfo + * Operation subscriptionControllerGetManyPagedWithHttpInfo * - * Delete a subscription + * Get subscriptions * - * @param string $id (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of string, HTTP status code, HTTP response headers (array of strings) + * @return array of object, HTTP status code, HTTP response headers (array of strings) */ - public function apiSubscriptionsIdDeleteWithHttpInfo($id) + public function subscriptionControllerGetManyPagedWithHttpInfo($filter = null) { - $returnType = 'string'; - $request = $this->apiSubscriptionsIdDeleteRequest($id); + $returnType = 'object'; + $request = $this->subscriptionControllerGetManyPagedRequest($filter); try { $options = $this->createHttpClientOption(); @@ -707,7 +1222,7 @@ public function apiSubscriptionsIdDeleteWithHttpInfo($id) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -723,7 +1238,7 @@ public function apiSubscriptionsIdDeleteWithHttpInfo($id) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - 'string', + 'object', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -734,18 +1249,18 @@ public function apiSubscriptionsIdDeleteWithHttpInfo($id) } /** - * Operation apiSubscriptionsIdDeleteAsync + * Operation subscriptionControllerGetManyPagedAsync * - * Delete a subscription + * Get subscriptions * - * @param string $id (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiSubscriptionsIdDeleteAsync($id) + public function subscriptionControllerGetManyPagedAsync($filter = null) { - return $this->apiSubscriptionsIdDeleteAsyncWithHttpInfo($id) + return $this->subscriptionControllerGetManyPagedAsyncWithHttpInfo($filter) ->then( function ($response) { return $response[0]; @@ -754,19 +1269,19 @@ function ($response) { } /** - * Operation apiSubscriptionsIdDeleteAsyncWithHttpInfo + * Operation subscriptionControllerGetManyPagedAsyncWithHttpInfo * - * Delete a subscription + * Get subscriptions * - * @param string $id (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiSubscriptionsIdDeleteAsyncWithHttpInfo($id) + public function subscriptionControllerGetManyPagedAsyncWithHttpInfo($filter = null) { - $returnType = 'string'; - $request = $this->apiSubscriptionsIdDeleteRequest($id); + $returnType = 'object'; + $request = $this->subscriptionControllerGetManyPagedRequest($filter); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -806,39 +1321,29 @@ function ($exception) { } /** - * Create request for operation 'apiSubscriptionsIdDelete' + * Create request for operation 'subscriptionControllerGetManyPaged' * - * @param string $id (required) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiSubscriptionsIdDeleteRequest($id) + protected function subscriptionControllerGetManyPagedRequest($filter = null) { - // 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 apiSubscriptionsIdDelete' - ); - } - $resourcePath = '/api/Subscriptions/{id}'; + $resourcePath = '/api/Subscriptions/paged'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - - // path params - if ($id !== null) { - $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), - $resourcePath - ); + // query params + if ($filter !== null) { + $queryParams['filter'] = ObjectSerializer::toQueryValue($filter, null); } + // body params $_tempBody = null; @@ -849,7 +1354,7 @@ protected function apiSubscriptionsIdDeleteRequest($id) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -857,16 +1362,9 @@ protected function apiSubscriptionsIdDeleteRequest($id) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -889,11 +1387,10 @@ protected function apiSubscriptionsIdDeleteRequest($id) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -908,7 +1405,7 @@ protected function apiSubscriptionsIdDeleteRequest($id) $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'DELETE', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -916,39 +1413,39 @@ protected function apiSubscriptionsIdDeleteRequest($id) } /** - * Operation apiSubscriptionsIdGet + * Operation subscriptionControllerGetOne * * Get a subscription * * @param string $id id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Yoast\MyYoastApiClient\Model\Subscription */ - public function apiSubscriptionsIdGet($id, $filter = null) + public function subscriptionControllerGetOne($id, $filter = null) { - list($response) = $this->apiSubscriptionsIdGetWithHttpInfo($id, $filter); + list($response) = $this->subscriptionControllerGetOneWithHttpInfo($id, $filter); return $response; } /** - * Operation apiSubscriptionsIdGetWithHttpInfo + * Operation subscriptionControllerGetOneWithHttpInfo * * Get a subscription * * @param string $id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Yoast\MyYoastApiClient\Model\Subscription, HTTP status code, HTTP response headers (array of strings) */ - public function apiSubscriptionsIdGetWithHttpInfo($id, $filter = null) + public function subscriptionControllerGetOneWithHttpInfo($id, $filter = null) { $returnType = '\Yoast\MyYoastApiClient\Model\Subscription'; - $request = $this->apiSubscriptionsIdGetRequest($id, $filter); + $request = $this->subscriptionControllerGetOneRequest($id, $filter); try { $options = $this->createHttpClientOption(); @@ -983,7 +1480,7 @@ public function apiSubscriptionsIdGetWithHttpInfo($id, $filter = null) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -1010,19 +1507,19 @@ public function apiSubscriptionsIdGetWithHttpInfo($id, $filter = null) } /** - * Operation apiSubscriptionsIdGetAsync + * Operation subscriptionControllerGetOneAsync * * Get a subscription * * @param string $id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiSubscriptionsIdGetAsync($id, $filter = null) + public function subscriptionControllerGetOneAsync($id, $filter = null) { - return $this->apiSubscriptionsIdGetAsyncWithHttpInfo($id, $filter) + return $this->subscriptionControllerGetOneAsyncWithHttpInfo($id, $filter) ->then( function ($response) { return $response[0]; @@ -1031,20 +1528,20 @@ function ($response) { } /** - * Operation apiSubscriptionsIdGetAsyncWithHttpInfo + * Operation subscriptionControllerGetOneAsyncWithHttpInfo * * Get a subscription * * @param string $id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiSubscriptionsIdGetAsyncWithHttpInfo($id, $filter = null) + public function subscriptionControllerGetOneAsyncWithHttpInfo($id, $filter = null) { $returnType = '\Yoast\MyYoastApiClient\Model\Subscription'; - $request = $this->apiSubscriptionsIdGetRequest($id, $filter); + $request = $this->subscriptionControllerGetOneRequest($id, $filter); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1084,20 +1581,20 @@ function ($exception) { } /** - * Create request for operation 'apiSubscriptionsIdGet' + * Create request for operation 'subscriptionControllerGetOne' * * @param string $id (required) - * @param map[string,string] $filter Used for filtering/joining the results. (optional) + * @param object $filter Used for filtering/joining the results. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiSubscriptionsIdGetRequest($id, $filter = null) + protected function subscriptionControllerGetOneRequest($id, $filter = null) { // 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 apiSubscriptionsIdGet' + 'Missing the required parameter $id when calling subscriptionControllerGetOne' ); } @@ -1110,7 +1607,7 @@ protected function apiSubscriptionsIdGetRequest($id, $filter = null) // query params if ($filter !== null) { - $queryParams['filter'] = ObjectSerializer::toQueryValue($filter); + $queryParams['filter'] = ObjectSerializer::toQueryValue($filter, null); } // path params @@ -1132,7 +1629,7 @@ protected function apiSubscriptionsIdGetRequest($id, $filter = null) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -1140,16 +1637,9 @@ protected function apiSubscriptionsIdGetRequest($id, $filter = null) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -1172,11 +1662,10 @@ protected function apiSubscriptionsIdGetRequest($id, $filter = null) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1199,7 +1688,7 @@ protected function apiSubscriptionsIdGetRequest($id, $filter = null) } /** - * Operation apiSubscriptionsIdRecalculateSubscriptionCountPost + * Operation subscriptionControllerRecalculateSubscriptionCount * * Recalculate SubscriptionCount. * @@ -1209,14 +1698,14 @@ protected function apiSubscriptionsIdGetRequest($id, $filter = null) * @throws \InvalidArgumentException * @return \Yoast\MyYoastApiClient\Model\Subscription */ - public function apiSubscriptionsIdRecalculateSubscriptionCountPost($id) + public function subscriptionControllerRecalculateSubscriptionCount($id) { - list($response) = $this->apiSubscriptionsIdRecalculateSubscriptionCountPostWithHttpInfo($id); + list($response) = $this->subscriptionControllerRecalculateSubscriptionCountWithHttpInfo($id); return $response; } /** - * Operation apiSubscriptionsIdRecalculateSubscriptionCountPostWithHttpInfo + * Operation subscriptionControllerRecalculateSubscriptionCountWithHttpInfo * * Recalculate SubscriptionCount. * @@ -1226,10 +1715,10 @@ public function apiSubscriptionsIdRecalculateSubscriptionCountPost($id) * @throws \InvalidArgumentException * @return array of \Yoast\MyYoastApiClient\Model\Subscription, HTTP status code, HTTP response headers (array of strings) */ - public function apiSubscriptionsIdRecalculateSubscriptionCountPostWithHttpInfo($id) + public function subscriptionControllerRecalculateSubscriptionCountWithHttpInfo($id) { $returnType = '\Yoast\MyYoastApiClient\Model\Subscription'; - $request = $this->apiSubscriptionsIdRecalculateSubscriptionCountPostRequest($id); + $request = $this->subscriptionControllerRecalculateSubscriptionCountRequest($id); try { $options = $this->createHttpClientOption(); @@ -1264,7 +1753,7 @@ public function apiSubscriptionsIdRecalculateSubscriptionCountPostWithHttpInfo($ $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -1291,7 +1780,7 @@ public function apiSubscriptionsIdRecalculateSubscriptionCountPostWithHttpInfo($ } /** - * Operation apiSubscriptionsIdRecalculateSubscriptionCountPostAsync + * Operation subscriptionControllerRecalculateSubscriptionCountAsync * * Recalculate SubscriptionCount. * @@ -1300,9 +1789,9 @@ public function apiSubscriptionsIdRecalculateSubscriptionCountPostWithHttpInfo($ * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiSubscriptionsIdRecalculateSubscriptionCountPostAsync($id) + public function subscriptionControllerRecalculateSubscriptionCountAsync($id) { - return $this->apiSubscriptionsIdRecalculateSubscriptionCountPostAsyncWithHttpInfo($id) + return $this->subscriptionControllerRecalculateSubscriptionCountAsyncWithHttpInfo($id) ->then( function ($response) { return $response[0]; @@ -1311,7 +1800,7 @@ function ($response) { } /** - * Operation apiSubscriptionsIdRecalculateSubscriptionCountPostAsyncWithHttpInfo + * Operation subscriptionControllerRecalculateSubscriptionCountAsyncWithHttpInfo * * Recalculate SubscriptionCount. * @@ -1320,10 +1809,10 @@ function ($response) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiSubscriptionsIdRecalculateSubscriptionCountPostAsyncWithHttpInfo($id) + public function subscriptionControllerRecalculateSubscriptionCountAsyncWithHttpInfo($id) { $returnType = '\Yoast\MyYoastApiClient\Model\Subscription'; - $request = $this->apiSubscriptionsIdRecalculateSubscriptionCountPostRequest($id); + $request = $this->subscriptionControllerRecalculateSubscriptionCountRequest($id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1363,19 +1852,19 @@ function ($exception) { } /** - * Create request for operation 'apiSubscriptionsIdRecalculateSubscriptionCountPost' + * Create request for operation 'subscriptionControllerRecalculateSubscriptionCount' * * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiSubscriptionsIdRecalculateSubscriptionCountPostRequest($id) + protected function subscriptionControllerRecalculateSubscriptionCountRequest($id) { // 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 apiSubscriptionsIdRecalculateSubscriptionCountPost' + 'Missing the required parameter $id when calling subscriptionControllerRecalculateSubscriptionCount' ); } @@ -1406,7 +1895,7 @@ protected function apiSubscriptionsIdRecalculateSubscriptionCountPostRequest($id } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -1414,16 +1903,9 @@ protected function apiSubscriptionsIdRecalculateSubscriptionCountPostRequest($id if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -1446,11 +1928,10 @@ protected function apiSubscriptionsIdRecalculateSubscriptionCountPostRequest($id } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1473,7 +1954,7 @@ protected function apiSubscriptionsIdRecalculateSubscriptionCountPostRequest($id } /** - * Operation apiSubscriptionsRenewSubscriptionNumberSecretKeyGet + * Operation subscriptionControllerRenew * * Renew subscriptions * @@ -1484,14 +1965,14 @@ protected function apiSubscriptionsIdRecalculateSubscriptionCountPostRequest($id * @throws \InvalidArgumentException * @return \Yoast\MyYoastApiClient\Model\Subscription */ - public function apiSubscriptionsRenewSubscriptionNumberSecretKeyGet($subscriptionNumber, $secretKey) + public function subscriptionControllerRenew($subscriptionNumber, $secretKey) { - list($response) = $this->apiSubscriptionsRenewSubscriptionNumberSecretKeyGetWithHttpInfo($subscriptionNumber, $secretKey); + list($response) = $this->subscriptionControllerRenewWithHttpInfo($subscriptionNumber, $secretKey); return $response; } /** - * Operation apiSubscriptionsRenewSubscriptionNumberSecretKeyGetWithHttpInfo + * Operation subscriptionControllerRenewWithHttpInfo * * Renew subscriptions * @@ -1502,10 +1983,10 @@ public function apiSubscriptionsRenewSubscriptionNumberSecretKeyGet($subscriptio * @throws \InvalidArgumentException * @return array of \Yoast\MyYoastApiClient\Model\Subscription, HTTP status code, HTTP response headers (array of strings) */ - public function apiSubscriptionsRenewSubscriptionNumberSecretKeyGetWithHttpInfo($subscriptionNumber, $secretKey) + public function subscriptionControllerRenewWithHttpInfo($subscriptionNumber, $secretKey) { $returnType = '\Yoast\MyYoastApiClient\Model\Subscription'; - $request = $this->apiSubscriptionsRenewSubscriptionNumberSecretKeyGetRequest($subscriptionNumber, $secretKey); + $request = $this->subscriptionControllerRenewRequest($subscriptionNumber, $secretKey); try { $options = $this->createHttpClientOption(); @@ -1540,7 +2021,7 @@ public function apiSubscriptionsRenewSubscriptionNumberSecretKeyGetWithHttpInfo( $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -1567,7 +2048,7 @@ public function apiSubscriptionsRenewSubscriptionNumberSecretKeyGetWithHttpInfo( } /** - * Operation apiSubscriptionsRenewSubscriptionNumberSecretKeyGetAsync + * Operation subscriptionControllerRenewAsync * * Renew subscriptions * @@ -1577,9 +2058,9 @@ public function apiSubscriptionsRenewSubscriptionNumberSecretKeyGetWithHttpInfo( * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiSubscriptionsRenewSubscriptionNumberSecretKeyGetAsync($subscriptionNumber, $secretKey) + public function subscriptionControllerRenewAsync($subscriptionNumber, $secretKey) { - return $this->apiSubscriptionsRenewSubscriptionNumberSecretKeyGetAsyncWithHttpInfo($subscriptionNumber, $secretKey) + return $this->subscriptionControllerRenewAsyncWithHttpInfo($subscriptionNumber, $secretKey) ->then( function ($response) { return $response[0]; @@ -1588,7 +2069,7 @@ function ($response) { } /** - * Operation apiSubscriptionsRenewSubscriptionNumberSecretKeyGetAsyncWithHttpInfo + * Operation subscriptionControllerRenewAsyncWithHttpInfo * * Renew subscriptions * @@ -1598,10 +2079,10 @@ function ($response) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiSubscriptionsRenewSubscriptionNumberSecretKeyGetAsyncWithHttpInfo($subscriptionNumber, $secretKey) + public function subscriptionControllerRenewAsyncWithHttpInfo($subscriptionNumber, $secretKey) { $returnType = '\Yoast\MyYoastApiClient\Model\Subscription'; - $request = $this->apiSubscriptionsRenewSubscriptionNumberSecretKeyGetRequest($subscriptionNumber, $secretKey); + $request = $this->subscriptionControllerRenewRequest($subscriptionNumber, $secretKey); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1641,7 +2122,7 @@ function ($exception) { } /** - * Create request for operation 'apiSubscriptionsRenewSubscriptionNumberSecretKeyGet' + * Create request for operation 'subscriptionControllerRenew' * * @param string $subscriptionNumber (required) * @param string $secretKey (required) @@ -1649,18 +2130,18 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiSubscriptionsRenewSubscriptionNumberSecretKeyGetRequest($subscriptionNumber, $secretKey) + protected function subscriptionControllerRenewRequest($subscriptionNumber, $secretKey) { // verify the required parameter 'subscriptionNumber' is set if ($subscriptionNumber === null || (is_array($subscriptionNumber) && count($subscriptionNumber) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $subscriptionNumber when calling apiSubscriptionsRenewSubscriptionNumberSecretKeyGet' + 'Missing the required parameter $subscriptionNumber when calling subscriptionControllerRenew' ); } // verify the required parameter 'secretKey' is set if ($secretKey === null || (is_array($secretKey) && count($secretKey) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $secretKey when calling apiSubscriptionsRenewSubscriptionNumberSecretKeyGet' + 'Missing the required parameter $secretKey when calling subscriptionControllerRenew' ); } @@ -1699,7 +2180,7 @@ protected function apiSubscriptionsRenewSubscriptionNumberSecretKeyGetRequest($s } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -1707,16 +2188,9 @@ protected function apiSubscriptionsRenewSubscriptionNumberSecretKeyGetRequest($s if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -1739,11 +2213,10 @@ protected function apiSubscriptionsRenewSubscriptionNumberSecretKeyGetRequest($s } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1766,37 +2239,37 @@ protected function apiSubscriptionsRenewSubscriptionNumberSecretKeyGetRequest($s } /** - * Operation apiSubscriptionsSetExpiryDatePost + * Operation subscriptionControllerSetExpiryDate * * Set Date. * - * @param \Yoast\MyYoastApiClient\Model\SetExpiryDateDto $setExpiryDateDto setExpiryDateDto (required) + * @param \Yoast\MyYoastApiClient\Model\SetExpiryDateDto $body body (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Yoast\MyYoastApiClient\Model\Subscription */ - public function apiSubscriptionsSetExpiryDatePost($setExpiryDateDto) + public function subscriptionControllerSetExpiryDate($body) { - list($response) = $this->apiSubscriptionsSetExpiryDatePostWithHttpInfo($setExpiryDateDto); + list($response) = $this->subscriptionControllerSetExpiryDateWithHttpInfo($body); return $response; } /** - * Operation apiSubscriptionsSetExpiryDatePostWithHttpInfo + * Operation subscriptionControllerSetExpiryDateWithHttpInfo * * Set Date. * - * @param \Yoast\MyYoastApiClient\Model\SetExpiryDateDto $setExpiryDateDto (required) + * @param \Yoast\MyYoastApiClient\Model\SetExpiryDateDto $body (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Yoast\MyYoastApiClient\Model\Subscription, HTTP status code, HTTP response headers (array of strings) */ - public function apiSubscriptionsSetExpiryDatePostWithHttpInfo($setExpiryDateDto) + public function subscriptionControllerSetExpiryDateWithHttpInfo($body) { $returnType = '\Yoast\MyYoastApiClient\Model\Subscription'; - $request = $this->apiSubscriptionsSetExpiryDatePostRequest($setExpiryDateDto); + $request = $this->subscriptionControllerSetExpiryDateRequest($body); try { $options = $this->createHttpClientOption(); @@ -1831,7 +2304,7 @@ public function apiSubscriptionsSetExpiryDatePostWithHttpInfo($setExpiryDateDto) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -1858,18 +2331,18 @@ public function apiSubscriptionsSetExpiryDatePostWithHttpInfo($setExpiryDateDto) } /** - * Operation apiSubscriptionsSetExpiryDatePostAsync + * Operation subscriptionControllerSetExpiryDateAsync * * Set Date. * - * @param \Yoast\MyYoastApiClient\Model\SetExpiryDateDto $setExpiryDateDto (required) + * @param \Yoast\MyYoastApiClient\Model\SetExpiryDateDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiSubscriptionsSetExpiryDatePostAsync($setExpiryDateDto) + public function subscriptionControllerSetExpiryDateAsync($body) { - return $this->apiSubscriptionsSetExpiryDatePostAsyncWithHttpInfo($setExpiryDateDto) + return $this->subscriptionControllerSetExpiryDateAsyncWithHttpInfo($body) ->then( function ($response) { return $response[0]; @@ -1878,19 +2351,19 @@ function ($response) { } /** - * Operation apiSubscriptionsSetExpiryDatePostAsyncWithHttpInfo + * Operation subscriptionControllerSetExpiryDateAsyncWithHttpInfo * * Set Date. * - * @param \Yoast\MyYoastApiClient\Model\SetExpiryDateDto $setExpiryDateDto (required) + * @param \Yoast\MyYoastApiClient\Model\SetExpiryDateDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiSubscriptionsSetExpiryDatePostAsyncWithHttpInfo($setExpiryDateDto) + public function subscriptionControllerSetExpiryDateAsyncWithHttpInfo($body) { $returnType = '\Yoast\MyYoastApiClient\Model\Subscription'; - $request = $this->apiSubscriptionsSetExpiryDatePostRequest($setExpiryDateDto); + $request = $this->subscriptionControllerSetExpiryDateRequest($body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1930,19 +2403,19 @@ function ($exception) { } /** - * Create request for operation 'apiSubscriptionsSetExpiryDatePost' + * Create request for operation 'subscriptionControllerSetExpiryDate' * - * @param \Yoast\MyYoastApiClient\Model\SetExpiryDateDto $setExpiryDateDto (required) + * @param \Yoast\MyYoastApiClient\Model\SetExpiryDateDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiSubscriptionsSetExpiryDatePostRequest($setExpiryDateDto) + protected function subscriptionControllerSetExpiryDateRequest($body) { - // verify the required parameter 'setExpiryDateDto' is set - if ($setExpiryDateDto === null || (is_array($setExpiryDateDto) && count($setExpiryDateDto) === 0)) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $setExpiryDateDto when calling apiSubscriptionsSetExpiryDatePost' + 'Missing the required parameter $body when calling subscriptionControllerSetExpiryDate' ); } @@ -1957,8 +2430,8 @@ protected function apiSubscriptionsSetExpiryDatePostRequest($setExpiryDateDto) // body params $_tempBody = null; - if (isset($setExpiryDateDto)) { - $_tempBody = $setExpiryDateDto; + if (isset($body)) { + $_tempBody = $body; } if ($multipart) { @@ -1976,16 +2449,9 @@ protected function apiSubscriptionsSetExpiryDatePostRequest($setExpiryDateDto) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -2008,11 +2474,10 @@ protected function apiSubscriptionsSetExpiryDatePostRequest($setExpiryDateDto) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -2035,37 +2500,37 @@ protected function apiSubscriptionsSetExpiryDatePostRequest($setExpiryDateDto) } /** - * Operation apiSubscriptionsTransferPost + * Operation subscriptionControllerTransferOwnership * * Transfer subscription ownership * - * @param \Yoast\MyYoastApiClient\Model\TransferOwnershipDto $transferOwnershipDto transferOwnershipDto (required) + * @param \Yoast\MyYoastApiClient\Model\TransferOwnershipDto $body body (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return \Yoast\MyYoastApiClient\Model\Subscription[] */ - public function apiSubscriptionsTransferPost($transferOwnershipDto) + public function subscriptionControllerTransferOwnership($body) { - list($response) = $this->apiSubscriptionsTransferPostWithHttpInfo($transferOwnershipDto); + list($response) = $this->subscriptionControllerTransferOwnershipWithHttpInfo($body); return $response; } /** - * Operation apiSubscriptionsTransferPostWithHttpInfo + * Operation subscriptionControllerTransferOwnershipWithHttpInfo * * Transfer subscription ownership * - * @param \Yoast\MyYoastApiClient\Model\TransferOwnershipDto $transferOwnershipDto (required) + * @param \Yoast\MyYoastApiClient\Model\TransferOwnershipDto $body (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of \Yoast\MyYoastApiClient\Model\Subscription[], HTTP status code, HTTP response headers (array of strings) */ - public function apiSubscriptionsTransferPostWithHttpInfo($transferOwnershipDto) + public function subscriptionControllerTransferOwnershipWithHttpInfo($body) { $returnType = '\Yoast\MyYoastApiClient\Model\Subscription[]'; - $request = $this->apiSubscriptionsTransferPostRequest($transferOwnershipDto); + $request = $this->subscriptionControllerTransferOwnershipRequest($body); try { $options = $this->createHttpClientOption(); @@ -2100,7 +2565,7 @@ public function apiSubscriptionsTransferPostWithHttpInfo($transferOwnershipDto) $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); - if ($returnType !== 'string') { + if (!in_array($returnType, ['string','integer','bool'])) { $content = json_decode($content); } } @@ -2127,18 +2592,18 @@ public function apiSubscriptionsTransferPostWithHttpInfo($transferOwnershipDto) } /** - * Operation apiSubscriptionsTransferPostAsync + * Operation subscriptionControllerTransferOwnershipAsync * * Transfer subscription ownership * - * @param \Yoast\MyYoastApiClient\Model\TransferOwnershipDto $transferOwnershipDto (required) + * @param \Yoast\MyYoastApiClient\Model\TransferOwnershipDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiSubscriptionsTransferPostAsync($transferOwnershipDto) + public function subscriptionControllerTransferOwnershipAsync($body) { - return $this->apiSubscriptionsTransferPostAsyncWithHttpInfo($transferOwnershipDto) + return $this->subscriptionControllerTransferOwnershipAsyncWithHttpInfo($body) ->then( function ($response) { return $response[0]; @@ -2147,19 +2612,19 @@ function ($response) { } /** - * Operation apiSubscriptionsTransferPostAsyncWithHttpInfo + * Operation subscriptionControllerTransferOwnershipAsyncWithHttpInfo * * Transfer subscription ownership * - * @param \Yoast\MyYoastApiClient\Model\TransferOwnershipDto $transferOwnershipDto (required) + * @param \Yoast\MyYoastApiClient\Model\TransferOwnershipDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiSubscriptionsTransferPostAsyncWithHttpInfo($transferOwnershipDto) + public function subscriptionControllerTransferOwnershipAsyncWithHttpInfo($body) { $returnType = '\Yoast\MyYoastApiClient\Model\Subscription[]'; - $request = $this->apiSubscriptionsTransferPostRequest($transferOwnershipDto); + $request = $this->subscriptionControllerTransferOwnershipRequest($body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2199,19 +2664,19 @@ function ($exception) { } /** - * Create request for operation 'apiSubscriptionsTransferPost' + * Create request for operation 'subscriptionControllerTransferOwnership' * - * @param \Yoast\MyYoastApiClient\Model\TransferOwnershipDto $transferOwnershipDto (required) + * @param \Yoast\MyYoastApiClient\Model\TransferOwnershipDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiSubscriptionsTransferPostRequest($transferOwnershipDto) + protected function subscriptionControllerTransferOwnershipRequest($body) { - // verify the required parameter 'transferOwnershipDto' is set - if ($transferOwnershipDto === null || (is_array($transferOwnershipDto) && count($transferOwnershipDto) === 0)) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $transferOwnershipDto when calling apiSubscriptionsTransferPost' + 'Missing the required parameter $body when calling subscriptionControllerTransferOwnership' ); } @@ -2226,8 +2691,8 @@ protected function apiSubscriptionsTransferPostRequest($transferOwnershipDto) // body params $_tempBody = null; - if (isset($transferOwnershipDto)) { - $_tempBody = $transferOwnershipDto; + if (isset($body)) { + $_tempBody = $body; } if ($multipart) { @@ -2245,16 +2710,9 @@ protected function apiSubscriptionsTransferPostRequest($transferOwnershipDto) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -2277,11 +2735,10 @@ protected function apiSubscriptionsTransferPostRequest($transferOwnershipDto) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { diff --git a/src/Api/SubscriptionProvisioningApi.php b/src/Api/SubscriptionProvisioningApi.php new file mode 100644 index 0000000..4541595 --- /dev/null +++ b/src/Api/SubscriptionProvisioningApi.php @@ -0,0 +1,1460 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation subscriptionProvisioningControllerCancelSubscription + * + * Cancel a single subscription + * + * @param \Yoast\MyYoastApiClient\Model\CancelProvisionedSubscriptionDto $body body (required) + * @param string $id id (required) + * + * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto + */ + public function subscriptionProvisioningControllerCancelSubscription($body, $id) + { + list($response) = $this->subscriptionProvisioningControllerCancelSubscriptionWithHttpInfo($body, $id); + return $response; + } + + /** + * Operation subscriptionProvisioningControllerCancelSubscriptionWithHttpInfo + * + * Cancel a single subscription + * + * @param \Yoast\MyYoastApiClient\Model\CancelProvisionedSubscriptionDto $body (required) + * @param string $id (required) + * + * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto, HTTP status code, HTTP response headers (array of strings) + */ + public function subscriptionProvisioningControllerCancelSubscriptionWithHttpInfo($body, $id) + { + $returnType = '\Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto'; + $request = $this->subscriptionProvisioningControllerCancelSubscriptionRequest($body, $id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if (!in_array($returnType, ['string','integer','bool'])) { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation subscriptionProvisioningControllerCancelSubscriptionAsync + * + * Cancel a single subscription + * + * @param \Yoast\MyYoastApiClient\Model\CancelProvisionedSubscriptionDto $body (required) + * @param string $id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function subscriptionProvisioningControllerCancelSubscriptionAsync($body, $id) + { + return $this->subscriptionProvisioningControllerCancelSubscriptionAsyncWithHttpInfo($body, $id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation subscriptionProvisioningControllerCancelSubscriptionAsyncWithHttpInfo + * + * Cancel a single subscription + * + * @param \Yoast\MyYoastApiClient\Model\CancelProvisionedSubscriptionDto $body (required) + * @param string $id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function subscriptionProvisioningControllerCancelSubscriptionAsyncWithHttpInfo($body, $id) + { + $returnType = '\Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto'; + $request = $this->subscriptionProvisioningControllerCancelSubscriptionRequest($body, $id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + 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(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'subscriptionProvisioningControllerCancelSubscription' + * + * @param \Yoast\MyYoastApiClient\Model\CancelProvisionedSubscriptionDto $body (required) + * @param string $id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function subscriptionProvisioningControllerCancelSubscriptionRequest($body, $id) + { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling subscriptionProvisioningControllerCancelSubscription' + ); + } + // 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 subscriptionProvisioningControllerCancelSubscription' + ); + } + + $resourcePath = '/api/provisioning/subscriptions/{id}/cancel'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation subscriptionProvisioningControllerCreate + * + * Create a subscription + * + * @param \Yoast\MyYoastApiClient\Model\CreateProvisionedSubscriptionDto $body body (required) + * + * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto + */ + public function subscriptionProvisioningControllerCreate($body) + { + list($response) = $this->subscriptionProvisioningControllerCreateWithHttpInfo($body); + return $response; + } + + /** + * Operation subscriptionProvisioningControllerCreateWithHttpInfo + * + * Create a subscription + * + * @param \Yoast\MyYoastApiClient\Model\CreateProvisionedSubscriptionDto $body (required) + * + * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto, HTTP status code, HTTP response headers (array of strings) + */ + public function subscriptionProvisioningControllerCreateWithHttpInfo($body) + { + $returnType = '\Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto'; + $request = $this->subscriptionProvisioningControllerCreateRequest($body); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if (!in_array($returnType, ['string','integer','bool'])) { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation subscriptionProvisioningControllerCreateAsync + * + * Create a subscription + * + * @param \Yoast\MyYoastApiClient\Model\CreateProvisionedSubscriptionDto $body (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function subscriptionProvisioningControllerCreateAsync($body) + { + return $this->subscriptionProvisioningControllerCreateAsyncWithHttpInfo($body) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation subscriptionProvisioningControllerCreateAsyncWithHttpInfo + * + * Create a subscription + * + * @param \Yoast\MyYoastApiClient\Model\CreateProvisionedSubscriptionDto $body (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function subscriptionProvisioningControllerCreateAsyncWithHttpInfo($body) + { + $returnType = '\Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto'; + $request = $this->subscriptionProvisioningControllerCreateRequest($body); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + 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(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'subscriptionProvisioningControllerCreate' + * + * @param \Yoast\MyYoastApiClient\Model\CreateProvisionedSubscriptionDto $body (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function subscriptionProvisioningControllerCreateRequest($body) + { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling subscriptionProvisioningControllerCreate' + ); + } + + $resourcePath = '/api/provisioning/subscriptions/create'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // body params + $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation subscriptionProvisioningControllerGetOne + * + * Get a subscription + * + * @param string $id id (required) + * + * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto + */ + public function subscriptionProvisioningControllerGetOne($id) + { + list($response) = $this->subscriptionProvisioningControllerGetOneWithHttpInfo($id); + return $response; + } + + /** + * Operation subscriptionProvisioningControllerGetOneWithHttpInfo + * + * Get a subscription + * + * @param string $id (required) + * + * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto, HTTP status code, HTTP response headers (array of strings) + */ + public function subscriptionProvisioningControllerGetOneWithHttpInfo($id) + { + $returnType = '\Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto'; + $request = $this->subscriptionProvisioningControllerGetOneRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if (!in_array($returnType, ['string','integer','bool'])) { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation subscriptionProvisioningControllerGetOneAsync + * + * Get a subscription + * + * @param string $id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function subscriptionProvisioningControllerGetOneAsync($id) + { + return $this->subscriptionProvisioningControllerGetOneAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation subscriptionProvisioningControllerGetOneAsyncWithHttpInfo + * + * Get a subscription + * + * @param string $id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function subscriptionProvisioningControllerGetOneAsyncWithHttpInfo($id) + { + $returnType = '\Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto'; + $request = $this->subscriptionProvisioningControllerGetOneRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + 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(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'subscriptionProvisioningControllerGetOne' + * + * @param string $id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function subscriptionProvisioningControllerGetOneRequest($id) + { + // 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 subscriptionProvisioningControllerGetOne' + ); + } + + $resourcePath = '/api/provisioning/subscriptions/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation subscriptionProvisioningControllerRenewSubscription + * + * Renew a subscription + * + * @param string $id id (required) + * + * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto + */ + public function subscriptionProvisioningControllerRenewSubscription($id) + { + list($response) = $this->subscriptionProvisioningControllerRenewSubscriptionWithHttpInfo($id); + return $response; + } + + /** + * Operation subscriptionProvisioningControllerRenewSubscriptionWithHttpInfo + * + * Renew a subscription + * + * @param string $id (required) + * + * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto, HTTP status code, HTTP response headers (array of strings) + */ + public function subscriptionProvisioningControllerRenewSubscriptionWithHttpInfo($id) + { + $returnType = '\Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto'; + $request = $this->subscriptionProvisioningControllerRenewSubscriptionRequest($id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if (!in_array($returnType, ['string','integer','bool'])) { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation subscriptionProvisioningControllerRenewSubscriptionAsync + * + * Renew a subscription + * + * @param string $id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function subscriptionProvisioningControllerRenewSubscriptionAsync($id) + { + return $this->subscriptionProvisioningControllerRenewSubscriptionAsyncWithHttpInfo($id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation subscriptionProvisioningControllerRenewSubscriptionAsyncWithHttpInfo + * + * Renew a subscription + * + * @param string $id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function subscriptionProvisioningControllerRenewSubscriptionAsyncWithHttpInfo($id) + { + $returnType = '\Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto'; + $request = $this->subscriptionProvisioningControllerRenewSubscriptionRequest($id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + 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(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'subscriptionProvisioningControllerRenewSubscription' + * + * @param string $id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function subscriptionProvisioningControllerRenewSubscriptionRequest($id) + { + // 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 subscriptionProvisioningControllerRenewSubscription' + ); + } + + $resourcePath = '/api/provisioning/subscriptions/{id}/renew'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation subscriptionProvisioningControllerSetSiteForSubscription + * + * Link a subscription to a site + * + * @param \Yoast\MyYoastApiClient\Model\SetProvisionedSiteDto $body body (required) + * @param string $id id (required) + * + * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto + */ + public function subscriptionProvisioningControllerSetSiteForSubscription($body, $id) + { + list($response) = $this->subscriptionProvisioningControllerSetSiteForSubscriptionWithHttpInfo($body, $id); + return $response; + } + + /** + * Operation subscriptionProvisioningControllerSetSiteForSubscriptionWithHttpInfo + * + * Link a subscription to a site + * + * @param \Yoast\MyYoastApiClient\Model\SetProvisionedSiteDto $body (required) + * @param string $id (required) + * + * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto, HTTP status code, HTTP response headers (array of strings) + */ + public function subscriptionProvisioningControllerSetSiteForSubscriptionWithHttpInfo($body, $id) + { + $returnType = '\Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto'; + $request = $this->subscriptionProvisioningControllerSetSiteForSubscriptionRequest($body, $id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if (!in_array($returnType, ['string','integer','bool'])) { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation subscriptionProvisioningControllerSetSiteForSubscriptionAsync + * + * Link a subscription to a site + * + * @param \Yoast\MyYoastApiClient\Model\SetProvisionedSiteDto $body (required) + * @param string $id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function subscriptionProvisioningControllerSetSiteForSubscriptionAsync($body, $id) + { + return $this->subscriptionProvisioningControllerSetSiteForSubscriptionAsyncWithHttpInfo($body, $id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation subscriptionProvisioningControllerSetSiteForSubscriptionAsyncWithHttpInfo + * + * Link a subscription to a site + * + * @param \Yoast\MyYoastApiClient\Model\SetProvisionedSiteDto $body (required) + * @param string $id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function subscriptionProvisioningControllerSetSiteForSubscriptionAsyncWithHttpInfo($body, $id) + { + $returnType = '\Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto'; + $request = $this->subscriptionProvisioningControllerSetSiteForSubscriptionRequest($body, $id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + 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(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'subscriptionProvisioningControllerSetSiteForSubscription' + * + * @param \Yoast\MyYoastApiClient\Model\SetProvisionedSiteDto $body (required) + * @param string $id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function subscriptionProvisioningControllerSetSiteForSubscriptionRequest($body, $id) + { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling subscriptionProvisioningControllerSetSiteForSubscription' + ); + } + // 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 subscriptionProvisioningControllerSetSiteForSubscription' + ); + } + + $resourcePath = '/api/provisioning/subscriptions/{id}/set-site'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires HTTP basic authentication + if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $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/src/Api/WorkerApi.php b/src/Api/WorkerApi.php index 4e10b40..eb53723 100644 --- a/src/Api/WorkerApi.php +++ b/src/Api/WorkerApi.php @@ -17,9 +17,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -88,32 +87,32 @@ public function getConfig() } /** - * Operation apiWorkerGetRecurringJobsInfoNameGet + * Operation queueControllerAddJob * - * @param string $name name (required) + * @param \Yoast\MyYoastApiClient\Model\AddJobDto $body body (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function apiWorkerGetRecurringJobsInfoNameGet($name) + public function queueControllerAddJob($body) { - $this->apiWorkerGetRecurringJobsInfoNameGetWithHttpInfo($name); + $this->queueControllerAddJobWithHttpInfo($body); } /** - * Operation apiWorkerGetRecurringJobsInfoNameGetWithHttpInfo + * Operation queueControllerAddJobWithHttpInfo * - * @param string $name (required) + * @param \Yoast\MyYoastApiClient\Model\AddJobDto $body (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function apiWorkerGetRecurringJobsInfoNameGetWithHttpInfo($name) + public function queueControllerAddJobWithHttpInfo($body) { $returnType = ''; - $request = $this->apiWorkerGetRecurringJobsInfoNameGetRequest($name); + $request = $this->queueControllerAddJobRequest($body); try { $options = $this->createHttpClientOption(); @@ -153,18 +152,18 @@ public function apiWorkerGetRecurringJobsInfoNameGetWithHttpInfo($name) } /** - * Operation apiWorkerGetRecurringJobsInfoNameGetAsync + * Operation queueControllerAddJobAsync * * * - * @param string $name (required) + * @param \Yoast\MyYoastApiClient\Model\AddJobDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiWorkerGetRecurringJobsInfoNameGetAsync($name) + public function queueControllerAddJobAsync($body) { - return $this->apiWorkerGetRecurringJobsInfoNameGetAsyncWithHttpInfo($name) + return $this->queueControllerAddJobAsyncWithHttpInfo($body) ->then( function ($response) { return $response[0]; @@ -173,19 +172,19 @@ function ($response) { } /** - * Operation apiWorkerGetRecurringJobsInfoNameGetAsyncWithHttpInfo + * Operation queueControllerAddJobAsyncWithHttpInfo * * * - * @param string $name (required) + * @param \Yoast\MyYoastApiClient\Model\AddJobDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiWorkerGetRecurringJobsInfoNameGetAsyncWithHttpInfo($name) + public function queueControllerAddJobAsyncWithHttpInfo($body) { $returnType = ''; - $request = $this->apiWorkerGetRecurringJobsInfoNameGetRequest($name); + $request = $this->queueControllerAddJobRequest($body); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -211,23 +210,23 @@ function ($exception) { } /** - * Create request for operation 'apiWorkerGetRecurringJobsInfoNameGet' + * Create request for operation 'queueControllerAddJob' * - * @param string $name (required) + * @param \Yoast\MyYoastApiClient\Model\AddJobDto $body (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiWorkerGetRecurringJobsInfoNameGetRequest($name) + protected function queueControllerAddJobRequest($body) { - // verify the required parameter 'name' is set - if ($name === null || (is_array($name) && count($name) === 0)) { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $name when calling apiWorkerGetRecurringJobsInfoNameGet' + 'Missing the required parameter $body when calling queueControllerAddJob' ); } - $resourcePath = '/api/Worker/getRecurringJobsInfo/{name}'; + $resourcePath = '/api/Worker/job'; $formParams = []; $queryParams = []; $headerParams = []; @@ -235,25 +234,20 @@ protected function apiWorkerGetRecurringJobsInfoNameGetRequest($name) $multipart = false; - // path params - if ($name !== null) { - $resourcePath = str_replace( - '{' . 'name' . '}', - ObjectSerializer::toPathValue($name), - $resourcePath - ); - } // body params $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + [] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], + [], ['application/json'] ); } @@ -262,16 +256,9 @@ protected function apiWorkerGetRecurringJobsInfoNameGetRequest($name) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -294,11 +281,10 @@ protected function apiWorkerGetRecurringJobsInfoNameGetRequest($name) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -313,7 +299,7 @@ protected function apiWorkerGetRecurringJobsInfoNameGetRequest($name) $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'GET', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -321,32 +307,32 @@ protected function apiWorkerGetRecurringJobsInfoNameGetRequest($name) } /** - * Operation apiWorkerGetScheduledJobsNameGet + * Operation queueControllerGetJob * - * @param string $name name (required) + * @param string $id id (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function apiWorkerGetScheduledJobsNameGet($name) + public function queueControllerGetJob($id) { - $this->apiWorkerGetScheduledJobsNameGetWithHttpInfo($name); + $this->queueControllerGetJobWithHttpInfo($id); } /** - * Operation apiWorkerGetScheduledJobsNameGetWithHttpInfo + * Operation queueControllerGetJobWithHttpInfo * - * @param string $name (required) + * @param string $id (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function apiWorkerGetScheduledJobsNameGetWithHttpInfo($name) + public function queueControllerGetJobWithHttpInfo($id) { $returnType = ''; - $request = $this->apiWorkerGetScheduledJobsNameGetRequest($name); + $request = $this->queueControllerGetJobRequest($id); try { $options = $this->createHttpClientOption(); @@ -386,18 +372,18 @@ public function apiWorkerGetScheduledJobsNameGetWithHttpInfo($name) } /** - * Operation apiWorkerGetScheduledJobsNameGetAsync + * Operation queueControllerGetJobAsync * * * - * @param string $name (required) + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiWorkerGetScheduledJobsNameGetAsync($name) + public function queueControllerGetJobAsync($id) { - return $this->apiWorkerGetScheduledJobsNameGetAsyncWithHttpInfo($name) + return $this->queueControllerGetJobAsyncWithHttpInfo($id) ->then( function ($response) { return $response[0]; @@ -406,19 +392,19 @@ function ($response) { } /** - * Operation apiWorkerGetScheduledJobsNameGetAsyncWithHttpInfo + * Operation queueControllerGetJobAsyncWithHttpInfo * * * - * @param string $name (required) + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiWorkerGetScheduledJobsNameGetAsyncWithHttpInfo($name) + public function queueControllerGetJobAsyncWithHttpInfo($id) { $returnType = ''; - $request = $this->apiWorkerGetScheduledJobsNameGetRequest($name); + $request = $this->queueControllerGetJobRequest($id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -444,23 +430,23 @@ function ($exception) { } /** - * Create request for operation 'apiWorkerGetScheduledJobsNameGet' + * Create request for operation 'queueControllerGetJob' * - * @param string $name (required) + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiWorkerGetScheduledJobsNameGetRequest($name) + protected function queueControllerGetJobRequest($id) { - // verify the required parameter 'name' is set - if ($name === null || (is_array($name) && count($name) === 0)) { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $name when calling apiWorkerGetScheduledJobsNameGet' + 'Missing the required parameter $id when calling queueControllerGetJob' ); } - $resourcePath = '/api/Worker/getScheduledJobs/{name}'; + $resourcePath = '/api/Worker/job/{id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -469,10 +455,10 @@ protected function apiWorkerGetScheduledJobsNameGetRequest($name) // path params - if ($name !== null) { + if ($id !== null) { $resourcePath = str_replace( - '{' . 'name' . '}', - ObjectSerializer::toPathValue($name), + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), $resourcePath ); } @@ -482,12 +468,12 @@ protected function apiWorkerGetScheduledJobsNameGetRequest($name) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + [] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + [], + [] ); } @@ -495,16 +481,215 @@ protected function apiWorkerGetScheduledJobsNameGetRequest($name) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation queueControllerGetRecurringJobs + * + * + * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function queueControllerGetRecurringJobs() + { + $this->queueControllerGetRecurringJobsWithHttpInfo(); + } + + /** + * Operation queueControllerGetRecurringJobsWithHttpInfo + * + * + * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function queueControllerGetRecurringJobsWithHttpInfo() + { + $returnType = ''; + $request = $this->queueControllerGetRecurringJobsRequest(); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation queueControllerGetRecurringJobsAsync + * + * + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function queueControllerGetRecurringJobsAsync() + { + return $this->queueControllerGetRecurringJobsAsyncWithHttpInfo() + ->then( + function ($response) { + return $response[0]; } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); + ); + } + + /** + * Operation queueControllerGetRecurringJobsAsyncWithHttpInfo + * + * + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function queueControllerGetRecurringJobsAsyncWithHttpInfo() + { + $returnType = ''; + $request = $this->queueControllerGetRecurringJobsRequest(); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $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(), + $response->getBody() + ); } + ); + } + + /** + * Create request for operation 'queueControllerGetRecurringJobs' + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function queueControllerGetRecurringJobsRequest() + { + + $resourcePath = '/api/Worker/getRecurringJobs'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + [] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + [], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -527,11 +712,10 @@ protected function apiWorkerGetScheduledJobsNameGetRequest($name) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -554,32 +738,32 @@ protected function apiWorkerGetScheduledJobsNameGetRequest($name) } /** - * Operation apiWorkerIdDelete + * Operation queueControllerGetRecurringJobsInfo * - * @param string $id id (required) + * @param string $name name (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function apiWorkerIdDelete($id) + public function queueControllerGetRecurringJobsInfo($name) { - $this->apiWorkerIdDeleteWithHttpInfo($id); + $this->queueControllerGetRecurringJobsInfoWithHttpInfo($name); } /** - * Operation apiWorkerIdDeleteWithHttpInfo + * Operation queueControllerGetRecurringJobsInfoWithHttpInfo * - * @param string $id (required) + * @param string $name (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function apiWorkerIdDeleteWithHttpInfo($id) + public function queueControllerGetRecurringJobsInfoWithHttpInfo($name) { $returnType = ''; - $request = $this->apiWorkerIdDeleteRequest($id); + $request = $this->queueControllerGetRecurringJobsInfoRequest($name); try { $options = $this->createHttpClientOption(); @@ -619,18 +803,18 @@ public function apiWorkerIdDeleteWithHttpInfo($id) } /** - * Operation apiWorkerIdDeleteAsync + * Operation queueControllerGetRecurringJobsInfoAsync * * * - * @param string $id (required) + * @param string $name (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiWorkerIdDeleteAsync($id) + public function queueControllerGetRecurringJobsInfoAsync($name) { - return $this->apiWorkerIdDeleteAsyncWithHttpInfo($id) + return $this->queueControllerGetRecurringJobsInfoAsyncWithHttpInfo($name) ->then( function ($response) { return $response[0]; @@ -639,19 +823,19 @@ function ($response) { } /** - * Operation apiWorkerIdDeleteAsyncWithHttpInfo + * Operation queueControllerGetRecurringJobsInfoAsyncWithHttpInfo * * * - * @param string $id (required) + * @param string $name (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiWorkerIdDeleteAsyncWithHttpInfo($id) + public function queueControllerGetRecurringJobsInfoAsyncWithHttpInfo($name) { $returnType = ''; - $request = $this->apiWorkerIdDeleteRequest($id); + $request = $this->queueControllerGetRecurringJobsInfoRequest($name); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -677,23 +861,23 @@ function ($exception) { } /** - * Create request for operation 'apiWorkerIdDelete' + * Create request for operation 'queueControllerGetRecurringJobsInfo' * - * @param string $id (required) + * @param string $name (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiWorkerIdDeleteRequest($id) + protected function queueControllerGetRecurringJobsInfoRequest($name) { - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { + // verify the required parameter 'name' is set + if ($name === null || (is_array($name) && count($name) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling apiWorkerIdDelete' + 'Missing the required parameter $name when calling queueControllerGetRecurringJobsInfo' ); } - $resourcePath = '/api/Worker/{id}'; + $resourcePath = '/api/Worker/getRecurringJobs/{name}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -702,10 +886,10 @@ protected function apiWorkerIdDeleteRequest($id) // path params - if ($id !== null) { + if ($name !== null) { $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), + '{' . 'name' . '}', + ObjectSerializer::toPathValue($name), $resourcePath ); } @@ -715,12 +899,12 @@ protected function apiWorkerIdDeleteRequest($id) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + [] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + [], + [] ); } @@ -728,16 +912,9 @@ protected function apiWorkerIdDeleteRequest($id) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -760,11 +937,10 @@ protected function apiWorkerIdDeleteRequest($id) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -779,7 +955,7 @@ protected function apiWorkerIdDeleteRequest($id) $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'DELETE', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -787,32 +963,32 @@ protected function apiWorkerIdDeleteRequest($id) } /** - * Operation apiWorkerIdGet + * Operation queueControllerGetScheduledJobs * - * @param string $id id (required) + * @param string $name name (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function apiWorkerIdGet($id) + public function queueControllerGetScheduledJobs($name) { - $this->apiWorkerIdGetWithHttpInfo($id); + $this->queueControllerGetScheduledJobsWithHttpInfo($name); } /** - * Operation apiWorkerIdGetWithHttpInfo + * Operation queueControllerGetScheduledJobsWithHttpInfo * - * @param string $id (required) + * @param string $name (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function apiWorkerIdGetWithHttpInfo($id) + public function queueControllerGetScheduledJobsWithHttpInfo($name) { $returnType = ''; - $request = $this->apiWorkerIdGetRequest($id); + $request = $this->queueControllerGetScheduledJobsRequest($name); try { $options = $this->createHttpClientOption(); @@ -852,18 +1028,18 @@ public function apiWorkerIdGetWithHttpInfo($id) } /** - * Operation apiWorkerIdGetAsync + * Operation queueControllerGetScheduledJobsAsync * * * - * @param string $id (required) + * @param string $name (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiWorkerIdGetAsync($id) + public function queueControllerGetScheduledJobsAsync($name) { - return $this->apiWorkerIdGetAsyncWithHttpInfo($id) + return $this->queueControllerGetScheduledJobsAsyncWithHttpInfo($name) ->then( function ($response) { return $response[0]; @@ -872,19 +1048,19 @@ function ($response) { } /** - * Operation apiWorkerIdGetAsyncWithHttpInfo + * Operation queueControllerGetScheduledJobsAsyncWithHttpInfo * * * - * @param string $id (required) + * @param string $name (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiWorkerIdGetAsyncWithHttpInfo($id) + public function queueControllerGetScheduledJobsAsyncWithHttpInfo($name) { $returnType = ''; - $request = $this->apiWorkerIdGetRequest($id); + $request = $this->queueControllerGetScheduledJobsRequest($name); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -910,23 +1086,23 @@ function ($exception) { } /** - * Create request for operation 'apiWorkerIdGet' + * Create request for operation 'queueControllerGetScheduledJobs' * - * @param string $id (required) + * @param string $name (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiWorkerIdGetRequest($id) + protected function queueControllerGetScheduledJobsRequest($name) { - // verify the required parameter 'id' is set - if ($id === null || (is_array($id) && count($id) === 0)) { + // verify the required parameter 'name' is set + if ($name === null || (is_array($name) && count($name) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $id when calling apiWorkerIdGet' + 'Missing the required parameter $name when calling queueControllerGetScheduledJobs' ); } - $resourcePath = '/api/Worker/{id}'; + $resourcePath = '/api/Worker/getScheduledJobs/{name}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -935,10 +1111,10 @@ protected function apiWorkerIdGetRequest($id) // path params - if ($id !== null) { + if ($name !== null) { $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), + '{' . 'name' . '}', + ObjectSerializer::toPathValue($name), $resourcePath ); } @@ -948,12 +1124,12 @@ protected function apiWorkerIdGetRequest($id) if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + [] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + [], + [] ); } @@ -961,16 +1137,9 @@ protected function apiWorkerIdGetRequest($id) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -993,11 +1162,10 @@ protected function apiWorkerIdGetRequest($id) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1020,32 +1188,32 @@ protected function apiWorkerIdGetRequest($id) } /** - * Operation apiWorkerPost + * Operation queueControllerRemoveJob * - * @param \Yoast\MyYoastApiClient\Model\AddJobDto $addJobDto addJobDto (required) + * @param string $id id (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return void */ - public function apiWorkerPost($addJobDto) + public function queueControllerRemoveJob($id) { - $this->apiWorkerPostWithHttpInfo($addJobDto); + $this->queueControllerRemoveJobWithHttpInfo($id); } /** - * Operation apiWorkerPostWithHttpInfo + * Operation queueControllerRemoveJobWithHttpInfo * - * @param \Yoast\MyYoastApiClient\Model\AddJobDto $addJobDto (required) + * @param string $id (required) * * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function apiWorkerPostWithHttpInfo($addJobDto) + public function queueControllerRemoveJobWithHttpInfo($id) { $returnType = ''; - $request = $this->apiWorkerPostRequest($addJobDto); + $request = $this->queueControllerRemoveJobRequest($id); try { $options = $this->createHttpClientOption(); @@ -1085,18 +1253,18 @@ public function apiWorkerPostWithHttpInfo($addJobDto) } /** - * Operation apiWorkerPostAsync + * Operation queueControllerRemoveJobAsync * * * - * @param \Yoast\MyYoastApiClient\Model\AddJobDto $addJobDto (required) + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiWorkerPostAsync($addJobDto) + public function queueControllerRemoveJobAsync($id) { - return $this->apiWorkerPostAsyncWithHttpInfo($addJobDto) + return $this->queueControllerRemoveJobAsyncWithHttpInfo($id) ->then( function ($response) { return $response[0]; @@ -1105,19 +1273,19 @@ function ($response) { } /** - * Operation apiWorkerPostAsyncWithHttpInfo + * Operation queueControllerRemoveJobAsyncWithHttpInfo * * * - * @param \Yoast\MyYoastApiClient\Model\AddJobDto $addJobDto (required) + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function apiWorkerPostAsyncWithHttpInfo($addJobDto) + public function queueControllerRemoveJobAsyncWithHttpInfo($id) { $returnType = ''; - $request = $this->apiWorkerPostRequest($addJobDto); + $request = $this->queueControllerRemoveJobRequest($id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1143,23 +1311,23 @@ function ($exception) { } /** - * Create request for operation 'apiWorkerPost' + * Create request for operation 'queueControllerRemoveJob' * - * @param \Yoast\MyYoastApiClient\Model\AddJobDto $addJobDto (required) + * @param string $id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function apiWorkerPostRequest($addJobDto) + protected function queueControllerRemoveJobRequest($id) { - // verify the required parameter 'addJobDto' is set - if ($addJobDto === null || (is_array($addJobDto) && count($addJobDto) === 0)) { + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $addJobDto when calling apiWorkerPost' + 'Missing the required parameter $id when calling queueControllerRemoveJob' ); } - $resourcePath = '/api/Worker'; + $resourcePath = '/api/Worker/job/{id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1167,21 +1335,26 @@ protected function apiWorkerPostRequest($addJobDto) $multipart = false; + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } // body params $_tempBody = null; - if (isset($addJobDto)) { - $_tempBody = $addJobDto; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] + [] ); } else { $headers = $this->headerSelector->selectHeaders( - ['application/json'], - ['application/json'] + [], + [] ); } @@ -1189,16 +1362,9 @@ protected function apiWorkerPostRequest($addJobDto) if (isset($_tempBody)) { // $_tempBody is the method argument, if present $httpBody = $_tempBody; - - if($headers['Content-Type'] === 'application/json') { - // \stdClass has no __toString(), so we should encode it manually - if ($httpBody instanceof \stdClass) { - $httpBody = \GuzzleHttp\json_encode($httpBody); - } - // array has no __toString(), so we should encode it manually - if(is_array($httpBody)) { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody)); - } + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); } } elseif (count($formParams) > 0) { if ($multipart) { @@ -1221,11 +1387,10 @@ protected function apiWorkerPostRequest($addJobDto) } } - // this endpoint requires API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } + // // this endpoint requires Bearer token + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } $defaultHeaders = []; if ($this->config->getUserAgent()) { @@ -1240,7 +1405,7 @@ protected function apiWorkerPostRequest($addJobDto) $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'POST', + 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody diff --git a/src/ApiException.php b/src/ApiException.php index 3500be3..6de76aa 100644 --- a/src/ApiException.php +++ b/src/ApiException.php @@ -17,9 +17,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen diff --git a/src/Configuration.php b/src/Configuration.php index 2b5d601..b2626f6 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -17,9 +17,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -81,7 +80,7 @@ class Configuration * * @var string */ - protected $host = 'http://my.yoast.test:3000'; + protected $host = '/'; /** * User agent of the HTTP request, set to "PHP-Swagger" by default diff --git a/src/HeaderSelector.php b/src/HeaderSelector.php index eba7fe3..a2699a1 100644 --- a/src/HeaderSelector.php +++ b/src/HeaderSelector.php @@ -17,9 +17,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -107,3 +106,4 @@ private function selectContentTypeHeader($contentType) } } } + diff --git a/src/Model/AccessToken.php b/src/Model/AccessToken.php index e748fa0..3bcbd9d 100644 --- a/src/Model/AccessToken.php +++ b/src/Model/AccessToken.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,12 +57,11 @@ class AccessToken implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'id' => 'string', - 'ttl' => 'int', - 'created' => '\DateTime', - 'createdAt' => '\DateTime', - 'modifiedAt' => '\DateTime', - 'userId' => 'string' - ]; +'ttl' => 'int', +'created' => '\DateTime', +'createdAt' => '\DateTime', +'modifiedAt' => '\DateTime', +'userId' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -72,12 +70,11 @@ class AccessToken implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'id' => null, - 'ttl' => null, - 'created' => 'date-time', - 'createdAt' => 'date-time', - 'modifiedAt' => 'date-time', - 'userId' => 'uuid' - ]; +'ttl' => null, +'created' => 'date-time', +'createdAt' => 'date-time', +'modifiedAt' => 'date-time', +'userId' => 'uuid' ]; /** * Array of property to type mappings. Used for (de)serialization @@ -107,12 +104,11 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'id' => 'id', - 'ttl' => 'ttl', - 'created' => 'created', - 'createdAt' => 'createdAt', - 'modifiedAt' => 'modifiedAt', - 'userId' => 'userId' - ]; +'ttl' => 'ttl', +'created' => 'created', +'createdAt' => 'createdAt', +'modifiedAt' => 'modifiedAt', +'userId' => 'userId' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -121,12 +117,11 @@ public static function swaggerFormats() */ protected static $setters = [ 'id' => 'setId', - 'ttl' => 'setTtl', - 'created' => 'setCreated', - 'createdAt' => 'setCreatedAt', - 'modifiedAt' => 'setModifiedAt', - 'userId' => 'setUserId' - ]; +'ttl' => 'setTtl', +'created' => 'setCreated', +'createdAt' => 'setCreatedAt', +'modifiedAt' => 'setModifiedAt', +'userId' => 'setUserId' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -135,12 +130,11 @@ public static function swaggerFormats() */ protected static $getters = [ 'id' => 'getId', - 'ttl' => 'getTtl', - 'created' => 'getCreated', - 'createdAt' => 'getCreatedAt', - 'modifiedAt' => 'getModifiedAt', - 'userId' => 'getUserId' - ]; +'ttl' => 'getTtl', +'created' => 'getCreated', +'createdAt' => 'getCreatedAt', +'modifiedAt' => 'getModifiedAt', +'userId' => 'getUserId' ]; /** * Array of attributes where the key is the local name, @@ -185,8 +179,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -465,5 +457,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/ActivateAccountDto.php b/src/Model/ActivateAccountDto.php index d293634..462c7a8 100644 --- a/src/Model/ActivateAccountDto.php +++ b/src/Model/ActivateAccountDto.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -57,8 +56,7 @@ class ActivateAccountDto implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerTypes = [ - 'key' => 'string' - ]; + 'key' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -66,8 +64,7 @@ class ActivateAccountDto implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerFormats = [ - 'key' => null - ]; + 'key' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -96,8 +93,7 @@ public static function swaggerFormats() * @var string[] */ protected static $attributeMap = [ - 'key' => 'key' - ]; + 'key' => 'key' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -105,8 +101,7 @@ public static function swaggerFormats() * @var string[] */ protected static $setters = [ - 'key' => 'setKey' - ]; + 'key' => 'setKey' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -114,8 +109,7 @@ public static function swaggerFormats() * @var string[] */ protected static $getters = [ - 'key' => 'getKey' - ]; + 'key' => 'getKey' ]; /** * Array of attributes where the key is the local name, @@ -160,8 +154,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -300,5 +292,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/AddJobDto.php b/src/Model/AddJobDto.php index 74ee9d1..32520ef 100644 --- a/src/Model/AddJobDto.php +++ b/src/Model/AddJobDto.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,9 +57,8 @@ class AddJobDto implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'name' => 'string', - 'data' => 'object', - 'options' => '\Yoast\MyYoastApiClient\Model\JobOptionsDto' - ]; +'data' => 'object', +'options' => '\Yoast\MyYoastApiClient\Model\JobOptionsDto' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -69,9 +67,8 @@ class AddJobDto implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'name' => null, - 'data' => null, - 'options' => null - ]; +'data' => null, +'options' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -101,9 +98,8 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'name' => 'name', - 'data' => 'data', - 'options' => 'options' - ]; +'data' => 'data', +'options' => 'options' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -112,9 +108,8 @@ public static function swaggerFormats() */ protected static $setters = [ 'name' => 'setName', - 'data' => 'setData', - 'options' => 'setOptions' - ]; +'data' => 'setData', +'options' => 'setOptions' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -123,9 +118,8 @@ public static function swaggerFormats() */ protected static $getters = [ 'name' => 'getName', - 'data' => 'getData', - 'options' => 'getOptions' - ]; +'data' => 'getData', +'options' => 'getOptions' ]; /** * Array of attributes where the key is the local name, @@ -170,8 +164,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -360,5 +352,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/AddSubscriptionDto.php b/src/Model/AddSubscriptionDto.php index 2f3e2ae..36b001a 100644 --- a/src/Model/AddSubscriptionDto.php +++ b/src/Model/AddSubscriptionDto.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -57,8 +56,7 @@ class AddSubscriptionDto implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerTypes = [ - 'subscriptionId' => 'string' - ]; + 'subscriptionId' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -66,8 +64,7 @@ class AddSubscriptionDto implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerFormats = [ - 'subscriptionId' => null - ]; + 'subscriptionId' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -96,8 +93,7 @@ public static function swaggerFormats() * @var string[] */ protected static $attributeMap = [ - 'subscriptionId' => 'subscriptionId' - ]; + 'subscriptionId' => 'subscriptionId' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -105,8 +101,7 @@ public static function swaggerFormats() * @var string[] */ protected static $setters = [ - 'subscriptionId' => 'setSubscriptionId' - ]; + 'subscriptionId' => 'setSubscriptionId' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -114,8 +109,7 @@ public static function swaggerFormats() * @var string[] */ protected static $getters = [ - 'subscriptionId' => 'getSubscriptionId' - ]; + 'subscriptionId' => 'getSubscriptionId' ]; /** * Array of attributes where the key is the local name, @@ -160,8 +154,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -300,5 +292,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/Admission.php b/src/Model/Admission.php new file mode 100644 index 0000000..acd2b34 --- /dev/null +++ b/src/Model/Admission.php @@ -0,0 +1,459 @@ + 'string', +'createdAt' => '\DateTime', +'modifiedAt' => '\DateTime', +'studentId' => 'string', +'buyerId' => 'string', +'subscriptionId' => 'string' ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => null, +'createdAt' => 'date-time', +'modifiedAt' => 'date-time', +'studentId' => 'uuid', +'buyerId' => 'uuid', +'subscriptionId' => 'uuid' ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', +'createdAt' => 'createdAt', +'modifiedAt' => 'modifiedAt', +'studentId' => 'studentId', +'buyerId' => 'buyerId', +'subscriptionId' => 'subscriptionId' ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', +'createdAt' => 'setCreatedAt', +'modifiedAt' => 'setModifiedAt', +'studentId' => 'setStudentId', +'buyerId' => 'setBuyerId', +'subscriptionId' => 'setSubscriptionId' ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', +'createdAt' => 'getCreatedAt', +'modifiedAt' => 'getModifiedAt', +'studentId' => 'getStudentId', +'buyerId' => 'getBuyerId', +'subscriptionId' => 'getSubscriptionId' ]; + + /** + * 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::$swaggerModelName; + } + + + + /** + * 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->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null; + $this->container['modifiedAt'] = isset($data['modifiedAt']) ? $data['modifiedAt'] : null; + $this->container['studentId'] = isset($data['studentId']) ? $data['studentId'] : null; + $this->container['buyerId'] = isset($data['buyerId']) ? $data['buyerId'] : null; + $this->container['subscriptionId'] = isset($data['subscriptionId']) ? $data['subscriptionId'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['createdAt'] === null) { + $invalidProperties[] = "'createdAt' can't be null"; + } + if ($this->container['modifiedAt'] === null) { + $invalidProperties[] = "'modifiedAt' can't be null"; + } + if ($this->container['studentId'] === null) { + $invalidProperties[] = "'studentId' can't be null"; + } + if ($this->container['buyerId'] === null) { + $invalidProperties[] = "'buyerId' can't be null"; + } + if ($this->container['subscriptionId'] === null) { + $invalidProperties[] = "'subscriptionId' 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 id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id id + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets createdAt + * + * @return \DateTime + */ + public function getCreatedAt() + { + return $this->container['createdAt']; + } + + /** + * Sets createdAt + * + * @param \DateTime $createdAt createdAt + * + * @return $this + */ + public function setCreatedAt($createdAt) + { + $this->container['createdAt'] = $createdAt; + + return $this; + } + + /** + * Gets modifiedAt + * + * @return \DateTime + */ + public function getModifiedAt() + { + return $this->container['modifiedAt']; + } + + /** + * Sets modifiedAt + * + * @param \DateTime $modifiedAt modifiedAt + * + * @return $this + */ + public function setModifiedAt($modifiedAt) + { + $this->container['modifiedAt'] = $modifiedAt; + + return $this; + } + + /** + * Gets studentId + * + * @return string + */ + public function getStudentId() + { + return $this->container['studentId']; + } + + /** + * Sets studentId + * + * @param string $studentId studentId + * + * @return $this + */ + public function setStudentId($studentId) + { + $this->container['studentId'] = $studentId; + + return $this; + } + + /** + * Gets buyerId + * + * @return string + */ + public function getBuyerId() + { + return $this->container['buyerId']; + } + + /** + * Sets buyerId + * + * @param string $buyerId buyerId + * + * @return $this + */ + public function setBuyerId($buyerId) + { + $this->container['buyerId'] = $buyerId; + + return $this; + } + + /** + * Gets subscriptionId + * + * @return string + */ + public function getSubscriptionId() + { + return $this->container['subscriptionId']; + } + + /** + * Sets subscriptionId + * + * @param string $subscriptionId subscriptionId + * + * @return $this + */ + public function setSubscriptionId($subscriptionId) + { + $this->container['subscriptionId'] = $subscriptionId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} diff --git a/src/Model/AutoRenewalCountResponseDto.php b/src/Model/AutoRenewalCountResponseDto.php index 5e392d5..5fe5053 100644 --- a/src/Model/AutoRenewalCountResponseDto.php +++ b/src/Model/AutoRenewalCountResponseDto.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -57,8 +56,7 @@ class AutoRenewalCountResponseDto implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerTypes = [ - 'amount' => 'float' - ]; + 'amount' => 'int' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -66,8 +64,7 @@ class AutoRenewalCountResponseDto implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerFormats = [ - 'amount' => null - ]; + 'amount' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -96,8 +93,7 @@ public static function swaggerFormats() * @var string[] */ protected static $attributeMap = [ - 'amount' => 'amount' - ]; + 'amount' => 'amount' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -105,8 +101,7 @@ public static function swaggerFormats() * @var string[] */ protected static $setters = [ - 'amount' => 'setAmount' - ]; + 'amount' => 'setAmount' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -114,8 +109,7 @@ public static function swaggerFormats() * @var string[] */ protected static $getters = [ - 'amount' => 'getAmount' - ]; + 'amount' => 'getAmount' ]; /** * Array of attributes where the key is the local name, @@ -160,8 +154,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -210,7 +202,7 @@ public function valid() /** * Gets amount * - * @return float + * @return int */ public function getAmount() { @@ -220,7 +212,7 @@ public function getAmount() /** * Sets amount * - * @param float $amount amount + * @param int $amount amount * * @return $this */ @@ -300,5 +292,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/BillingDto.php b/src/Model/BillingDto.php index 859d416..c31f9e8 100644 --- a/src/Model/BillingDto.php +++ b/src/Model/BillingDto.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,17 +57,16 @@ class BillingDto implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'firstName' => 'string', - 'lastName' => 'string', - 'company' => 'string', - 'address1' => 'string', - 'address2' => 'string', - 'city' => 'string', - 'state' => 'string', - 'postcode' => 'string', - 'country' => 'string', - 'email' => 'string', - 'phone' => 'string' - ]; +'lastName' => 'string', +'company' => 'string', +'address1' => 'string', +'address2' => 'string', +'city' => 'string', +'state' => 'string', +'postcode' => 'string', +'country' => 'string', +'email' => 'string', +'phone' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -77,17 +75,16 @@ class BillingDto implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'firstName' => null, - 'lastName' => null, - 'company' => null, - 'address1' => null, - 'address2' => null, - 'city' => null, - 'state' => null, - 'postcode' => null, - 'country' => null, - 'email' => null, - 'phone' => null - ]; +'lastName' => null, +'company' => null, +'address1' => null, +'address2' => null, +'city' => null, +'state' => null, +'postcode' => null, +'country' => null, +'email' => null, +'phone' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -117,17 +114,16 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'firstName' => 'first_name', - 'lastName' => 'last_name', - 'company' => 'company', - 'address1' => 'address_1', - 'address2' => 'address_2', - 'city' => 'city', - 'state' => 'state', - 'postcode' => 'postcode', - 'country' => 'country', - 'email' => 'email', - 'phone' => 'phone' - ]; +'lastName' => 'last_name', +'company' => 'company', +'address1' => 'address_1', +'address2' => 'address_2', +'city' => 'city', +'state' => 'state', +'postcode' => 'postcode', +'country' => 'country', +'email' => 'email', +'phone' => 'phone' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -136,17 +132,16 @@ public static function swaggerFormats() */ protected static $setters = [ 'firstName' => 'setFirstName', - 'lastName' => 'setLastName', - 'company' => 'setCompany', - 'address1' => 'setAddress1', - 'address2' => 'setAddress2', - 'city' => 'setCity', - 'state' => 'setState', - 'postcode' => 'setPostcode', - 'country' => 'setCountry', - 'email' => 'setEmail', - 'phone' => 'setPhone' - ]; +'lastName' => 'setLastName', +'company' => 'setCompany', +'address1' => 'setAddress1', +'address2' => 'setAddress2', +'city' => 'setCity', +'state' => 'setState', +'postcode' => 'setPostcode', +'country' => 'setCountry', +'email' => 'setEmail', +'phone' => 'setPhone' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -155,17 +150,16 @@ public static function swaggerFormats() */ protected static $getters = [ 'firstName' => 'getFirstName', - 'lastName' => 'getLastName', - 'company' => 'getCompany', - 'address1' => 'getAddress1', - 'address2' => 'getAddress2', - 'city' => 'getCity', - 'state' => 'getState', - 'postcode' => 'getPostcode', - 'country' => 'getCountry', - 'email' => 'getEmail', - 'phone' => 'getPhone' - ]; +'lastName' => 'getLastName', +'company' => 'getCompany', +'address1' => 'getAddress1', +'address2' => 'getAddress2', +'city' => 'getCity', +'state' => 'getState', +'postcode' => 'getPostcode', +'country' => 'getCountry', +'email' => 'getEmail', +'phone' => 'getPhone' ]; /** * Array of attributes where the key is the local name, @@ -210,8 +204,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -630,5 +622,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/Blacklist.php b/src/Model/Blacklist.php index 3854746..c9f01c9 100644 --- a/src/Model/Blacklist.php +++ b/src/Model/Blacklist.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,9 +57,8 @@ class Blacklist implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'id' => 'string', - 'url' => 'string', - 'dateAdded' => '\DateTime' - ]; +'url' => 'string', +'dateAdded' => '\DateTime' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -69,9 +67,8 @@ class Blacklist implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'id' => null, - 'url' => null, - 'dateAdded' => 'date-time' - ]; +'url' => null, +'dateAdded' => 'date-time' ]; /** * Array of property to type mappings. Used for (de)serialization @@ -101,9 +98,8 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'id' => 'id', - 'url' => 'url', - 'dateAdded' => 'dateAdded' - ]; +'url' => 'url', +'dateAdded' => 'dateAdded' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -112,9 +108,8 @@ public static function swaggerFormats() */ protected static $setters = [ 'id' => 'setId', - 'url' => 'setUrl', - 'dateAdded' => 'setDateAdded' - ]; +'url' => 'setUrl', +'dateAdded' => 'setDateAdded' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -123,9 +118,8 @@ public static function swaggerFormats() */ protected static $getters = [ 'id' => 'getId', - 'url' => 'getUrl', - 'dateAdded' => 'getDateAdded' - ]; +'url' => 'getUrl', +'dateAdded' => 'getDateAdded' ]; /** * Array of attributes where the key is the local name, @@ -170,8 +164,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -366,5 +358,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/BulkInviteDto.php b/src/Model/BulkInviteDto.php index a5d65b1..910fdd5 100644 --- a/src/Model/BulkInviteDto.php +++ b/src/Model/BulkInviteDto.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,9 +57,8 @@ class BulkInviteDto implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'lineItemId' => 'string', - 'lineItemNumber' => 'string', - 'email' => 'string' - ]; +'lineItemNumber' => 'string', +'email' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -69,9 +67,8 @@ class BulkInviteDto implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'lineItemId' => null, - 'lineItemNumber' => null, - 'email' => null - ]; +'lineItemNumber' => null, +'email' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -101,9 +98,8 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'lineItemId' => 'lineItemId', - 'lineItemNumber' => 'lineItemNumber', - 'email' => 'email' - ]; +'lineItemNumber' => 'lineItemNumber', +'email' => 'email' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -112,9 +108,8 @@ public static function swaggerFormats() */ protected static $setters = [ 'lineItemId' => 'setLineItemId', - 'lineItemNumber' => 'setLineItemNumber', - 'email' => 'setEmail' - ]; +'lineItemNumber' => 'setLineItemNumber', +'email' => 'setEmail' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -123,9 +118,8 @@ public static function swaggerFormats() */ protected static $getters = [ 'lineItemId' => 'getLineItemId', - 'lineItemNumber' => 'getLineItemNumber', - 'email' => 'getEmail' - ]; +'lineItemNumber' => 'getLineItemNumber', +'email' => 'getEmail' ]; /** * Array of attributes where the key is the local name, @@ -170,8 +164,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -366,5 +358,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/BulkSendEmailDto.php b/src/Model/BulkSendEmailDto.php new file mode 100644 index 0000000..c0eab20 --- /dev/null +++ b/src/Model/BulkSendEmailDto.php @@ -0,0 +1,327 @@ + 'string', +'receiverEmails' => 'string[]' ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'templateName' => null, +'receiverEmails' => null ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'templateName' => 'templateName', +'receiverEmails' => 'receiverEmails' ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'templateName' => 'setTemplateName', +'receiverEmails' => 'setReceiverEmails' ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'templateName' => 'getTemplateName', +'receiverEmails' => 'getReceiverEmails' ]; + + /** + * 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::$swaggerModelName; + } + + + + /** + * 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->container['templateName'] = isset($data['templateName']) ? $data['templateName'] : null; + $this->container['receiverEmails'] = isset($data['receiverEmails']) ? $data['receiverEmails'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['templateName'] === null) { + $invalidProperties[] = "'templateName' can't be null"; + } + if ($this->container['receiverEmails'] === null) { + $invalidProperties[] = "'receiverEmails' 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 templateName + * + * @return string + */ + public function getTemplateName() + { + return $this->container['templateName']; + } + + /** + * Sets templateName + * + * @param string $templateName The alias of the PostMark template to send to all recipients. + * + * @return $this + */ + public function setTemplateName($templateName) + { + $this->container['templateName'] = $templateName; + + return $this; + } + + /** + * Gets receiverEmails + * + * @return string[] + */ + public function getReceiverEmails() + { + return $this->container['receiverEmails']; + } + + /** + * Sets receiverEmails + * + * @param string[] $receiverEmails receiverEmails + * + * @return $this + */ + public function setReceiverEmails($receiverEmails) + { + $this->container['receiverEmails'] = $receiverEmails; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} diff --git a/src/Model/CancelProvisionedSubscriptionDto.php b/src/Model/CancelProvisionedSubscriptionDto.php new file mode 100644 index 0000000..5324fcf --- /dev/null +++ b/src/Model/CancelProvisionedSubscriptionDto.php @@ -0,0 +1,294 @@ + 'bool' ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'immediately' => null ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'immediately' => 'immediately' ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'immediately' => 'setImmediately' ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'immediately' => 'getImmediately' ]; + + /** + * 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::$swaggerModelName; + } + + + + /** + * 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->container['immediately'] = isset($data['immediately']) ? $data['immediately'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['immediately'] === null) { + $invalidProperties[] = "'immediately' 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 immediately + * + * @return bool + */ + public function getImmediately() + { + return $this->container['immediately']; + } + + /** + * Sets immediately + * + * @param bool $immediately Immediately will cancel the subscription directly, otherwise it will end when the period has expired. + * + * @return $this + */ + public function setImmediately($immediately) + { + $this->container['immediately'] = $immediately; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} diff --git a/src/Model/CancelSubscriptionBodyDto.php b/src/Model/CancelSubscriptionBodyDto.php index cccb634..a4eacbd 100644 --- a/src/Model/CancelSubscriptionBodyDto.php +++ b/src/Model/CancelSubscriptionBodyDto.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -57,8 +56,7 @@ class CancelSubscriptionBodyDto implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerTypes = [ - 'amount' => 'int' - ]; + 'amount' => 'int' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -66,8 +64,7 @@ class CancelSubscriptionBodyDto implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerFormats = [ - 'amount' => null - ]; + 'amount' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -96,8 +93,7 @@ public static function swaggerFormats() * @var string[] */ protected static $attributeMap = [ - 'amount' => 'amount' - ]; + 'amount' => 'amount' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -105,8 +101,7 @@ public static function swaggerFormats() * @var string[] */ protected static $setters = [ - 'amount' => 'setAmount' - ]; + 'amount' => 'setAmount' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -114,8 +109,7 @@ public static function swaggerFormats() * @var string[] */ protected static $getters = [ - 'amount' => 'getAmount' - ]; + 'amount' => 'getAmount' ]; /** * Array of attributes where the key is the local name, @@ -160,8 +154,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -300,5 +292,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/ChangePasswordDto.php b/src/Model/ChangePasswordDto.php index 6dc5657..b41187e 100644 --- a/src/Model/ChangePasswordDto.php +++ b/src/Model/ChangePasswordDto.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,9 +57,8 @@ class ChangePasswordDto implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'password' => 'string', - 'passwordConfirmation' => 'string', - 'oldPassword' => 'string' - ]; +'passwordConfirmation' => 'string', +'oldPassword' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -69,9 +67,8 @@ class ChangePasswordDto implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'password' => null, - 'passwordConfirmation' => null, - 'oldPassword' => null - ]; +'passwordConfirmation' => null, +'oldPassword' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -101,9 +98,8 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'password' => 'password', - 'passwordConfirmation' => 'password_confirmation', - 'oldPassword' => 'old_password' - ]; +'passwordConfirmation' => 'password_confirmation', +'oldPassword' => 'old_password' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -112,9 +108,8 @@ public static function swaggerFormats() */ protected static $setters = [ 'password' => 'setPassword', - 'passwordConfirmation' => 'setPasswordConfirmation', - 'oldPassword' => 'setOldPassword' - ]; +'passwordConfirmation' => 'setPasswordConfirmation', +'oldPassword' => 'setOldPassword' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -123,9 +118,8 @@ public static function swaggerFormats() */ protected static $getters = [ 'password' => 'getPassword', - 'passwordConfirmation' => 'getPasswordConfirmation', - 'oldPassword' => 'getOldPassword' - ]; +'passwordConfirmation' => 'getPasswordConfirmation', +'oldPassword' => 'getOldPassword' ]; /** * Array of attributes where the key is the local name, @@ -170,8 +164,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -366,5 +358,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/ComposerToken.php b/src/Model/ComposerToken.php index 590867a..f08a776 100644 --- a/src/Model/ComposerToken.php +++ b/src/Model/ComposerToken.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,12 +57,11 @@ class ComposerToken implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'id' => 'string', - 'name' => 'string', - 'enabled' => 'bool', - 'createdAt' => '\DateTime', - 'modifiedAt' => '\DateTime', - 'userId' => 'string' - ]; +'name' => 'string', +'enabled' => 'bool', +'createdAt' => '\DateTime', +'modifiedAt' => '\DateTime', +'userId' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -72,12 +70,11 @@ class ComposerToken implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'id' => null, - 'name' => null, - 'enabled' => null, - 'createdAt' => 'date-time', - 'modifiedAt' => 'date-time', - 'userId' => 'uuid' - ]; +'name' => null, +'enabled' => null, +'createdAt' => 'date-time', +'modifiedAt' => 'date-time', +'userId' => 'uuid' ]; /** * Array of property to type mappings. Used for (de)serialization @@ -107,12 +104,11 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'id' => 'id', - 'name' => 'name', - 'enabled' => 'enabled', - 'createdAt' => 'createdAt', - 'modifiedAt' => 'modifiedAt', - 'userId' => 'userId' - ]; +'name' => 'name', +'enabled' => 'enabled', +'createdAt' => 'createdAt', +'modifiedAt' => 'modifiedAt', +'userId' => 'userId' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -121,12 +117,11 @@ public static function swaggerFormats() */ protected static $setters = [ 'id' => 'setId', - 'name' => 'setName', - 'enabled' => 'setEnabled', - 'createdAt' => 'setCreatedAt', - 'modifiedAt' => 'setModifiedAt', - 'userId' => 'setUserId' - ]; +'name' => 'setName', +'enabled' => 'setEnabled', +'createdAt' => 'setCreatedAt', +'modifiedAt' => 'setModifiedAt', +'userId' => 'setUserId' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -135,12 +130,11 @@ public static function swaggerFormats() */ protected static $getters = [ 'id' => 'getId', - 'name' => 'getName', - 'enabled' => 'getEnabled', - 'createdAt' => 'getCreatedAt', - 'modifiedAt' => 'getModifiedAt', - 'userId' => 'getUserId' - ]; +'name' => 'getName', +'enabled' => 'getEnabled', +'createdAt' => 'getCreatedAt', +'modifiedAt' => 'getModifiedAt', +'userId' => 'getUserId' ]; /** * Array of attributes where the key is the local name, @@ -185,8 +179,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -465,5 +457,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/CouponLineDto.php b/src/Model/CouponLineDto.php index b48a9d6..734459f 100644 --- a/src/Model/CouponLineDto.php +++ b/src/Model/CouponLineDto.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,11 +57,10 @@ class CouponLineDto implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'id' => 'int', - 'code' => 'string', - 'discount' => 'string', - 'discountTax' => 'string', - 'metaData' => '\Yoast\MyYoastApiClient\Model\MetaDataDto[]' - ]; +'code' => 'string', +'discount' => 'string', +'discountTax' => 'string', +'metaData' => '\Yoast\MyYoastApiClient\Model\MetaDataDto[]' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -71,11 +69,10 @@ class CouponLineDto implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'id' => null, - 'code' => null, - 'discount' => null, - 'discountTax' => null, - 'metaData' => null - ]; +'code' => null, +'discount' => null, +'discountTax' => null, +'metaData' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -105,11 +102,10 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'id' => 'id', - 'code' => 'code', - 'discount' => 'discount', - 'discountTax' => 'discount_tax', - 'metaData' => 'meta_data' - ]; +'code' => 'code', +'discount' => 'discount', +'discountTax' => 'discount_tax', +'metaData' => 'meta_data' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -118,11 +114,10 @@ public static function swaggerFormats() */ protected static $setters = [ 'id' => 'setId', - 'code' => 'setCode', - 'discount' => 'setDiscount', - 'discountTax' => 'setDiscountTax', - 'metaData' => 'setMetaData' - ]; +'code' => 'setCode', +'discount' => 'setDiscount', +'discountTax' => 'setDiscountTax', +'metaData' => 'setMetaData' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -131,11 +126,10 @@ public static function swaggerFormats() */ protected static $getters = [ 'id' => 'getId', - 'code' => 'getCode', - 'discount' => 'getDiscount', - 'discountTax' => 'getDiscountTax', - 'metaData' => 'getMetaData' - ]; +'code' => 'getCode', +'discount' => 'getDiscount', +'discountTax' => 'getDiscountTax', +'metaData' => 'getMetaData' ]; /** * Array of attributes where the key is the local name, @@ -180,8 +174,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -432,5 +424,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/Course.php b/src/Model/Course.php index de95a29..15f37e2 100644 --- a/src/Model/Course.php +++ b/src/Model/Course.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,21 +57,20 @@ class Course implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'id' => 'string', - 'name' => 'string', - 'description' => 'string', - 'courseUrl' => 'string', - 'certificateUrl' => 'string', - 'sourceId' => 'int', - 'createdAt' => '\DateTime', - 'modifiedAt' => '\DateTime', - 'iconUrl' => 'string', - 'complimentary' => 'bool', - 'open' => 'bool', - 'hasTrial' => 'bool', - 'deprecated' => 'bool', - 'sale' => 'bool', - 'saleLabel' => 'string' - ]; +'name' => 'string', +'description' => 'string', +'courseUrl' => 'string', +'certificateUrl' => 'string', +'sourceId' => 'int', +'createdAt' => '\DateTime', +'modifiedAt' => '\DateTime', +'iconUrl' => 'string', +'complimentary' => 'bool', +'open' => 'bool', +'hasTrial' => 'bool', +'deprecated' => 'bool', +'sale' => 'bool', +'saleLabel' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -81,21 +79,20 @@ class Course implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'id' => null, - 'name' => null, - 'description' => null, - 'courseUrl' => null, - 'certificateUrl' => null, - 'sourceId' => null, - 'createdAt' => 'date-time', - 'modifiedAt' => 'date-time', - 'iconUrl' => null, - 'complimentary' => null, - 'open' => null, - 'hasTrial' => null, - 'deprecated' => null, - 'sale' => null, - 'saleLabel' => null - ]; +'name' => null, +'description' => null, +'courseUrl' => null, +'certificateUrl' => null, +'sourceId' => null, +'createdAt' => 'date-time', +'modifiedAt' => 'date-time', +'iconUrl' => null, +'complimentary' => null, +'open' => null, +'hasTrial' => null, +'deprecated' => null, +'sale' => null, +'saleLabel' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -125,21 +122,20 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'id' => 'id', - 'name' => 'name', - 'description' => 'description', - 'courseUrl' => 'courseUrl', - 'certificateUrl' => 'certificateUrl', - 'sourceId' => 'sourceId', - 'createdAt' => 'createdAt', - 'modifiedAt' => 'modifiedAt', - 'iconUrl' => 'iconUrl', - 'complimentary' => 'complimentary', - 'open' => 'open', - 'hasTrial' => 'hasTrial', - 'deprecated' => 'deprecated', - 'sale' => 'sale', - 'saleLabel' => 'saleLabel' - ]; +'name' => 'name', +'description' => 'description', +'courseUrl' => 'courseUrl', +'certificateUrl' => 'certificateUrl', +'sourceId' => 'sourceId', +'createdAt' => 'createdAt', +'modifiedAt' => 'modifiedAt', +'iconUrl' => 'iconUrl', +'complimentary' => 'complimentary', +'open' => 'open', +'hasTrial' => 'hasTrial', +'deprecated' => 'deprecated', +'sale' => 'sale', +'saleLabel' => 'saleLabel' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -148,21 +144,20 @@ public static function swaggerFormats() */ protected static $setters = [ 'id' => 'setId', - 'name' => 'setName', - 'description' => 'setDescription', - 'courseUrl' => 'setCourseUrl', - 'certificateUrl' => 'setCertificateUrl', - 'sourceId' => 'setSourceId', - 'createdAt' => 'setCreatedAt', - 'modifiedAt' => 'setModifiedAt', - 'iconUrl' => 'setIconUrl', - 'complimentary' => 'setComplimentary', - 'open' => 'setOpen', - 'hasTrial' => 'setHasTrial', - 'deprecated' => 'setDeprecated', - 'sale' => 'setSale', - 'saleLabel' => 'setSaleLabel' - ]; +'name' => 'setName', +'description' => 'setDescription', +'courseUrl' => 'setCourseUrl', +'certificateUrl' => 'setCertificateUrl', +'sourceId' => 'setSourceId', +'createdAt' => 'setCreatedAt', +'modifiedAt' => 'setModifiedAt', +'iconUrl' => 'setIconUrl', +'complimentary' => 'setComplimentary', +'open' => 'setOpen', +'hasTrial' => 'setHasTrial', +'deprecated' => 'setDeprecated', +'sale' => 'setSale', +'saleLabel' => 'setSaleLabel' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -171,21 +166,20 @@ public static function swaggerFormats() */ protected static $getters = [ 'id' => 'getId', - 'name' => 'getName', - 'description' => 'getDescription', - 'courseUrl' => 'getCourseUrl', - 'certificateUrl' => 'getCertificateUrl', - 'sourceId' => 'getSourceId', - 'createdAt' => 'getCreatedAt', - 'modifiedAt' => 'getModifiedAt', - 'iconUrl' => 'getIconUrl', - 'complimentary' => 'getComplimentary', - 'open' => 'getOpen', - 'hasTrial' => 'getHasTrial', - 'deprecated' => 'getDeprecated', - 'sale' => 'getSale', - 'saleLabel' => 'getSaleLabel' - ]; +'name' => 'getName', +'description' => 'getDescription', +'courseUrl' => 'getCourseUrl', +'certificateUrl' => 'getCertificateUrl', +'sourceId' => 'getSourceId', +'createdAt' => 'getCreatedAt', +'modifiedAt' => 'getModifiedAt', +'iconUrl' => 'getIconUrl', +'complimentary' => 'getComplimentary', +'open' => 'getOpen', +'hasTrial' => 'getHasTrial', +'deprecated' => 'getDeprecated', +'sale' => 'getSale', +'saleLabel' => 'getSaleLabel' ]; /** * Array of attributes where the key is the local name, @@ -230,8 +224,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -762,5 +754,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/CourseDataDto.php b/src/Model/CourseDataDto.php index 2540ad6..f904c0b 100644 --- a/src/Model/CourseDataDto.php +++ b/src/Model/CourseDataDto.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,8 +57,7 @@ class CourseDataDto implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'postTitle' => 'string', - 'iD' => 'int' - ]; +'iD' => 'int' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -68,8 +66,7 @@ class CourseDataDto implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'postTitle' => null, - 'iD' => null - ]; +'iD' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -99,8 +96,7 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'postTitle' => 'post_title', - 'iD' => 'ID' - ]; +'iD' => 'ID' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -109,8 +105,7 @@ public static function swaggerFormats() */ protected static $setters = [ 'postTitle' => 'setPostTitle', - 'iD' => 'setID' - ]; +'iD' => 'setID' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -119,8 +114,7 @@ public static function swaggerFormats() */ protected static $getters = [ 'postTitle' => 'getPostTitle', - 'iD' => 'getID' - ]; +'iD' => 'getID' ]; /** * Array of attributes where the key is the local name, @@ -165,8 +159,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -333,5 +325,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/CourseEnrollment.php b/src/Model/CourseEnrollment.php index 710048d..659fd89 100644 --- a/src/Model/CourseEnrollment.php +++ b/src/Model/CourseEnrollment.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,22 +57,22 @@ class CourseEnrollment implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'id' => 'string', - 'status' => 'string', - 'progress' => 'float', - 'createdAt' => '\DateTime', - 'modifiedAt' => '\DateTime', - 'isTrial' => 'bool', - 'outsideTrialProgress' => 'bool', - 'trialCompleted' => 'bool', - 'lineItemId' => 'string', - 'lineItemNumber' => 'int', - 'expiryDate' => '\DateTime', - 'studentId' => 'string', - 'buyerId' => 'string', - 'orderId' => 'string', - 'courseId' => 'string', - 'productId' => 'string' - ]; +'status' => 'string', +'progress' => 'int', +'createdAt' => '\DateTime', +'modifiedAt' => '\DateTime', +'isTrial' => 'bool', +'outsideTrialProgress' => 'bool', +'trialCompleted' => 'bool', +'isMigrated' => 'bool', +'lineItemId' => 'string', +'lineItemNumber' => 'int', +'expiryDate' => '\DateTime', +'studentId' => 'string', +'buyerId' => 'string', +'orderId' => 'string', +'courseId' => 'string', +'productId' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -82,22 +81,22 @@ class CourseEnrollment implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'id' => null, - 'status' => null, - 'progress' => null, - 'createdAt' => 'date-time', - 'modifiedAt' => 'date-time', - 'isTrial' => null, - 'outsideTrialProgress' => null, - 'trialCompleted' => null, - 'lineItemId' => null, - 'lineItemNumber' => null, - 'expiryDate' => 'date-time', - 'studentId' => 'uuid', - 'buyerId' => 'uuid', - 'orderId' => 'uuid', - 'courseId' => 'uuid', - 'productId' => 'uuid' - ]; +'status' => null, +'progress' => null, +'createdAt' => 'date-time', +'modifiedAt' => 'date-time', +'isTrial' => null, +'outsideTrialProgress' => null, +'trialCompleted' => null, +'isMigrated' => null, +'lineItemId' => null, +'lineItemNumber' => null, +'expiryDate' => 'date-time', +'studentId' => 'uuid', +'buyerId' => 'uuid', +'orderId' => 'uuid', +'courseId' => 'uuid', +'productId' => 'uuid' ]; /** * Array of property to type mappings. Used for (de)serialization @@ -127,22 +126,22 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'id' => 'id', - 'status' => 'status', - 'progress' => 'progress', - 'createdAt' => 'createdAt', - 'modifiedAt' => 'modifiedAt', - 'isTrial' => 'isTrial', - 'outsideTrialProgress' => 'outsideTrialProgress', - 'trialCompleted' => 'trialCompleted', - 'lineItemId' => 'lineItemId', - 'lineItemNumber' => 'lineItemNumber', - 'expiryDate' => 'expiryDate', - 'studentId' => 'studentId', - 'buyerId' => 'buyerId', - 'orderId' => 'orderId', - 'courseId' => 'courseId', - 'productId' => 'productId' - ]; +'status' => 'status', +'progress' => 'progress', +'createdAt' => 'createdAt', +'modifiedAt' => 'modifiedAt', +'isTrial' => 'isTrial', +'outsideTrialProgress' => 'outsideTrialProgress', +'trialCompleted' => 'trialCompleted', +'isMigrated' => 'isMigrated', +'lineItemId' => 'lineItemId', +'lineItemNumber' => 'lineItemNumber', +'expiryDate' => 'expiryDate', +'studentId' => 'studentId', +'buyerId' => 'buyerId', +'orderId' => 'orderId', +'courseId' => 'courseId', +'productId' => 'productId' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -151,22 +150,22 @@ public static function swaggerFormats() */ protected static $setters = [ 'id' => 'setId', - 'status' => 'setStatus', - 'progress' => 'setProgress', - 'createdAt' => 'setCreatedAt', - 'modifiedAt' => 'setModifiedAt', - 'isTrial' => 'setIsTrial', - 'outsideTrialProgress' => 'setOutsideTrialProgress', - 'trialCompleted' => 'setTrialCompleted', - 'lineItemId' => 'setLineItemId', - 'lineItemNumber' => 'setLineItemNumber', - 'expiryDate' => 'setExpiryDate', - 'studentId' => 'setStudentId', - 'buyerId' => 'setBuyerId', - 'orderId' => 'setOrderId', - 'courseId' => 'setCourseId', - 'productId' => 'setProductId' - ]; +'status' => 'setStatus', +'progress' => 'setProgress', +'createdAt' => 'setCreatedAt', +'modifiedAt' => 'setModifiedAt', +'isTrial' => 'setIsTrial', +'outsideTrialProgress' => 'setOutsideTrialProgress', +'trialCompleted' => 'setTrialCompleted', +'isMigrated' => 'setIsMigrated', +'lineItemId' => 'setLineItemId', +'lineItemNumber' => 'setLineItemNumber', +'expiryDate' => 'setExpiryDate', +'studentId' => 'setStudentId', +'buyerId' => 'setBuyerId', +'orderId' => 'setOrderId', +'courseId' => 'setCourseId', +'productId' => 'setProductId' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -175,22 +174,22 @@ public static function swaggerFormats() */ protected static $getters = [ 'id' => 'getId', - 'status' => 'getStatus', - 'progress' => 'getProgress', - 'createdAt' => 'getCreatedAt', - 'modifiedAt' => 'getModifiedAt', - 'isTrial' => 'getIsTrial', - 'outsideTrialProgress' => 'getOutsideTrialProgress', - 'trialCompleted' => 'getTrialCompleted', - 'lineItemId' => 'getLineItemId', - 'lineItemNumber' => 'getLineItemNumber', - 'expiryDate' => 'getExpiryDate', - 'studentId' => 'getStudentId', - 'buyerId' => 'getBuyerId', - 'orderId' => 'getOrderId', - 'courseId' => 'getCourseId', - 'productId' => 'getProductId' - ]; +'status' => 'getStatus', +'progress' => 'getProgress', +'createdAt' => 'getCreatedAt', +'modifiedAt' => 'getModifiedAt', +'isTrial' => 'getIsTrial', +'outsideTrialProgress' => 'getOutsideTrialProgress', +'trialCompleted' => 'getTrialCompleted', +'isMigrated' => 'getIsMigrated', +'lineItemId' => 'getLineItemId', +'lineItemNumber' => 'getLineItemNumber', +'expiryDate' => 'getExpiryDate', +'studentId' => 'getStudentId', +'buyerId' => 'getBuyerId', +'orderId' => 'getOrderId', +'courseId' => 'getCourseId', +'productId' => 'getProductId' ]; /** * Array of attributes where the key is the local name, @@ -235,8 +234,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -260,6 +257,7 @@ public function __construct(array $data = null) $this->container['isTrial'] = isset($data['isTrial']) ? $data['isTrial'] : null; $this->container['outsideTrialProgress'] = isset($data['outsideTrialProgress']) ? $data['outsideTrialProgress'] : null; $this->container['trialCompleted'] = isset($data['trialCompleted']) ? $data['trialCompleted'] : null; + $this->container['isMigrated'] = isset($data['isMigrated']) ? $data['isMigrated'] : null; $this->container['lineItemId'] = isset($data['lineItemId']) ? $data['lineItemId'] : null; $this->container['lineItemNumber'] = isset($data['lineItemNumber']) ? $data['lineItemNumber'] : null; $this->container['expiryDate'] = isset($data['expiryDate']) ? $data['expiryDate'] : null; @@ -303,6 +301,9 @@ public function listInvalidProperties() if ($this->container['trialCompleted'] === null) { $invalidProperties[] = "'trialCompleted' can't be null"; } + if ($this->container['isMigrated'] === null) { + $invalidProperties[] = "'isMigrated' can't be null"; + } if ($this->container['lineItemId'] === null) { $invalidProperties[] = "'lineItemId' can't be null"; } @@ -393,7 +394,7 @@ public function setStatus($status) /** * Gets progress * - * @return float + * @return int */ public function getProgress() { @@ -403,7 +404,7 @@ public function getProgress() /** * Sets progress * - * @param float $progress progress + * @param int $progress progress * * @return $this */ @@ -534,6 +535,30 @@ public function setTrialCompleted($trialCompleted) return $this; } + /** + * Gets isMigrated + * + * @return bool + */ + public function getIsMigrated() + { + return $this->container['isMigrated']; + } + + /** + * Sets isMigrated + * + * @param bool $isMigrated isMigrated + * + * @return $this + */ + public function setIsMigrated($isMigrated) + { + $this->container['isMigrated'] = $isMigrated; + + return $this; + } + /** * Gets lineItemId * @@ -795,5 +820,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/CourseEnrollmentFromAcademyDto.php b/src/Model/CourseEnrollmentFromAcademyDto.php index b4e9b43..1b0febb 100644 --- a/src/Model/CourseEnrollmentFromAcademyDto.php +++ b/src/Model/CourseEnrollmentFromAcademyDto.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -57,8 +56,7 @@ class CourseEnrollmentFromAcademyDto implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerTypes = [ - 'progressData' => '\Yoast\MyYoastApiClient\Model\ProgressData' - ]; + 'progressData' => '\Yoast\MyYoastApiClient\Model\ProgressData' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -66,8 +64,7 @@ class CourseEnrollmentFromAcademyDto implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerFormats = [ - 'progressData' => null - ]; + 'progressData' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -96,8 +93,7 @@ public static function swaggerFormats() * @var string[] */ protected static $attributeMap = [ - 'progressData' => 'progressData' - ]; + 'progressData' => 'progressData' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -105,8 +101,7 @@ public static function swaggerFormats() * @var string[] */ protected static $setters = [ - 'progressData' => 'setProgressData' - ]; + 'progressData' => 'setProgressData' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -114,8 +109,7 @@ public static function swaggerFormats() * @var string[] */ protected static $getters = [ - 'progressData' => 'getProgressData' - ]; + 'progressData' => 'getProgressData' ]; /** * Array of attributes where the key is the local name, @@ -160,8 +154,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -300,5 +292,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/CreateBlacklistSiteDto.php b/src/Model/CreateBlacklistSiteDto.php index 13fd36f..9b2a2ab 100644 --- a/src/Model/CreateBlacklistSiteDto.php +++ b/src/Model/CreateBlacklistSiteDto.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -57,8 +56,7 @@ class CreateBlacklistSiteDto implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerTypes = [ - - ]; + ]; /** * Array of property to format mappings. Used for (de)serialization @@ -66,8 +64,7 @@ class CreateBlacklistSiteDto implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerFormats = [ - - ]; + ]; /** * Array of property to type mappings. Used for (de)serialization @@ -96,8 +93,7 @@ public static function swaggerFormats() * @var string[] */ protected static $attributeMap = [ - - ]; + ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -105,8 +101,7 @@ public static function swaggerFormats() * @var string[] */ protected static $setters = [ - - ]; + ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -114,8 +109,7 @@ public static function swaggerFormats() * @var string[] */ protected static $getters = [ - - ]; + ]; /** * Array of attributes where the key is the local name, @@ -160,8 +154,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -272,5 +264,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/CreateCustomerNoteDto.php b/src/Model/CreateCustomerNoteDto.php index 33dcbe8..b0cc800 100644 --- a/src/Model/CreateCustomerNoteDto.php +++ b/src/Model/CreateCustomerNoteDto.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,10 +57,9 @@ class CreateCustomerNoteDto implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'customerId' => 'string', - 'authorId' => 'string', - 'content' => 'string', - 'nextContactDate' => '\DateTime' - ]; +'authorId' => 'string', +'content' => 'string', +'nextContactDate' => '\DateTime' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -70,10 +68,9 @@ class CreateCustomerNoteDto implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'customerId' => null, - 'authorId' => null, - 'content' => null, - 'nextContactDate' => 'date-time' - ]; +'authorId' => null, +'content' => null, +'nextContactDate' => 'date-time' ]; /** * Array of property to type mappings. Used for (de)serialization @@ -103,10 +100,9 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'customerId' => 'customerId', - 'authorId' => 'authorId', - 'content' => 'content', - 'nextContactDate' => 'nextContactDate' - ]; +'authorId' => 'authorId', +'content' => 'content', +'nextContactDate' => 'nextContactDate' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -115,10 +111,9 @@ public static function swaggerFormats() */ protected static $setters = [ 'customerId' => 'setCustomerId', - 'authorId' => 'setAuthorId', - 'content' => 'setContent', - 'nextContactDate' => 'setNextContactDate' - ]; +'authorId' => 'setAuthorId', +'content' => 'setContent', +'nextContactDate' => 'setNextContactDate' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -127,10 +122,9 @@ public static function swaggerFormats() */ protected static $getters = [ 'customerId' => 'getCustomerId', - 'authorId' => 'getAuthorId', - 'content' => 'getContent', - 'nextContactDate' => 'getNextContactDate' - ]; +'authorId' => 'getAuthorId', +'content' => 'getContent', +'nextContactDate' => 'getNextContactDate' ]; /** * Array of attributes where the key is the local name, @@ -175,8 +169,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -216,9 +208,6 @@ public function listInvalidProperties() if ($this->container['content'] === null) { $invalidProperties[] = "'content' can't be null"; } - if ($this->container['nextContactDate'] === null) { - $invalidProperties[] = "'nextContactDate' can't be null"; - } return $invalidProperties; } @@ -399,5 +388,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/CreateDto.php b/src/Model/CreateDto.php new file mode 100644 index 0000000..20ddee5 --- /dev/null +++ b/src/Model/CreateDto.php @@ -0,0 +1,324 @@ + 'string', +'subscriptionId' => 'string' ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'email' => null, +'subscriptionId' => 'uuid' ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'email' => 'email', +'subscriptionId' => 'subscriptionId' ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'email' => 'setEmail', +'subscriptionId' => 'setSubscriptionId' ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'email' => 'getEmail', +'subscriptionId' => 'getSubscriptionId' ]; + + /** + * 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::$swaggerModelName; + } + + + + /** + * 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->container['email'] = isset($data['email']) ? $data['email'] : null; + $this->container['subscriptionId'] = isset($data['subscriptionId']) ? $data['subscriptionId'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['email'] === null) { + $invalidProperties[] = "'email' 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 email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email email + * + * @return $this + */ + public function setEmail($email) + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets subscriptionId + * + * @return string + */ + public function getSubscriptionId() + { + return $this->container['subscriptionId']; + } + + /** + * Sets subscriptionId + * + * @param string $subscriptionId subscriptionId + * + * @return $this + */ + public function setSubscriptionId($subscriptionId) + { + $this->container['subscriptionId'] = $subscriptionId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} diff --git a/src/Model/CreateProvisionedSubscriptionDto.php b/src/Model/CreateProvisionedSubscriptionDto.php new file mode 100644 index 0000000..8bc99b5 --- /dev/null +++ b/src/Model/CreateProvisionedSubscriptionDto.php @@ -0,0 +1,426 @@ + 'string', +'productCode' => 'string', +'site' => 'string', +'firstName' => 'string', +'lastName' => 'string' ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'customerEmail' => null, +'productCode' => null, +'site' => null, +'firstName' => null, +'lastName' => null ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'customerEmail' => 'customerEmail', +'productCode' => 'productCode', +'site' => 'site', +'firstName' => 'firstName', +'lastName' => 'lastName' ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'customerEmail' => 'setCustomerEmail', +'productCode' => 'setProductCode', +'site' => 'setSite', +'firstName' => 'setFirstName', +'lastName' => 'setLastName' ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'customerEmail' => 'getCustomerEmail', +'productCode' => 'getProductCode', +'site' => 'getSite', +'firstName' => 'getFirstName', +'lastName' => 'getLastName' ]; + + /** + * 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::$swaggerModelName; + } + + + + /** + * 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->container['customerEmail'] = isset($data['customerEmail']) ? $data['customerEmail'] : null; + $this->container['productCode'] = isset($data['productCode']) ? $data['productCode'] : null; + $this->container['site'] = isset($data['site']) ? $data['site'] : null; + $this->container['firstName'] = isset($data['firstName']) ? $data['firstName'] : null; + $this->container['lastName'] = isset($data['lastName']) ? $data['lastName'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['customerEmail'] === null) { + $invalidProperties[] = "'customerEmail' can't be null"; + } + if ($this->container['productCode'] === null) { + $invalidProperties[] = "'productCode' can't be null"; + } + if ($this->container['site'] === null) { + $invalidProperties[] = "'site' can't be null"; + } + if ($this->container['firstName'] === null) { + $invalidProperties[] = "'firstName' can't be null"; + } + if ($this->container['lastName'] === null) { + $invalidProperties[] = "'lastName' 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 customerEmail + * + * @return string + */ + public function getCustomerEmail() + { + return $this->container['customerEmail']; + } + + /** + * Sets customerEmail + * + * @param string $customerEmail The email address of the customer. + * + * @return $this + */ + public function setCustomerEmail($customerEmail) + { + $this->container['customerEmail'] = $customerEmail; + + return $this; + } + + /** + * Gets productCode + * + * @return string + */ + public function getProductCode() + { + return $this->container['productCode']; + } + + /** + * Sets productCode + * + * @param string $productCode The product-code of the product the subscription is for. + * + * @return $this + */ + public function setProductCode($productCode) + { + $this->container['productCode'] = $productCode; + + return $this; + } + + /** + * Gets site + * + * @return string + */ + public function getSite() + { + return $this->container['site']; + } + + /** + * Sets site + * + * @param string $site The site URL that the subscription needs to be connectd to. + * + * @return $this + */ + public function setSite($site) + { + $this->container['site'] = $site; + + return $this; + } + + /** + * Gets firstName + * + * @return string + */ + public function getFirstName() + { + return $this->container['firstName']; + } + + /** + * Sets firstName + * + * @param string $firstName The first name of the customer. + * + * @return $this + */ + public function setFirstName($firstName) + { + $this->container['firstName'] = $firstName; + + return $this; + } + + /** + * Gets lastName + * + * @return string + */ + public function getLastName() + { + return $this->container['lastName']; + } + + /** + * Sets lastName + * + * @param string $lastName The last name of the customers. + * + * @return $this + */ + public function setLastName($lastName) + { + $this->container['lastName'] = $lastName; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} diff --git a/src/Model/CreateSiteBodyDto.php b/src/Model/CreateSiteBodyDto.php index b1dabd4..09a559e 100644 --- a/src/Model/CreateSiteBodyDto.php +++ b/src/Model/CreateSiteBodyDto.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,8 +57,7 @@ class CreateSiteBodyDto implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'url' => 'string', - 'type' => 'string' - ]; +'type' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -68,8 +66,7 @@ class CreateSiteBodyDto implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'url' => 'url', - 'type' => null - ]; +'type' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -99,8 +96,7 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'url' => 'url', - 'type' => 'type' - ]; +'type' => 'type' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -109,8 +105,7 @@ public static function swaggerFormats() */ protected static $setters = [ 'url' => 'setUrl', - 'type' => 'setType' - ]; +'type' => 'setType' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -119,8 +114,7 @@ public static function swaggerFormats() */ protected static $getters = [ 'url' => 'getUrl', - 'type' => 'getType' - ]; +'type' => 'getType' ]; /** * Array of attributes where the key is the local name, @@ -164,10 +158,8 @@ public function getModelName() } const TYPE_WORDPRESS = 'wordpress'; - const TYPE_TYPO3 = 'typo3'; - +const TYPE_TYPO3 = 'typo3'; - /** * Gets allowable values of the enum * @@ -177,10 +169,8 @@ public function getTypeAllowableValues() { return [ self::TYPE_WORDPRESS, - self::TYPE_TYPO3, - ]; +self::TYPE_TYPO3, ]; } - /** * Associative array for storing property values @@ -365,5 +355,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/Customer.php b/src/Model/Customer.php index b9953f4..c5b1159 100644 --- a/src/Model/Customer.php +++ b/src/Model/Customer.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,28 +57,27 @@ class Customer implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'id' => 'string', - 'sourceId' => 'int', - 'enabled' => 'bool', - 'realm' => 'string', - 'username' => 'string', - 'email' => 'string', - 'emailVerified' => 'bool', - 'verificationToken' => 'string', - 'createdAt' => '\DateTime', - 'modifiedAt' => '\DateTime', - 'userEmail' => 'string', - 'userFirstName' => 'string', - 'userLastName' => 'string', - 'userCompany' => 'string', - 'userAddress1' => 'string', - 'userAddress2' => 'string', - 'userCity' => 'string', - 'userState' => 'string', - 'userPostCode' => 'string', - 'userCountry' => 'string', - 'userPhone' => 'string', - 'userAvatarUrl' => 'string' - ]; +'sourceId' => 'int', +'enabled' => 'bool', +'realm' => 'string', +'username' => 'string', +'email' => 'string', +'emailVerified' => 'bool', +'verificationToken' => 'string', +'createdAt' => '\DateTime', +'modifiedAt' => '\DateTime', +'userEmail' => 'string', +'userFirstName' => 'string', +'userLastName' => 'string', +'userCompany' => 'string', +'userAddress1' => 'string', +'userAddress2' => 'string', +'userCity' => 'string', +'userState' => 'string', +'userPostCode' => 'string', +'userCountry' => 'string', +'userPhone' => 'string', +'userAvatarUrl' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -88,28 +86,27 @@ class Customer implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'id' => null, - 'sourceId' => null, - 'enabled' => null, - 'realm' => null, - 'username' => null, - 'email' => null, - 'emailVerified' => null, - 'verificationToken' => null, - 'createdAt' => 'date-time', - 'modifiedAt' => 'date-time', - 'userEmail' => null, - 'userFirstName' => null, - 'userLastName' => null, - 'userCompany' => null, - 'userAddress1' => null, - 'userAddress2' => null, - 'userCity' => null, - 'userState' => null, - 'userPostCode' => null, - 'userCountry' => null, - 'userPhone' => null, - 'userAvatarUrl' => null - ]; +'sourceId' => null, +'enabled' => null, +'realm' => null, +'username' => null, +'email' => null, +'emailVerified' => null, +'verificationToken' => null, +'createdAt' => 'date-time', +'modifiedAt' => 'date-time', +'userEmail' => null, +'userFirstName' => null, +'userLastName' => null, +'userCompany' => null, +'userAddress1' => null, +'userAddress2' => null, +'userCity' => null, +'userState' => null, +'userPostCode' => null, +'userCountry' => null, +'userPhone' => null, +'userAvatarUrl' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -139,28 +136,27 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'id' => 'id', - 'sourceId' => 'sourceId', - 'enabled' => 'enabled', - 'realm' => 'realm', - 'username' => 'username', - 'email' => 'email', - 'emailVerified' => 'emailVerified', - 'verificationToken' => 'verificationToken', - 'createdAt' => 'createdAt', - 'modifiedAt' => 'modifiedAt', - 'userEmail' => 'userEmail', - 'userFirstName' => 'userFirstName', - 'userLastName' => 'userLastName', - 'userCompany' => 'userCompany', - 'userAddress1' => 'userAddress1', - 'userAddress2' => 'userAddress2', - 'userCity' => 'userCity', - 'userState' => 'userState', - 'userPostCode' => 'userPostCode', - 'userCountry' => 'userCountry', - 'userPhone' => 'userPhone', - 'userAvatarUrl' => 'userAvatarUrl' - ]; +'sourceId' => 'sourceId', +'enabled' => 'enabled', +'realm' => 'realm', +'username' => 'username', +'email' => 'email', +'emailVerified' => 'emailVerified', +'verificationToken' => 'verificationToken', +'createdAt' => 'createdAt', +'modifiedAt' => 'modifiedAt', +'userEmail' => 'userEmail', +'userFirstName' => 'userFirstName', +'userLastName' => 'userLastName', +'userCompany' => 'userCompany', +'userAddress1' => 'userAddress1', +'userAddress2' => 'userAddress2', +'userCity' => 'userCity', +'userState' => 'userState', +'userPostCode' => 'userPostCode', +'userCountry' => 'userCountry', +'userPhone' => 'userPhone', +'userAvatarUrl' => 'userAvatarUrl' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -169,28 +165,27 @@ public static function swaggerFormats() */ protected static $setters = [ 'id' => 'setId', - 'sourceId' => 'setSourceId', - 'enabled' => 'setEnabled', - 'realm' => 'setRealm', - 'username' => 'setUsername', - 'email' => 'setEmail', - 'emailVerified' => 'setEmailVerified', - 'verificationToken' => 'setVerificationToken', - 'createdAt' => 'setCreatedAt', - 'modifiedAt' => 'setModifiedAt', - 'userEmail' => 'setUserEmail', - 'userFirstName' => 'setUserFirstName', - 'userLastName' => 'setUserLastName', - 'userCompany' => 'setUserCompany', - 'userAddress1' => 'setUserAddress1', - 'userAddress2' => 'setUserAddress2', - 'userCity' => 'setUserCity', - 'userState' => 'setUserState', - 'userPostCode' => 'setUserPostCode', - 'userCountry' => 'setUserCountry', - 'userPhone' => 'setUserPhone', - 'userAvatarUrl' => 'setUserAvatarUrl' - ]; +'sourceId' => 'setSourceId', +'enabled' => 'setEnabled', +'realm' => 'setRealm', +'username' => 'setUsername', +'email' => 'setEmail', +'emailVerified' => 'setEmailVerified', +'verificationToken' => 'setVerificationToken', +'createdAt' => 'setCreatedAt', +'modifiedAt' => 'setModifiedAt', +'userEmail' => 'setUserEmail', +'userFirstName' => 'setUserFirstName', +'userLastName' => 'setUserLastName', +'userCompany' => 'setUserCompany', +'userAddress1' => 'setUserAddress1', +'userAddress2' => 'setUserAddress2', +'userCity' => 'setUserCity', +'userState' => 'setUserState', +'userPostCode' => 'setUserPostCode', +'userCountry' => 'setUserCountry', +'userPhone' => 'setUserPhone', +'userAvatarUrl' => 'setUserAvatarUrl' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -199,28 +194,27 @@ public static function swaggerFormats() */ protected static $getters = [ 'id' => 'getId', - 'sourceId' => 'getSourceId', - 'enabled' => 'getEnabled', - 'realm' => 'getRealm', - 'username' => 'getUsername', - 'email' => 'getEmail', - 'emailVerified' => 'getEmailVerified', - 'verificationToken' => 'getVerificationToken', - 'createdAt' => 'getCreatedAt', - 'modifiedAt' => 'getModifiedAt', - 'userEmail' => 'getUserEmail', - 'userFirstName' => 'getUserFirstName', - 'userLastName' => 'getUserLastName', - 'userCompany' => 'getUserCompany', - 'userAddress1' => 'getUserAddress1', - 'userAddress2' => 'getUserAddress2', - 'userCity' => 'getUserCity', - 'userState' => 'getUserState', - 'userPostCode' => 'getUserPostCode', - 'userCountry' => 'getUserCountry', - 'userPhone' => 'getUserPhone', - 'userAvatarUrl' => 'getUserAvatarUrl' - ]; +'sourceId' => 'getSourceId', +'enabled' => 'getEnabled', +'realm' => 'getRealm', +'username' => 'getUsername', +'email' => 'getEmail', +'emailVerified' => 'getEmailVerified', +'verificationToken' => 'getVerificationToken', +'createdAt' => 'getCreatedAt', +'modifiedAt' => 'getModifiedAt', +'userEmail' => 'getUserEmail', +'userFirstName' => 'getUserFirstName', +'userLastName' => 'getUserLastName', +'userCompany' => 'getUserCompany', +'userAddress1' => 'getUserAddress1', +'userAddress2' => 'getUserAddress2', +'userCity' => 'getUserCity', +'userState' => 'getUserState', +'userPostCode' => 'getUserPostCode', +'userCountry' => 'getUserCountry', +'userPhone' => 'getUserPhone', +'userAvatarUrl' => 'getUserAvatarUrl' ]; /** * Array of attributes where the key is the local name, @@ -265,8 +259,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -993,5 +985,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/CustomerData.php b/src/Model/CustomerData.php index de20b81..a061be4 100644 --- a/src/Model/CustomerData.php +++ b/src/Model/CustomerData.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,21 +57,20 @@ class CustomerData implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'id' => 'int', - 'avatarUrl' => 'string', - 'billing' => '\Yoast\MyYoastApiClient\Model\BillingDto', - 'dateCreated' => '\DateTime', - 'dateCreatedGmt' => '\DateTime', - 'dateModified' => '\DateTime', - 'dateModifiedGmt' => '\DateTime', - 'email' => 'string', - 'firstName' => 'string', - 'lastName' => 'string', - 'isPayingCustomer' => 'bool', - 'metaData' => '\Yoast\MyYoastApiClient\Model\MetaDataDto[]', - 'role' => 'string', - 'shipping' => '\Yoast\MyYoastApiClient\Model\ShippingDto', - 'username' => 'string' - ]; +'avatarUrl' => 'string', +'billing' => '\Yoast\MyYoastApiClient\Model\BillingDto', +'dateCreated' => '\DateTime', +'dateCreatedGmt' => '\DateTime', +'dateModified' => '\DateTime', +'dateModifiedGmt' => '\DateTime', +'email' => 'string', +'firstName' => 'string', +'lastName' => 'string', +'isPayingCustomer' => 'bool', +'metaData' => '\Yoast\MyYoastApiClient\Model\MetaDataDto[]', +'role' => 'string', +'shipping' => '\Yoast\MyYoastApiClient\Model\ShippingDto', +'username' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -81,21 +79,20 @@ class CustomerData implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'id' => null, - 'avatarUrl' => null, - 'billing' => null, - 'dateCreated' => 'date-time', - 'dateCreatedGmt' => 'date-time', - 'dateModified' => 'date-time', - 'dateModifiedGmt' => 'date-time', - 'email' => 'email', - 'firstName' => null, - 'lastName' => null, - 'isPayingCustomer' => null, - 'metaData' => null, - 'role' => null, - 'shipping' => null, - 'username' => null - ]; +'avatarUrl' => null, +'billing' => null, +'dateCreated' => 'date-time', +'dateCreatedGmt' => 'date-time', +'dateModified' => 'date-time', +'dateModifiedGmt' => 'date-time', +'email' => 'email', +'firstName' => null, +'lastName' => null, +'isPayingCustomer' => null, +'metaData' => null, +'role' => null, +'shipping' => null, +'username' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -125,21 +122,20 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'id' => 'id', - 'avatarUrl' => 'avatar_url', - 'billing' => 'billing', - 'dateCreated' => 'date_created', - 'dateCreatedGmt' => 'date_created_gmt', - 'dateModified' => 'date_modified', - 'dateModifiedGmt' => 'date_modified_gmt', - 'email' => 'email', - 'firstName' => 'first_name', - 'lastName' => 'last_name', - 'isPayingCustomer' => 'is_paying_customer', - 'metaData' => 'meta_data', - 'role' => 'role', - 'shipping' => 'shipping', - 'username' => 'username' - ]; +'avatarUrl' => 'avatar_url', +'billing' => 'billing', +'dateCreated' => 'date_created', +'dateCreatedGmt' => 'date_created_gmt', +'dateModified' => 'date_modified', +'dateModifiedGmt' => 'date_modified_gmt', +'email' => 'email', +'firstName' => 'first_name', +'lastName' => 'last_name', +'isPayingCustomer' => 'is_paying_customer', +'metaData' => 'meta_data', +'role' => 'role', +'shipping' => 'shipping', +'username' => 'username' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -148,21 +144,20 @@ public static function swaggerFormats() */ protected static $setters = [ 'id' => 'setId', - 'avatarUrl' => 'setAvatarUrl', - 'billing' => 'setBilling', - 'dateCreated' => 'setDateCreated', - 'dateCreatedGmt' => 'setDateCreatedGmt', - 'dateModified' => 'setDateModified', - 'dateModifiedGmt' => 'setDateModifiedGmt', - 'email' => 'setEmail', - 'firstName' => 'setFirstName', - 'lastName' => 'setLastName', - 'isPayingCustomer' => 'setIsPayingCustomer', - 'metaData' => 'setMetaData', - 'role' => 'setRole', - 'shipping' => 'setShipping', - 'username' => 'setUsername' - ]; +'avatarUrl' => 'setAvatarUrl', +'billing' => 'setBilling', +'dateCreated' => 'setDateCreated', +'dateCreatedGmt' => 'setDateCreatedGmt', +'dateModified' => 'setDateModified', +'dateModifiedGmt' => 'setDateModifiedGmt', +'email' => 'setEmail', +'firstName' => 'setFirstName', +'lastName' => 'setLastName', +'isPayingCustomer' => 'setIsPayingCustomer', +'metaData' => 'setMetaData', +'role' => 'setRole', +'shipping' => 'setShipping', +'username' => 'setUsername' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -171,21 +166,20 @@ public static function swaggerFormats() */ protected static $getters = [ 'id' => 'getId', - 'avatarUrl' => 'getAvatarUrl', - 'billing' => 'getBilling', - 'dateCreated' => 'getDateCreated', - 'dateCreatedGmt' => 'getDateCreatedGmt', - 'dateModified' => 'getDateModified', - 'dateModifiedGmt' => 'getDateModifiedGmt', - 'email' => 'getEmail', - 'firstName' => 'getFirstName', - 'lastName' => 'getLastName', - 'isPayingCustomer' => 'getIsPayingCustomer', - 'metaData' => 'getMetaData', - 'role' => 'getRole', - 'shipping' => 'getShipping', - 'username' => 'getUsername' - ]; +'avatarUrl' => 'getAvatarUrl', +'billing' => 'getBilling', +'dateCreated' => 'getDateCreated', +'dateCreatedGmt' => 'getDateCreatedGmt', +'dateModified' => 'getDateModified', +'dateModifiedGmt' => 'getDateModifiedGmt', +'email' => 'getEmail', +'firstName' => 'getFirstName', +'lastName' => 'getLastName', +'isPayingCustomer' => 'getIsPayingCustomer', +'metaData' => 'getMetaData', +'role' => 'getRole', +'shipping' => 'getShipping', +'username' => 'getUsername' ]; /** * Array of attributes where the key is the local name, @@ -230,8 +224,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -753,5 +745,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/CustomerDto.php b/src/Model/CustomerDto.php index 8d82188..5279978 100644 --- a/src/Model/CustomerDto.php +++ b/src/Model/CustomerDto.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -57,12 +56,11 @@ class CustomerDto implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerTypes = [ - 'id' => 'float', - 'fname' => 'string', - 'lname' => 'string', - 'email' => 'string', - 'emails' => 'string[]' - ]; + 'id' => 'int', +'fname' => 'string', +'lname' => 'string', +'email' => 'string', +'emails' => 'string[]' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -71,11 +69,10 @@ class CustomerDto implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'id' => null, - 'fname' => null, - 'lname' => null, - 'email' => null, - 'emails' => null - ]; +'fname' => null, +'lname' => null, +'email' => null, +'emails' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -105,11 +102,10 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'id' => 'id', - 'fname' => 'fname', - 'lname' => 'lname', - 'email' => 'email', - 'emails' => 'emails' - ]; +'fname' => 'fname', +'lname' => 'lname', +'email' => 'email', +'emails' => 'emails' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -118,11 +114,10 @@ public static function swaggerFormats() */ protected static $setters = [ 'id' => 'setId', - 'fname' => 'setFname', - 'lname' => 'setLname', - 'email' => 'setEmail', - 'emails' => 'setEmails' - ]; +'fname' => 'setFname', +'lname' => 'setLname', +'email' => 'setEmail', +'emails' => 'setEmails' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -131,11 +126,10 @@ public static function swaggerFormats() */ protected static $getters = [ 'id' => 'getId', - 'fname' => 'getFname', - 'lname' => 'getLname', - 'email' => 'getEmail', - 'emails' => 'getEmails' - ]; +'fname' => 'getFname', +'lname' => 'getLname', +'email' => 'getEmail', +'emails' => 'getEmails' ]; /** * Array of attributes where the key is the local name, @@ -180,8 +174,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -246,7 +238,7 @@ public function valid() /** * Gets id * - * @return float + * @return int */ public function getId() { @@ -256,7 +248,7 @@ public function getId() /** * Sets id * - * @param float $id id + * @param int $id id * * @return $this */ @@ -432,5 +424,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/CustomerFromWooDto.php b/src/Model/CustomerFromWooDto.php index b97c08e..34844a8 100644 --- a/src/Model/CustomerFromWooDto.php +++ b/src/Model/CustomerFromWooDto.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -57,8 +56,7 @@ class CustomerFromWooDto implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerTypes = [ - 'customerData' => '\Yoast\MyYoastApiClient\Model\CustomerData' - ]; + 'customerData' => '\Yoast\MyYoastApiClient\Model\CustomerData' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -66,8 +64,7 @@ class CustomerFromWooDto implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerFormats = [ - 'customerData' => null - ]; + 'customerData' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -96,8 +93,7 @@ public static function swaggerFormats() * @var string[] */ protected static $attributeMap = [ - 'customerData' => 'customerData' - ]; + 'customerData' => 'customerData' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -105,8 +101,7 @@ public static function swaggerFormats() * @var string[] */ protected static $setters = [ - 'customerData' => 'setCustomerData' - ]; + 'customerData' => 'setCustomerData' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -114,8 +109,7 @@ public static function swaggerFormats() * @var string[] */ protected static $getters = [ - 'customerData' => 'getCustomerData' - ]; + 'customerData' => 'getCustomerData' ]; /** * Array of attributes where the key is the local name, @@ -160,8 +154,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -300,5 +292,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/CustomerNote.php b/src/Model/CustomerNote.php index c9b9fed..a96db51 100644 --- a/src/Model/CustomerNote.php +++ b/src/Model/CustomerNote.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,13 +57,12 @@ class CustomerNote implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'id' => 'string', - 'updatedAt' => '\DateTime', - 'createdAt' => '\DateTime', - 'content' => 'string', - 'nextContactDate' => '\DateTime', - 'customerId' => 'string', - 'authorId' => 'string' - ]; +'updatedAt' => '\DateTime', +'createdAt' => '\DateTime', +'content' => 'string', +'nextContactDate' => '\DateTime', +'customerId' => 'string', +'authorId' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -72,14 +70,13 @@ class CustomerNote implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerFormats = [ - 'id' => null, - 'updatedAt' => 'date-time', - 'createdAt' => 'date-time', - 'content' => null, - 'nextContactDate' => 'date-time', - 'customerId' => 'uuid', - 'authorId' => 'uuid' - ]; + 'id' => 'uuid', +'updatedAt' => 'date-time', +'createdAt' => 'date-time', +'content' => null, +'nextContactDate' => 'date-time', +'customerId' => 'uuid', +'authorId' => 'uuid' ]; /** * Array of property to type mappings. Used for (de)serialization @@ -109,13 +106,12 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'id' => 'id', - 'updatedAt' => 'updatedAt', - 'createdAt' => 'createdAt', - 'content' => 'content', - 'nextContactDate' => 'nextContactDate', - 'customerId' => 'customerId', - 'authorId' => 'authorId' - ]; +'updatedAt' => 'updatedAt', +'createdAt' => 'createdAt', +'content' => 'content', +'nextContactDate' => 'nextContactDate', +'customerId' => 'customerId', +'authorId' => 'authorId' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -124,13 +120,12 @@ public static function swaggerFormats() */ protected static $setters = [ 'id' => 'setId', - 'updatedAt' => 'setUpdatedAt', - 'createdAt' => 'setCreatedAt', - 'content' => 'setContent', - 'nextContactDate' => 'setNextContactDate', - 'customerId' => 'setCustomerId', - 'authorId' => 'setAuthorId' - ]; +'updatedAt' => 'setUpdatedAt', +'createdAt' => 'setCreatedAt', +'content' => 'setContent', +'nextContactDate' => 'setNextContactDate', +'customerId' => 'setCustomerId', +'authorId' => 'setAuthorId' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -139,13 +134,12 @@ public static function swaggerFormats() */ protected static $getters = [ 'id' => 'getId', - 'updatedAt' => 'getUpdatedAt', - 'createdAt' => 'getCreatedAt', - 'content' => 'getContent', - 'nextContactDate' => 'getNextContactDate', - 'customerId' => 'getCustomerId', - 'authorId' => 'getAuthorId' - ]; +'updatedAt' => 'getUpdatedAt', +'createdAt' => 'getCreatedAt', +'content' => 'getContent', +'nextContactDate' => 'getNextContactDate', +'customerId' => 'getCustomerId', +'authorId' => 'getAuthorId' ]; /** * Array of attributes where the key is the local name, @@ -190,8 +184,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -498,5 +490,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/DeleteResult.php b/src/Model/DeleteResult.php new file mode 100644 index 0000000..24fd76b --- /dev/null +++ b/src/Model/DeleteResult.php @@ -0,0 +1,266 @@ +listInvalidProperties()) === 0; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} diff --git a/src/Model/EddDTO.php b/src/Model/EddDTO.php index a5c293e..2145909 100644 --- a/src/Model/EddDTO.php +++ b/src/Model/EddDTO.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,9 +57,8 @@ class EddDTO implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'eddAction' => 'string', - 'url' => 'string', - 'itemName' => 'string' - ]; +'url' => 'string', +'itemName' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -69,9 +67,8 @@ class EddDTO implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'eddAction' => null, - 'url' => null, - 'itemName' => null - ]; +'url' => null, +'itemName' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -101,9 +98,8 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'eddAction' => 'edd_action', - 'url' => 'url', - 'itemName' => 'item_name' - ]; +'url' => 'url', +'itemName' => 'item_name' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -112,9 +108,8 @@ public static function swaggerFormats() */ protected static $setters = [ 'eddAction' => 'setEddAction', - 'url' => 'setUrl', - 'itemName' => 'setItemName' - ]; +'url' => 'setUrl', +'itemName' => 'setItemName' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -123,9 +118,8 @@ public static function swaggerFormats() */ protected static $getters = [ 'eddAction' => 'getEddAction', - 'url' => 'getUrl', - 'itemName' => 'getItemName' - ]; +'url' => 'getUrl', +'itemName' => 'getItemName' ]; /** * Array of attributes where the key is the local name, @@ -170,8 +164,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -366,5 +358,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/ExtraCourseDataDto.php b/src/Model/ExtraCourseDataDto.php index 42096e1..9493f2e 100644 --- a/src/Model/ExtraCourseDataDto.php +++ b/src/Model/ExtraCourseDataDto.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,16 +57,15 @@ class ExtraCourseDataDto implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'overviewSnippet' => 'string', - 'permalink' => 'string', - 'certificateUrl' => 'string', - 'iconUrl' => 'string', - 'complimentary' => 'bool', - 'open' => 'bool', - 'hasTrial' => 'bool', - 'deprecated' => 'bool', - 'sale' => 'bool', - 'saleLabel' => 'string' - ]; +'permalink' => 'string', +'certificateUrl' => 'string', +'iconUrl' => 'string', +'complimentary' => 'bool', +'open' => 'bool', +'hasTrial' => 'bool', +'deprecated' => 'bool', +'sale' => 'bool', +'saleLabel' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -76,16 +74,15 @@ class ExtraCourseDataDto implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'overviewSnippet' => null, - 'permalink' => null, - 'certificateUrl' => 'uri', - 'iconUrl' => 'uri', - 'complimentary' => null, - 'open' => null, - 'hasTrial' => null, - 'deprecated' => null, - 'sale' => null, - 'saleLabel' => null - ]; +'permalink' => null, +'certificateUrl' => 'uri', +'iconUrl' => 'uri', +'complimentary' => null, +'open' => null, +'hasTrial' => null, +'deprecated' => null, +'sale' => null, +'saleLabel' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -115,16 +112,15 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'overviewSnippet' => 'overview_snippet', - 'permalink' => 'permalink', - 'certificateUrl' => 'certificate_url', - 'iconUrl' => 'icon_url', - 'complimentary' => 'complimentary', - 'open' => 'open', - 'hasTrial' => 'hasTrial', - 'deprecated' => 'deprecated', - 'sale' => 'sale', - 'saleLabel' => 'sale_label' - ]; +'permalink' => 'permalink', +'certificateUrl' => 'certificate_url', +'iconUrl' => 'icon_url', +'complimentary' => 'complimentary', +'open' => 'open', +'hasTrial' => 'hasTrial', +'deprecated' => 'deprecated', +'sale' => 'sale', +'saleLabel' => 'sale_label' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -133,16 +129,15 @@ public static function swaggerFormats() */ protected static $setters = [ 'overviewSnippet' => 'setOverviewSnippet', - 'permalink' => 'setPermalink', - 'certificateUrl' => 'setCertificateUrl', - 'iconUrl' => 'setIconUrl', - 'complimentary' => 'setComplimentary', - 'open' => 'setOpen', - 'hasTrial' => 'setHasTrial', - 'deprecated' => 'setDeprecated', - 'sale' => 'setSale', - 'saleLabel' => 'setSaleLabel' - ]; +'permalink' => 'setPermalink', +'certificateUrl' => 'setCertificateUrl', +'iconUrl' => 'setIconUrl', +'complimentary' => 'setComplimentary', +'open' => 'setOpen', +'hasTrial' => 'setHasTrial', +'deprecated' => 'setDeprecated', +'sale' => 'setSale', +'saleLabel' => 'setSaleLabel' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -151,16 +146,15 @@ public static function swaggerFormats() */ protected static $getters = [ 'overviewSnippet' => 'getOverviewSnippet', - 'permalink' => 'getPermalink', - 'certificateUrl' => 'getCertificateUrl', - 'iconUrl' => 'getIconUrl', - 'complimentary' => 'getComplimentary', - 'open' => 'getOpen', - 'hasTrial' => 'getHasTrial', - 'deprecated' => 'getDeprecated', - 'sale' => 'getSale', - 'saleLabel' => 'getSaleLabel' - ]; +'permalink' => 'getPermalink', +'certificateUrl' => 'getCertificateUrl', +'iconUrl' => 'getIconUrl', +'complimentary' => 'getComplimentary', +'open' => 'getOpen', +'hasTrial' => 'getHasTrial', +'deprecated' => 'getDeprecated', +'sale' => 'getSale', +'saleLabel' => 'getSaleLabel' ]; /** * Array of attributes where the key is the local name, @@ -205,8 +199,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -597,5 +589,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/ExtraOrderData.php b/src/Model/ExtraOrderData.php index 9228492..cadc335 100644 --- a/src/Model/ExtraOrderData.php +++ b/src/Model/ExtraOrderData.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,15 +57,14 @@ class ExtraOrderData implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'customer' => '\Yoast\MyYoastApiClient\Model\CustomerData', - 'shopId' => 'int', - 'paymentReference' => 'string', - 'automatic' => 'bool', - 'billingType' => 'string', - 'vatNumber' => 'string', - 'renewalKey' => 'string', - 'transactions' => '\Yoast\MyYoastApiClient\Model\TransactionDataDto[]', - 'wooRefunds' => '\Yoast\MyYoastApiClient\Model\RefundDataDto[]' - ]; +'shopId' => 'int', +'paymentReference' => 'string', +'automatic' => 'bool', +'billingType' => 'string', +'vatNumber' => 'string', +'renewalKey' => 'string', +'transactions' => '\Yoast\MyYoastApiClient\Model\TransactionDataDto[]', +'wooRefunds' => '\Yoast\MyYoastApiClient\Model\RefundDataDto[]' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -75,15 +73,14 @@ class ExtraOrderData implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'customer' => null, - 'shopId' => null, - 'paymentReference' => null, - 'automatic' => null, - 'billingType' => null, - 'vatNumber' => null, - 'renewalKey' => null, - 'transactions' => null, - 'wooRefunds' => null - ]; +'shopId' => null, +'paymentReference' => null, +'automatic' => null, +'billingType' => null, +'vatNumber' => null, +'renewalKey' => null, +'transactions' => null, +'wooRefunds' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -113,15 +110,14 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'customer' => 'customer', - 'shopId' => 'shop_id', - 'paymentReference' => 'payment_reference', - 'automatic' => 'automatic', - 'billingType' => 'billingType', - 'vatNumber' => 'vat_number', - 'renewalKey' => 'renewal_key', - 'transactions' => 'transactions', - 'wooRefunds' => 'woo_refunds' - ]; +'shopId' => 'shop_id', +'paymentReference' => 'payment_reference', +'automatic' => 'automatic', +'billingType' => 'billingType', +'vatNumber' => 'vat_number', +'renewalKey' => 'renewal_key', +'transactions' => 'transactions', +'wooRefunds' => 'woo_refunds' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -130,15 +126,14 @@ public static function swaggerFormats() */ protected static $setters = [ 'customer' => 'setCustomer', - 'shopId' => 'setShopId', - 'paymentReference' => 'setPaymentReference', - 'automatic' => 'setAutomatic', - 'billingType' => 'setBillingType', - 'vatNumber' => 'setVatNumber', - 'renewalKey' => 'setRenewalKey', - 'transactions' => 'setTransactions', - 'wooRefunds' => 'setWooRefunds' - ]; +'shopId' => 'setShopId', +'paymentReference' => 'setPaymentReference', +'automatic' => 'setAutomatic', +'billingType' => 'setBillingType', +'vatNumber' => 'setVatNumber', +'renewalKey' => 'setRenewalKey', +'transactions' => 'setTransactions', +'wooRefunds' => 'setWooRefunds' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -147,15 +142,14 @@ public static function swaggerFormats() */ protected static $getters = [ 'customer' => 'getCustomer', - 'shopId' => 'getShopId', - 'paymentReference' => 'getPaymentReference', - 'automatic' => 'getAutomatic', - 'billingType' => 'getBillingType', - 'vatNumber' => 'getVatNumber', - 'renewalKey' => 'getRenewalKey', - 'transactions' => 'getTransactions', - 'wooRefunds' => 'getWooRefunds' - ]; +'shopId' => 'getShopId', +'paymentReference' => 'getPaymentReference', +'automatic' => 'getAutomatic', +'billingType' => 'getBillingType', +'vatNumber' => 'getVatNumber', +'renewalKey' => 'getRenewalKey', +'transactions' => 'getTransactions', +'wooRefunds' => 'getWooRefunds' ]; /** * Array of attributes where the key is the local name, @@ -200,8 +194,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -558,5 +550,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/ExtraProductData.php b/src/Model/ExtraProductData.php index 7e3d9e0..9f8271b 100644 --- a/src/Model/ExtraProductData.php +++ b/src/Model/ExtraProductData.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,12 +57,11 @@ class ExtraProductData implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'shopId' => 'int', - 'changelog' => 'string', - 'productGroupSlugs' => 'string[]', - 'billingType' => 'string', - 'billingTerm' => 'string', - 'activationLimit' => 'float' - ]; +'changelog' => 'string', +'productGroupSlugs' => 'string[]', +'billingType' => 'string', +'billingTerm' => 'string', +'activationLimit' => 'int' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -72,12 +70,11 @@ class ExtraProductData implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'shopId' => null, - 'changelog' => null, - 'productGroupSlugs' => null, - 'billingType' => null, - 'billingTerm' => null, - 'activationLimit' => null - ]; +'changelog' => null, +'productGroupSlugs' => null, +'billingType' => null, +'billingTerm' => null, +'activationLimit' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -107,12 +104,11 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'shopId' => 'shop_id', - 'changelog' => 'changelog', - 'productGroupSlugs' => 'product_group_slugs', - 'billingType' => 'billingType', - 'billingTerm' => 'billingTerm', - 'activationLimit' => 'activationLimit' - ]; +'changelog' => 'changelog', +'productGroupSlugs' => 'product_group_slugs', +'billingType' => 'billingType', +'billingTerm' => 'billingTerm', +'activationLimit' => 'activationLimit' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -121,12 +117,11 @@ public static function swaggerFormats() */ protected static $setters = [ 'shopId' => 'setShopId', - 'changelog' => 'setChangelog', - 'productGroupSlugs' => 'setProductGroupSlugs', - 'billingType' => 'setBillingType', - 'billingTerm' => 'setBillingTerm', - 'activationLimit' => 'setActivationLimit' - ]; +'changelog' => 'setChangelog', +'productGroupSlugs' => 'setProductGroupSlugs', +'billingType' => 'setBillingType', +'billingTerm' => 'setBillingTerm', +'activationLimit' => 'setActivationLimit' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -135,12 +130,11 @@ public static function swaggerFormats() */ protected static $getters = [ 'shopId' => 'getShopId', - 'changelog' => 'getChangelog', - 'productGroupSlugs' => 'getProductGroupSlugs', - 'billingType' => 'getBillingType', - 'billingTerm' => 'getBillingTerm', - 'activationLimit' => 'getActivationLimit' - ]; +'changelog' => 'getChangelog', +'productGroupSlugs' => 'getProductGroupSlugs', +'billingType' => 'getBillingType', +'billingTerm' => 'getBillingTerm', +'activationLimit' => 'getActivationLimit' ]; /** * Array of attributes where the key is the local name, @@ -185,8 +179,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -369,7 +361,7 @@ public function setBillingTerm($billingTerm) /** * Gets activationLimit * - * @return float + * @return int */ public function getActivationLimit() { @@ -379,7 +371,7 @@ public function getActivationLimit() /** * Sets activationLimit * - * @param float $activationLimit activationLimit + * @param int $activationLimit activationLimit * * @return $this */ @@ -459,5 +451,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/FeeLineDto.php b/src/Model/FeeLineDto.php new file mode 100644 index 0000000..84c9219 --- /dev/null +++ b/src/Model/FeeLineDto.php @@ -0,0 +1,555 @@ + 'int', +'name' => 'string', +'taxClass' => 'string', +'taxStatus' => 'string', +'amount' => 'string', +'total' => 'string', +'totalTax' => 'string', +'taxes' => '\Yoast\MyYoastApiClient\Model\LineItemTax[]', +'metaData' => '\Yoast\MyYoastApiClient\Model\MetaDataDto[]' ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => null, +'name' => null, +'taxClass' => null, +'taxStatus' => null, +'amount' => null, +'total' => null, +'totalTax' => null, +'taxes' => null, +'metaData' => null ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', +'name' => 'name', +'taxClass' => 'tax_class', +'taxStatus' => 'tax_status', +'amount' => 'amount', +'total' => 'total', +'totalTax' => 'total_tax', +'taxes' => 'taxes', +'metaData' => 'meta_data' ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', +'name' => 'setName', +'taxClass' => 'setTaxClass', +'taxStatus' => 'setTaxStatus', +'amount' => 'setAmount', +'total' => 'setTotal', +'totalTax' => 'setTotalTax', +'taxes' => 'setTaxes', +'metaData' => 'setMetaData' ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', +'name' => 'getName', +'taxClass' => 'getTaxClass', +'taxStatus' => 'getTaxStatus', +'amount' => 'getAmount', +'total' => 'getTotal', +'totalTax' => 'getTotalTax', +'taxes' => 'getTaxes', +'metaData' => 'getMetaData' ]; + + /** + * 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::$swaggerModelName; + } + + + + /** + * 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->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['taxClass'] = isset($data['taxClass']) ? $data['taxClass'] : null; + $this->container['taxStatus'] = isset($data['taxStatus']) ? $data['taxStatus'] : null; + $this->container['amount'] = isset($data['amount']) ? $data['amount'] : null; + $this->container['total'] = isset($data['total']) ? $data['total'] : null; + $this->container['totalTax'] = isset($data['totalTax']) ? $data['totalTax'] : null; + $this->container['taxes'] = isset($data['taxes']) ? $data['taxes'] : null; + $this->container['metaData'] = isset($data['metaData']) ? $data['metaData'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['taxClass'] === null) { + $invalidProperties[] = "'taxClass' can't be null"; + } + if ($this->container['taxStatus'] === null) { + $invalidProperties[] = "'taxStatus' can't be null"; + } + if ($this->container['amount'] === null) { + $invalidProperties[] = "'amount' can't be null"; + } + if ($this->container['total'] === null) { + $invalidProperties[] = "'total' can't be null"; + } + if ($this->container['totalTax'] === null) { + $invalidProperties[] = "'totalTax' can't be null"; + } + if ($this->container['taxes'] === null) { + $invalidProperties[] = "'taxes' 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 id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id id + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets taxClass + * + * @return string + */ + public function getTaxClass() + { + return $this->container['taxClass']; + } + + /** + * Sets taxClass + * + * @param string $taxClass taxClass + * + * @return $this + */ + public function setTaxClass($taxClass) + { + $this->container['taxClass'] = $taxClass; + + return $this; + } + + /** + * Gets taxStatus + * + * @return string + */ + public function getTaxStatus() + { + return $this->container['taxStatus']; + } + + /** + * Sets taxStatus + * + * @param string $taxStatus taxStatus + * + * @return $this + */ + public function setTaxStatus($taxStatus) + { + $this->container['taxStatus'] = $taxStatus; + + return $this; + } + + /** + * Gets amount + * + * @return string + */ + public function getAmount() + { + return $this->container['amount']; + } + + /** + * Sets amount + * + * @param string $amount amount + * + * @return $this + */ + public function setAmount($amount) + { + $this->container['amount'] = $amount; + + return $this; + } + + /** + * Gets total + * + * @return string + */ + public function getTotal() + { + return $this->container['total']; + } + + /** + * Sets total + * + * @param string $total total + * + * @return $this + */ + public function setTotal($total) + { + $this->container['total'] = $total; + + return $this; + } + + /** + * Gets totalTax + * + * @return string + */ + public function getTotalTax() + { + return $this->container['totalTax']; + } + + /** + * Sets totalTax + * + * @param string $totalTax totalTax + * + * @return $this + */ + public function setTotalTax($totalTax) + { + $this->container['totalTax'] = $totalTax; + + return $this; + } + + /** + * Gets taxes + * + * @return \Yoast\MyYoastApiClient\Model\LineItemTax[] + */ + public function getTaxes() + { + return $this->container['taxes']; + } + + /** + * Sets taxes + * + * @param \Yoast\MyYoastApiClient\Model\LineItemTax[] $taxes taxes + * + * @return $this + */ + public function setTaxes($taxes) + { + $this->container['taxes'] = $taxes; + + return $this; + } + + /** + * Gets metaData + * + * @return \Yoast\MyYoastApiClient\Model\MetaDataDto[] + */ + public function getMetaData() + { + return $this->container['metaData']; + } + + /** + * Sets metaData + * + * @param \Yoast\MyYoastApiClient\Model\MetaDataDto[] $metaData metaData + * + * @return $this + */ + public function setMetaData($metaData) + { + $this->container['metaData'] = $metaData; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} diff --git a/src/Model/FromAcademyDto.php b/src/Model/FromAcademyDto.php index d86b2cc..9bb66ed 100644 --- a/src/Model/FromAcademyDto.php +++ b/src/Model/FromAcademyDto.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,8 +57,7 @@ class FromAcademyDto implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'courseData' => '\Yoast\MyYoastApiClient\Model\CourseDataDto', - 'extraData' => '\Yoast\MyYoastApiClient\Model\ExtraCourseDataDto' - ]; +'extraData' => '\Yoast\MyYoastApiClient\Model\ExtraCourseDataDto' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -68,8 +66,7 @@ class FromAcademyDto implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'courseData' => null, - 'extraData' => null - ]; +'extraData' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -99,8 +96,7 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'courseData' => 'courseData', - 'extraData' => 'extraData' - ]; +'extraData' => 'extraData' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -109,8 +105,7 @@ public static function swaggerFormats() */ protected static $setters = [ 'courseData' => 'setCourseData', - 'extraData' => 'setExtraData' - ]; +'extraData' => 'setExtraData' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -119,8 +114,7 @@ public static function swaggerFormats() */ protected static $getters = [ 'courseData' => 'getCourseData', - 'extraData' => 'getExtraData' - ]; +'extraData' => 'getExtraData' ]; /** * Array of attributes where the key is the local name, @@ -165,8 +159,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -333,5 +325,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/GenerateDto.php b/src/Model/GenerateDto.php index ee5d278..540a06a 100644 --- a/src/Model/GenerateDto.php +++ b/src/Model/GenerateDto.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -57,8 +56,7 @@ class GenerateDto implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerTypes = [ - 'name' => 'string' - ]; + 'name' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -66,8 +64,7 @@ class GenerateDto implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerFormats = [ - 'name' => null - ]; + 'name' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -96,8 +93,7 @@ public static function swaggerFormats() * @var string[] */ protected static $attributeMap = [ - 'name' => 'name' - ]; + 'name' => 'name' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -105,8 +101,7 @@ public static function swaggerFormats() * @var string[] */ protected static $setters = [ - 'name' => 'setName' - ]; + 'name' => 'setName' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -114,8 +109,7 @@ public static function swaggerFormats() * @var string[] */ protected static $getters = [ - 'name' => 'getName' - ]; + 'name' => 'getName' ]; /** * Array of attributes where the key is the local name, @@ -160,8 +154,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -300,5 +292,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/HelpScoutDto.php b/src/Model/HelpScoutDto.php index f6f153b..f30508a 100644 --- a/src/Model/HelpScoutDto.php +++ b/src/Model/HelpScoutDto.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -57,11 +56,10 @@ class HelpScoutDto implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerTypes = [ - 'ticket' => '\Yoast\MyYoastApiClient\Model\TicketDTO', - 'customer' => '\Yoast\MyYoastApiClient\Model\CustomerDto', - 'user' => '\Yoast\MyYoastApiClient\Model\UserDto', - 'mailbox' => '\Yoast\MyYoastApiClient\Model\MailboxDto' - ]; + 'ticket' => '\Yoast\MyYoastApiClient\Model\TicketDto', +'customer' => '\Yoast\MyYoastApiClient\Model\CustomerDto', +'user' => '\Yoast\MyYoastApiClient\Model\UserDto', +'mailbox' => '\Yoast\MyYoastApiClient\Model\MailboxDto' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -70,10 +68,9 @@ class HelpScoutDto implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'ticket' => null, - 'customer' => null, - 'user' => null, - 'mailbox' => null - ]; +'customer' => null, +'user' => null, +'mailbox' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -103,10 +100,9 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'ticket' => 'ticket', - 'customer' => 'customer', - 'user' => 'user', - 'mailbox' => 'mailbox' - ]; +'customer' => 'customer', +'user' => 'user', +'mailbox' => 'mailbox' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -115,10 +111,9 @@ public static function swaggerFormats() */ protected static $setters = [ 'ticket' => 'setTicket', - 'customer' => 'setCustomer', - 'user' => 'setUser', - 'mailbox' => 'setMailbox' - ]; +'customer' => 'setCustomer', +'user' => 'setUser', +'mailbox' => 'setMailbox' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -127,10 +122,9 @@ public static function swaggerFormats() */ protected static $getters = [ 'ticket' => 'getTicket', - 'customer' => 'getCustomer', - 'user' => 'getUser', - 'mailbox' => 'getMailbox' - ]; +'customer' => 'getCustomer', +'user' => 'getUser', +'mailbox' => 'getMailbox' ]; /** * Array of attributes where the key is the local name, @@ -175,8 +169,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -207,18 +199,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['ticket'] === null) { - $invalidProperties[] = "'ticket' can't be null"; - } - if ($this->container['customer'] === null) { - $invalidProperties[] = "'customer' can't be null"; - } - if ($this->container['user'] === null) { - $invalidProperties[] = "'user' can't be null"; - } - if ($this->container['mailbox'] === null) { - $invalidProperties[] = "'mailbox' can't be null"; - } return $invalidProperties; } @@ -237,7 +217,7 @@ public function valid() /** * Gets ticket * - * @return \Yoast\MyYoastApiClient\Model\TicketDTO + * @return \Yoast\MyYoastApiClient\Model\TicketDto */ public function getTicket() { @@ -247,7 +227,7 @@ public function getTicket() /** * Sets ticket * - * @param \Yoast\MyYoastApiClient\Model\TicketDTO $ticket ticket + * @param \Yoast\MyYoastApiClient\Model\TicketDto $ticket ticket * * @return $this */ @@ -399,5 +379,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/InviteDto.php b/src/Model/InviteDto.php index b156774..613da52 100644 --- a/src/Model/InviteDto.php +++ b/src/Model/InviteDto.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -57,8 +56,7 @@ class InviteDto implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerTypes = [ - 'email' => 'string' - ]; + 'email' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -66,8 +64,7 @@ class InviteDto implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerFormats = [ - 'email' => null - ]; + 'email' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -96,8 +93,7 @@ public static function swaggerFormats() * @var string[] */ protected static $attributeMap = [ - 'email' => 'email' - ]; + 'email' => 'email' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -105,8 +101,7 @@ public static function swaggerFormats() * @var string[] */ protected static $setters = [ - 'email' => 'setEmail' - ]; + 'email' => 'setEmail' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -114,8 +109,7 @@ public static function swaggerFormats() * @var string[] */ protected static $getters = [ - 'email' => 'getEmail' - ]; + 'email' => 'getEmail' ]; /** * Array of attributes where the key is the local name, @@ -160,8 +154,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -300,5 +292,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/JSZip.php b/src/Model/JSZip.php index 66c03d4..c75d62f 100644 --- a/src/Model/JSZip.php +++ b/src/Model/JSZip.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -57,8 +56,7 @@ class JSZip implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerTypes = [ - - ]; + ]; /** * Array of property to format mappings. Used for (de)serialization @@ -66,8 +64,7 @@ class JSZip implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerFormats = [ - - ]; + ]; /** * Array of property to type mappings. Used for (de)serialization @@ -96,8 +93,7 @@ public static function swaggerFormats() * @var string[] */ protected static $attributeMap = [ - - ]; + ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -105,8 +101,7 @@ public static function swaggerFormats() * @var string[] */ protected static $setters = [ - - ]; + ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -114,8 +109,7 @@ public static function swaggerFormats() * @var string[] */ protected static $getters = [ - - ]; + ]; /** * Array of attributes where the key is the local name, @@ -160,8 +154,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -272,5 +264,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/JobOptionsDto.php b/src/Model/JobOptionsDto.php index 0959eef..b227680 100644 --- a/src/Model/JobOptionsDto.php +++ b/src/Model/JobOptionsDto.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -57,18 +56,17 @@ class JobOptionsDto implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerTypes = [ - 'priority' => 'float', - 'delay' => 'float', - 'attempts' => 'float', - 'repeat' => 'object', - 'backoff' => 'object', - 'lifo' => 'bool', - 'timeout' => 'float', - 'jobId' => 'object', - 'removeOnComplete' => 'object', - 'removeOnFail' => 'object', - 'stackTraceLimit' => 'float' - ]; + 'priority' => 'int', +'delay' => 'int', +'attempts' => 'int', +'repeat' => 'object', +'backoff' => 'object', +'lifo' => 'bool', +'timeout' => 'int', +'jobId' => 'object', +'removeOnComplete' => 'object', +'removeOnFail' => 'object', +'stackTraceLimit' => 'int' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -77,17 +75,16 @@ class JobOptionsDto implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'priority' => null, - 'delay' => null, - 'attempts' => null, - 'repeat' => null, - 'backoff' => null, - 'lifo' => null, - 'timeout' => null, - 'jobId' => null, - 'removeOnComplete' => null, - 'removeOnFail' => null, - 'stackTraceLimit' => null - ]; +'delay' => null, +'attempts' => null, +'repeat' => null, +'backoff' => null, +'lifo' => null, +'timeout' => null, +'jobId' => null, +'removeOnComplete' => null, +'removeOnFail' => null, +'stackTraceLimit' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -117,17 +114,16 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'priority' => 'priority', - 'delay' => 'delay', - 'attempts' => 'attempts', - 'repeat' => 'repeat', - 'backoff' => 'backoff', - 'lifo' => 'lifo', - 'timeout' => 'timeout', - 'jobId' => 'jobId', - 'removeOnComplete' => 'removeOnComplete', - 'removeOnFail' => 'removeOnFail', - 'stackTraceLimit' => 'stackTraceLimit' - ]; +'delay' => 'delay', +'attempts' => 'attempts', +'repeat' => 'repeat', +'backoff' => 'backoff', +'lifo' => 'lifo', +'timeout' => 'timeout', +'jobId' => 'jobId', +'removeOnComplete' => 'removeOnComplete', +'removeOnFail' => 'removeOnFail', +'stackTraceLimit' => 'stackTraceLimit' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -136,17 +132,16 @@ public static function swaggerFormats() */ protected static $setters = [ 'priority' => 'setPriority', - 'delay' => 'setDelay', - 'attempts' => 'setAttempts', - 'repeat' => 'setRepeat', - 'backoff' => 'setBackoff', - 'lifo' => 'setLifo', - 'timeout' => 'setTimeout', - 'jobId' => 'setJobId', - 'removeOnComplete' => 'setRemoveOnComplete', - 'removeOnFail' => 'setRemoveOnFail', - 'stackTraceLimit' => 'setStackTraceLimit' - ]; +'delay' => 'setDelay', +'attempts' => 'setAttempts', +'repeat' => 'setRepeat', +'backoff' => 'setBackoff', +'lifo' => 'setLifo', +'timeout' => 'setTimeout', +'jobId' => 'setJobId', +'removeOnComplete' => 'setRemoveOnComplete', +'removeOnFail' => 'setRemoveOnFail', +'stackTraceLimit' => 'setStackTraceLimit' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -155,17 +150,16 @@ public static function swaggerFormats() */ protected static $getters = [ 'priority' => 'getPriority', - 'delay' => 'getDelay', - 'attempts' => 'getAttempts', - 'repeat' => 'getRepeat', - 'backoff' => 'getBackoff', - 'lifo' => 'getLifo', - 'timeout' => 'getTimeout', - 'jobId' => 'getJobId', - 'removeOnComplete' => 'getRemoveOnComplete', - 'removeOnFail' => 'getRemoveOnFail', - 'stackTraceLimit' => 'getStackTraceLimit' - ]; +'delay' => 'getDelay', +'attempts' => 'getAttempts', +'repeat' => 'getRepeat', +'backoff' => 'getBackoff', +'lifo' => 'getLifo', +'timeout' => 'getTimeout', +'jobId' => 'getJobId', +'removeOnComplete' => 'getRemoveOnComplete', +'removeOnFail' => 'getRemoveOnFail', +'stackTraceLimit' => 'getStackTraceLimit' ]; /** * Array of attributes where the key is the local name, @@ -210,8 +204,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -267,7 +259,7 @@ public function valid() /** * Gets priority * - * @return float + * @return int */ public function getPriority() { @@ -277,7 +269,7 @@ public function getPriority() /** * Sets priority * - * @param float $priority priority + * @param int $priority priority * * @return $this */ @@ -291,7 +283,7 @@ public function setPriority($priority) /** * Gets delay * - * @return float + * @return int */ public function getDelay() { @@ -301,7 +293,7 @@ public function getDelay() /** * Sets delay * - * @param float $delay delay + * @param int $delay delay * * @return $this */ @@ -315,7 +307,7 @@ public function setDelay($delay) /** * Gets attempts * - * @return float + * @return int */ public function getAttempts() { @@ -325,7 +317,7 @@ public function getAttempts() /** * Sets attempts * - * @param float $attempts attempts + * @param int $attempts attempts * * @return $this */ @@ -411,7 +403,7 @@ public function setLifo($lifo) /** * Gets timeout * - * @return float + * @return int */ public function getTimeout() { @@ -421,7 +413,7 @@ public function getTimeout() /** * Sets timeout * - * @param float $timeout timeout + * @param int $timeout timeout * * @return $this */ @@ -507,7 +499,7 @@ public function setRemoveOnFail($removeOnFail) /** * Gets stackTraceLimit * - * @return float + * @return int */ public function getStackTraceLimit() { @@ -517,7 +509,7 @@ public function getStackTraceLimit() /** * Sets stackTraceLimit * - * @param float $stackTraceLimit stackTraceLimit + * @param int $stackTraceLimit stackTraceLimit * * @return $this */ @@ -597,5 +589,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/LineItemDto.php b/src/Model/LineItemDto.php index 9b43ba9..ae74a68 100644 --- a/src/Model/LineItemDto.php +++ b/src/Model/LineItemDto.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,23 +57,22 @@ class LineItemDto implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'bundledItemTitle' => 'string', - 'id' => 'int', - 'name' => 'string', - 'price' => 'float', - 'productId' => 'int', - 'quantity' => 'int', - 'sku' => 'string', - 'subtotal' => 'string', - 'subtotalTax' => 'string', - 'taxes' => '\Yoast\MyYoastApiClient\Model\LineItemTax[]', - 'taxClass' => 'string', - 'total' => 'string', - 'totalTax' => 'string', - 'variationId' => 'int', - 'bundledBy' => 'int', - 'bundledItems' => 'string[]', - 'metaData' => '\Yoast\MyYoastApiClient\Model\MetaDataDto[]' - ]; +'id' => 'int', +'name' => 'string', +'price' => 'int', +'productId' => 'int', +'quantity' => 'int', +'sku' => 'string', +'subtotal' => 'string', +'subtotalTax' => 'string', +'taxes' => '\Yoast\MyYoastApiClient\Model\LineItemTax[]', +'taxClass' => 'string', +'total' => 'string', +'totalTax' => 'string', +'variationId' => 'int', +'bundledBy' => 'int', +'bundledItems' => 'string[]', +'metaData' => '\Yoast\MyYoastApiClient\Model\MetaDataDto[]' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -83,23 +81,22 @@ class LineItemDto implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'bundledItemTitle' => null, - 'id' => null, - 'name' => null, - 'price' => null, - 'productId' => null, - 'quantity' => null, - 'sku' => null, - 'subtotal' => null, - 'subtotalTax' => null, - 'taxes' => null, - 'taxClass' => null, - 'total' => null, - 'totalTax' => null, - 'variationId' => null, - 'bundledBy' => null, - 'bundledItems' => null, - 'metaData' => null - ]; +'id' => null, +'name' => null, +'price' => null, +'productId' => null, +'quantity' => null, +'sku' => null, +'subtotal' => null, +'subtotalTax' => null, +'taxes' => null, +'taxClass' => null, +'total' => null, +'totalTax' => null, +'variationId' => null, +'bundledBy' => null, +'bundledItems' => null, +'metaData' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -129,23 +126,22 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'bundledItemTitle' => 'bundled_item_title', - 'id' => 'id', - 'name' => 'name', - 'price' => 'price', - 'productId' => 'product_id', - 'quantity' => 'quantity', - 'sku' => 'sku', - 'subtotal' => 'subtotal', - 'subtotalTax' => 'subtotal_tax', - 'taxes' => 'taxes', - 'taxClass' => 'tax_class', - 'total' => 'total', - 'totalTax' => 'total_tax', - 'variationId' => 'variation_id', - 'bundledBy' => 'bundled_by', - 'bundledItems' => 'bundled_items', - 'metaData' => 'meta_data' - ]; +'id' => 'id', +'name' => 'name', +'price' => 'price', +'productId' => 'product_id', +'quantity' => 'quantity', +'sku' => 'sku', +'subtotal' => 'subtotal', +'subtotalTax' => 'subtotal_tax', +'taxes' => 'taxes', +'taxClass' => 'tax_class', +'total' => 'total', +'totalTax' => 'total_tax', +'variationId' => 'variation_id', +'bundledBy' => 'bundled_by', +'bundledItems' => 'bundled_items', +'metaData' => 'meta_data' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -154,23 +150,22 @@ public static function swaggerFormats() */ protected static $setters = [ 'bundledItemTitle' => 'setBundledItemTitle', - 'id' => 'setId', - 'name' => 'setName', - 'price' => 'setPrice', - 'productId' => 'setProductId', - 'quantity' => 'setQuantity', - 'sku' => 'setSku', - 'subtotal' => 'setSubtotal', - 'subtotalTax' => 'setSubtotalTax', - 'taxes' => 'setTaxes', - 'taxClass' => 'setTaxClass', - 'total' => 'setTotal', - 'totalTax' => 'setTotalTax', - 'variationId' => 'setVariationId', - 'bundledBy' => 'setBundledBy', - 'bundledItems' => 'setBundledItems', - 'metaData' => 'setMetaData' - ]; +'id' => 'setId', +'name' => 'setName', +'price' => 'setPrice', +'productId' => 'setProductId', +'quantity' => 'setQuantity', +'sku' => 'setSku', +'subtotal' => 'setSubtotal', +'subtotalTax' => 'setSubtotalTax', +'taxes' => 'setTaxes', +'taxClass' => 'setTaxClass', +'total' => 'setTotal', +'totalTax' => 'setTotalTax', +'variationId' => 'setVariationId', +'bundledBy' => 'setBundledBy', +'bundledItems' => 'setBundledItems', +'metaData' => 'setMetaData' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -179,23 +174,22 @@ public static function swaggerFormats() */ protected static $getters = [ 'bundledItemTitle' => 'getBundledItemTitle', - 'id' => 'getId', - 'name' => 'getName', - 'price' => 'getPrice', - 'productId' => 'getProductId', - 'quantity' => 'getQuantity', - 'sku' => 'getSku', - 'subtotal' => 'getSubtotal', - 'subtotalTax' => 'getSubtotalTax', - 'taxes' => 'getTaxes', - 'taxClass' => 'getTaxClass', - 'total' => 'getTotal', - 'totalTax' => 'getTotalTax', - 'variationId' => 'getVariationId', - 'bundledBy' => 'getBundledBy', - 'bundledItems' => 'getBundledItems', - 'metaData' => 'getMetaData' - ]; +'id' => 'getId', +'name' => 'getName', +'price' => 'getPrice', +'productId' => 'getProductId', +'quantity' => 'getQuantity', +'sku' => 'getSku', +'subtotal' => 'getSubtotal', +'subtotalTax' => 'getSubtotalTax', +'taxes' => 'getTaxes', +'taxClass' => 'getTaxClass', +'total' => 'getTotal', +'totalTax' => 'getTotalTax', +'variationId' => 'getVariationId', +'bundledBy' => 'getBundledBy', +'bundledItems' => 'getBundledItems', +'metaData' => 'getMetaData' ]; /** * Array of attributes where the key is the local name, @@ -240,8 +234,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -414,7 +406,7 @@ public function setName($name) /** * Gets price * - * @return float + * @return int */ public function getPrice() { @@ -424,7 +416,7 @@ public function getPrice() /** * Sets price * - * @param float $price price + * @param int $price price * * @return $this */ @@ -816,5 +808,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/LineItemTax.php b/src/Model/LineItemTax.php index 94f79f5..d492f4f 100644 --- a/src/Model/LineItemTax.php +++ b/src/Model/LineItemTax.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,9 +57,8 @@ class LineItemTax implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'id' => 'int', - 'subtotal' => 'string', - 'total' => 'string' - ]; +'subtotal' => 'string', +'total' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -69,9 +67,8 @@ class LineItemTax implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'id' => null, - 'subtotal' => null, - 'total' => null - ]; +'subtotal' => null, +'total' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -101,9 +98,8 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'id' => 'id', - 'subtotal' => 'subtotal', - 'total' => 'total' - ]; +'subtotal' => 'subtotal', +'total' => 'total' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -112,9 +108,8 @@ public static function swaggerFormats() */ protected static $setters = [ 'id' => 'setId', - 'subtotal' => 'setSubtotal', - 'total' => 'setTotal' - ]; +'subtotal' => 'setSubtotal', +'total' => 'setTotal' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -123,9 +118,8 @@ public static function swaggerFormats() */ protected static $getters = [ 'id' => 'getId', - 'subtotal' => 'getSubtotal', - 'total' => 'getTotal' - ]; +'subtotal' => 'getSubtotal', +'total' => 'getTotal' ]; /** * Array of attributes where the key is the local name, @@ -170,8 +164,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -366,5 +358,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/LoginDto.php b/src/Model/LoginDto.php index 227d024..f32f193 100644 --- a/src/Model/LoginDto.php +++ b/src/Model/LoginDto.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,8 +57,7 @@ class LoginDto implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'username' => 'string', - 'password' => 'string' - ]; +'password' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -68,8 +66,7 @@ class LoginDto implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'username' => null, - 'password' => null - ]; +'password' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -99,8 +96,7 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'username' => 'username', - 'password' => 'password' - ]; +'password' => 'password' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -109,8 +105,7 @@ public static function swaggerFormats() */ protected static $setters = [ 'username' => 'setUsername', - 'password' => 'setPassword' - ]; +'password' => 'setPassword' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -119,8 +114,7 @@ public static function swaggerFormats() */ protected static $getters = [ 'username' => 'getUsername', - 'password' => 'getPassword' - ]; +'password' => 'getPassword' ]; /** * Array of attributes where the key is the local name, @@ -165,8 +159,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -333,5 +325,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/LoginUserDto.php b/src/Model/LoginUserDto.php index b432d29..10af0fb 100644 --- a/src/Model/LoginUserDto.php +++ b/src/Model/LoginUserDto.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,10 +57,9 @@ class LoginUserDto implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'email' => 'string', - 'password' => 'string', - 'rememberMe' => 'bool', - 'otp' => 'string' - ]; +'password' => 'string', +'rememberMe' => 'bool', +'otp' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -70,10 +68,9 @@ class LoginUserDto implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'email' => null, - 'password' => null, - 'rememberMe' => null, - 'otp' => null - ]; +'password' => null, +'rememberMe' => null, +'otp' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -103,10 +100,9 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'email' => 'email', - 'password' => 'password', - 'rememberMe' => 'rememberMe', - 'otp' => 'otp' - ]; +'password' => 'password', +'rememberMe' => 'rememberMe', +'otp' => 'otp' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -115,10 +111,9 @@ public static function swaggerFormats() */ protected static $setters = [ 'email' => 'setEmail', - 'password' => 'setPassword', - 'rememberMe' => 'setRememberMe', - 'otp' => 'setOtp' - ]; +'password' => 'setPassword', +'rememberMe' => 'setRememberMe', +'otp' => 'setOtp' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -127,10 +122,9 @@ public static function swaggerFormats() */ protected static $getters = [ 'email' => 'getEmail', - 'password' => 'getPassword', - 'rememberMe' => 'getRememberMe', - 'otp' => 'getOtp' - ]; +'password' => 'getPassword', +'rememberMe' => 'getRememberMe', +'otp' => 'getOtp' ]; /** * Array of attributes where the key is the local name, @@ -175,8 +169,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -393,5 +385,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/LogoutUserBodyDto.php b/src/Model/LogoutUserBodyDto.php index 71bab11..0ff7745 100644 --- a/src/Model/LogoutUserBodyDto.php +++ b/src/Model/LogoutUserBodyDto.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -57,8 +56,7 @@ class LogoutUserBodyDto implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerTypes = [ - 'nonce' => 'string' - ]; + 'nonce' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -66,8 +64,7 @@ class LogoutUserBodyDto implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerFormats = [ - 'nonce' => null - ]; + 'nonce' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -96,8 +93,7 @@ public static function swaggerFormats() * @var string[] */ protected static $attributeMap = [ - 'nonce' => 'nonce' - ]; + 'nonce' => 'nonce' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -105,8 +101,7 @@ public static function swaggerFormats() * @var string[] */ protected static $setters = [ - 'nonce' => 'setNonce' - ]; + 'nonce' => 'setNonce' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -114,8 +109,7 @@ public static function swaggerFormats() * @var string[] */ protected static $getters = [ - 'nonce' => 'getNonce' - ]; + 'nonce' => 'getNonce' ]; /** * Array of attributes where the key is the local name, @@ -160,8 +154,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -300,5 +292,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/MailboxDto.php b/src/Model/MailboxDto.php index 2eb843a..ee14529 100644 --- a/src/Model/MailboxDto.php +++ b/src/Model/MailboxDto.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -57,9 +56,8 @@ class MailboxDto implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerTypes = [ - 'id' => 'float', - 'email' => 'string' - ]; + 'id' => 'int', +'email' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -68,8 +66,7 @@ class MailboxDto implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'id' => null, - 'email' => null - ]; +'email' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -99,8 +96,7 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'id' => 'id', - 'email' => 'email' - ]; +'email' => 'email' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -109,8 +105,7 @@ public static function swaggerFormats() */ protected static $setters = [ 'id' => 'setId', - 'email' => 'setEmail' - ]; +'email' => 'setEmail' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -119,8 +114,7 @@ public static function swaggerFormats() */ protected static $getters = [ 'id' => 'getId', - 'email' => 'getEmail' - ]; +'email' => 'getEmail' ]; /** * Array of attributes where the key is the local name, @@ -165,8 +159,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -219,7 +211,7 @@ public function valid() /** * Gets id * - * @return float + * @return int */ public function getId() { @@ -229,7 +221,7 @@ public function getId() /** * Sets id * - * @param float $id id + * @param int $id id * * @return $this */ @@ -333,5 +325,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/MetaDataDto.php b/src/Model/MetaDataDto.php index 5bcd773..b864661 100644 --- a/src/Model/MetaDataDto.php +++ b/src/Model/MetaDataDto.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,9 +57,8 @@ class MetaDataDto implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'id' => 'int', - 'key' => 'string', - 'value' => 'object' - ]; +'key' => 'string', +'value' => 'object' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -69,9 +67,8 @@ class MetaDataDto implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'id' => null, - 'key' => null, - 'value' => null - ]; +'key' => null, +'value' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -101,9 +98,8 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'id' => 'id', - 'key' => 'key', - 'value' => 'value' - ]; +'key' => 'key', +'value' => 'value' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -112,9 +108,8 @@ public static function swaggerFormats() */ protected static $setters = [ 'id' => 'setId', - 'key' => 'setKey', - 'value' => 'setValue' - ]; +'key' => 'setKey', +'value' => 'setValue' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -123,9 +118,8 @@ public static function swaggerFormats() */ protected static $getters = [ 'id' => 'getId', - 'key' => 'getKey', - 'value' => 'getValue' - ]; +'key' => 'getKey', +'value' => 'getValue' ]; /** * Array of attributes where the key is the local name, @@ -170,8 +164,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -366,5 +358,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/ModelInterface.php b/src/Model/ModelInterface.php index 1b73fb3..df4533a 100644 --- a/src/Model/ModelInterface.php +++ b/src/Model/ModelInterface.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen diff --git a/src/Model/Order.php b/src/Model/Order.php index eeba781..7c32d43 100644 --- a/src/Model/Order.php +++ b/src/Model/Order.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,44 +57,44 @@ class Order implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'countryOfOrigin' => 'string', - 'id' => 'string', - 'totalAmount' => 'int', - 'subtotalAmount' => 'int', - 'date' => '\DateTime', - 'vatNumber' => 'string', - 'paymentProvider' => 'string', - 'paymentGateway' => 'string', - 'paymentReference' => 'string', - 'vatTotal' => 'int', - 'discountTotal' => 'int', - 'glNumber' => 'string', - 'status' => 'string', - 'sourceId' => 'int', - 'sourceShopId' => 'int', - 'invoiceNumber' => 'string', - 'currency' => 'string', - 'customerEmail' => 'string', - 'customerFirstName' => 'string', - 'customerLastName' => 'string', - 'customerCompany' => 'string', - 'customerPhone' => 'string', - 'addressLine1' => 'string', - 'addressLine2' => 'string', - 'addressCity' => 'string', - 'addressState' => 'string', - 'addressZipcode' => 'string', - 'addressCountry' => 'string', - 'excludeFromRevenue' => 'bool', - 'createdAt' => '\DateTime', - 'modifiedAt' => '\DateTime', - 'renewal' => 'bool', - 'automatic' => 'bool', - 'billingType' => 'string', - 'ipAddress' => 'string', - 'customerId' => 'string', - 'processedCompletionAt' => '\DateTime', - 'renewalKey' => 'string' - ]; +'id' => 'string', +'totalAmount' => 'int', +'subtotalAmount' => 'int', +'date' => '\DateTime', +'vatNumber' => 'string', +'paymentProvider' => 'string', +'paymentGateway' => 'string', +'paymentReference' => 'string', +'vatTotal' => 'int', +'discountTotal' => 'int', +'glNumber' => 'string', +'status' => 'string', +'sourceId' => 'int', +'sourceShopId' => 'int', +'invoiceNumber' => 'string', +'currency' => 'string', +'customerEmail' => 'string', +'customerFirstName' => 'string', +'customerLastName' => 'string', +'customerCompany' => 'string', +'customerPhone' => 'string', +'addressLine1' => 'string', +'addressLine2' => 'string', +'addressCity' => 'string', +'addressState' => 'string', +'addressZipcode' => 'string', +'addressCountry' => 'string', +'excludeFromRevenue' => 'bool', +'createdAt' => '\DateTime', +'modifiedAt' => '\DateTime', +'renewal' => 'bool', +'automatic' => 'bool', +'billingType' => 'string', +'ipAddress' => 'string', +'customerId' => 'string', +'processedCompletionAt' => '\DateTime', +'renewalKey' => 'string', +'vatNumberValid' => 'bool' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -104,44 +103,44 @@ class Order implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'countryOfOrigin' => null, - 'id' => 'uuid', - 'totalAmount' => null, - 'subtotalAmount' => null, - 'date' => 'date-time', - 'vatNumber' => null, - 'paymentProvider' => null, - 'paymentGateway' => null, - 'paymentReference' => null, - 'vatTotal' => null, - 'discountTotal' => null, - 'glNumber' => null, - 'status' => null, - 'sourceId' => null, - 'sourceShopId' => null, - 'invoiceNumber' => null, - 'currency' => null, - 'customerEmail' => 'email', - 'customerFirstName' => null, - 'customerLastName' => null, - 'customerCompany' => null, - 'customerPhone' => null, - 'addressLine1' => null, - 'addressLine2' => null, - 'addressCity' => null, - 'addressState' => null, - 'addressZipcode' => null, - 'addressCountry' => null, - 'excludeFromRevenue' => null, - 'createdAt' => 'date-time', - 'modifiedAt' => 'date-time', - 'renewal' => null, - 'automatic' => null, - 'billingType' => null, - 'ipAddress' => null, - 'customerId' => 'uuid', - 'processedCompletionAt' => 'date-time', - 'renewalKey' => null - ]; +'id' => 'uuid', +'totalAmount' => null, +'subtotalAmount' => null, +'date' => 'date-time', +'vatNumber' => null, +'paymentProvider' => null, +'paymentGateway' => null, +'paymentReference' => null, +'vatTotal' => null, +'discountTotal' => null, +'glNumber' => null, +'status' => null, +'sourceId' => null, +'sourceShopId' => null, +'invoiceNumber' => null, +'currency' => null, +'customerEmail' => 'email', +'customerFirstName' => null, +'customerLastName' => null, +'customerCompany' => null, +'customerPhone' => null, +'addressLine1' => null, +'addressLine2' => null, +'addressCity' => null, +'addressState' => null, +'addressZipcode' => null, +'addressCountry' => null, +'excludeFromRevenue' => null, +'createdAt' => 'date-time', +'modifiedAt' => 'date-time', +'renewal' => null, +'automatic' => null, +'billingType' => null, +'ipAddress' => null, +'customerId' => 'uuid', +'processedCompletionAt' => 'date-time', +'renewalKey' => null, +'vatNumberValid' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -171,44 +170,44 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'countryOfOrigin' => 'countryOfOrigin', - 'id' => 'id', - 'totalAmount' => 'totalAmount', - 'subtotalAmount' => 'subtotalAmount', - 'date' => 'date', - 'vatNumber' => 'vatNumber', - 'paymentProvider' => 'paymentProvider', - 'paymentGateway' => 'paymentGateway', - 'paymentReference' => 'paymentReference', - 'vatTotal' => 'vatTotal', - 'discountTotal' => 'discountTotal', - 'glNumber' => 'glNumber', - 'status' => 'status', - 'sourceId' => 'sourceId', - 'sourceShopId' => 'sourceShopId', - 'invoiceNumber' => 'invoiceNumber', - 'currency' => 'currency', - 'customerEmail' => 'customerEmail', - 'customerFirstName' => 'customerFirstName', - 'customerLastName' => 'customerLastName', - 'customerCompany' => 'customerCompany', - 'customerPhone' => 'customerPhone', - 'addressLine1' => 'addressLine1', - 'addressLine2' => 'addressLine2', - 'addressCity' => 'addressCity', - 'addressState' => 'addressState', - 'addressZipcode' => 'addressZipcode', - 'addressCountry' => 'addressCountry', - 'excludeFromRevenue' => 'excludeFromRevenue', - 'createdAt' => 'createdAt', - 'modifiedAt' => 'modifiedAt', - 'renewal' => 'renewal', - 'automatic' => 'automatic', - 'billingType' => 'billingType', - 'ipAddress' => 'ipAddress', - 'customerId' => 'customerId', - 'processedCompletionAt' => 'processedCompletionAt', - 'renewalKey' => 'renewalKey' - ]; +'id' => 'id', +'totalAmount' => 'totalAmount', +'subtotalAmount' => 'subtotalAmount', +'date' => 'date', +'vatNumber' => 'vatNumber', +'paymentProvider' => 'paymentProvider', +'paymentGateway' => 'paymentGateway', +'paymentReference' => 'paymentReference', +'vatTotal' => 'vatTotal', +'discountTotal' => 'discountTotal', +'glNumber' => 'glNumber', +'status' => 'status', +'sourceId' => 'sourceId', +'sourceShopId' => 'sourceShopId', +'invoiceNumber' => 'invoiceNumber', +'currency' => 'currency', +'customerEmail' => 'customerEmail', +'customerFirstName' => 'customerFirstName', +'customerLastName' => 'customerLastName', +'customerCompany' => 'customerCompany', +'customerPhone' => 'customerPhone', +'addressLine1' => 'addressLine1', +'addressLine2' => 'addressLine2', +'addressCity' => 'addressCity', +'addressState' => 'addressState', +'addressZipcode' => 'addressZipcode', +'addressCountry' => 'addressCountry', +'excludeFromRevenue' => 'excludeFromRevenue', +'createdAt' => 'createdAt', +'modifiedAt' => 'modifiedAt', +'renewal' => 'renewal', +'automatic' => 'automatic', +'billingType' => 'billingType', +'ipAddress' => 'ipAddress', +'customerId' => 'customerId', +'processedCompletionAt' => 'processedCompletionAt', +'renewalKey' => 'renewalKey', +'vatNumberValid' => 'vatNumberValid' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -217,44 +216,44 @@ public static function swaggerFormats() */ protected static $setters = [ 'countryOfOrigin' => 'setCountryOfOrigin', - 'id' => 'setId', - 'totalAmount' => 'setTotalAmount', - 'subtotalAmount' => 'setSubtotalAmount', - 'date' => 'setDate', - 'vatNumber' => 'setVatNumber', - 'paymentProvider' => 'setPaymentProvider', - 'paymentGateway' => 'setPaymentGateway', - 'paymentReference' => 'setPaymentReference', - 'vatTotal' => 'setVatTotal', - 'discountTotal' => 'setDiscountTotal', - 'glNumber' => 'setGlNumber', - 'status' => 'setStatus', - 'sourceId' => 'setSourceId', - 'sourceShopId' => 'setSourceShopId', - 'invoiceNumber' => 'setInvoiceNumber', - 'currency' => 'setCurrency', - 'customerEmail' => 'setCustomerEmail', - 'customerFirstName' => 'setCustomerFirstName', - 'customerLastName' => 'setCustomerLastName', - 'customerCompany' => 'setCustomerCompany', - 'customerPhone' => 'setCustomerPhone', - 'addressLine1' => 'setAddressLine1', - 'addressLine2' => 'setAddressLine2', - 'addressCity' => 'setAddressCity', - 'addressState' => 'setAddressState', - 'addressZipcode' => 'setAddressZipcode', - 'addressCountry' => 'setAddressCountry', - 'excludeFromRevenue' => 'setExcludeFromRevenue', - 'createdAt' => 'setCreatedAt', - 'modifiedAt' => 'setModifiedAt', - 'renewal' => 'setRenewal', - 'automatic' => 'setAutomatic', - 'billingType' => 'setBillingType', - 'ipAddress' => 'setIpAddress', - 'customerId' => 'setCustomerId', - 'processedCompletionAt' => 'setProcessedCompletionAt', - 'renewalKey' => 'setRenewalKey' - ]; +'id' => 'setId', +'totalAmount' => 'setTotalAmount', +'subtotalAmount' => 'setSubtotalAmount', +'date' => 'setDate', +'vatNumber' => 'setVatNumber', +'paymentProvider' => 'setPaymentProvider', +'paymentGateway' => 'setPaymentGateway', +'paymentReference' => 'setPaymentReference', +'vatTotal' => 'setVatTotal', +'discountTotal' => 'setDiscountTotal', +'glNumber' => 'setGlNumber', +'status' => 'setStatus', +'sourceId' => 'setSourceId', +'sourceShopId' => 'setSourceShopId', +'invoiceNumber' => 'setInvoiceNumber', +'currency' => 'setCurrency', +'customerEmail' => 'setCustomerEmail', +'customerFirstName' => 'setCustomerFirstName', +'customerLastName' => 'setCustomerLastName', +'customerCompany' => 'setCustomerCompany', +'customerPhone' => 'setCustomerPhone', +'addressLine1' => 'setAddressLine1', +'addressLine2' => 'setAddressLine2', +'addressCity' => 'setAddressCity', +'addressState' => 'setAddressState', +'addressZipcode' => 'setAddressZipcode', +'addressCountry' => 'setAddressCountry', +'excludeFromRevenue' => 'setExcludeFromRevenue', +'createdAt' => 'setCreatedAt', +'modifiedAt' => 'setModifiedAt', +'renewal' => 'setRenewal', +'automatic' => 'setAutomatic', +'billingType' => 'setBillingType', +'ipAddress' => 'setIpAddress', +'customerId' => 'setCustomerId', +'processedCompletionAt' => 'setProcessedCompletionAt', +'renewalKey' => 'setRenewalKey', +'vatNumberValid' => 'setVatNumberValid' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -263,44 +262,44 @@ public static function swaggerFormats() */ protected static $getters = [ 'countryOfOrigin' => 'getCountryOfOrigin', - 'id' => 'getId', - 'totalAmount' => 'getTotalAmount', - 'subtotalAmount' => 'getSubtotalAmount', - 'date' => 'getDate', - 'vatNumber' => 'getVatNumber', - 'paymentProvider' => 'getPaymentProvider', - 'paymentGateway' => 'getPaymentGateway', - 'paymentReference' => 'getPaymentReference', - 'vatTotal' => 'getVatTotal', - 'discountTotal' => 'getDiscountTotal', - 'glNumber' => 'getGlNumber', - 'status' => 'getStatus', - 'sourceId' => 'getSourceId', - 'sourceShopId' => 'getSourceShopId', - 'invoiceNumber' => 'getInvoiceNumber', - 'currency' => 'getCurrency', - 'customerEmail' => 'getCustomerEmail', - 'customerFirstName' => 'getCustomerFirstName', - 'customerLastName' => 'getCustomerLastName', - 'customerCompany' => 'getCustomerCompany', - 'customerPhone' => 'getCustomerPhone', - 'addressLine1' => 'getAddressLine1', - 'addressLine2' => 'getAddressLine2', - 'addressCity' => 'getAddressCity', - 'addressState' => 'getAddressState', - 'addressZipcode' => 'getAddressZipcode', - 'addressCountry' => 'getAddressCountry', - 'excludeFromRevenue' => 'getExcludeFromRevenue', - 'createdAt' => 'getCreatedAt', - 'modifiedAt' => 'getModifiedAt', - 'renewal' => 'getRenewal', - 'automatic' => 'getAutomatic', - 'billingType' => 'getBillingType', - 'ipAddress' => 'getIpAddress', - 'customerId' => 'getCustomerId', - 'processedCompletionAt' => 'getProcessedCompletionAt', - 'renewalKey' => 'getRenewalKey' - ]; +'id' => 'getId', +'totalAmount' => 'getTotalAmount', +'subtotalAmount' => 'getSubtotalAmount', +'date' => 'getDate', +'vatNumber' => 'getVatNumber', +'paymentProvider' => 'getPaymentProvider', +'paymentGateway' => 'getPaymentGateway', +'paymentReference' => 'getPaymentReference', +'vatTotal' => 'getVatTotal', +'discountTotal' => 'getDiscountTotal', +'glNumber' => 'getGlNumber', +'status' => 'getStatus', +'sourceId' => 'getSourceId', +'sourceShopId' => 'getSourceShopId', +'invoiceNumber' => 'getInvoiceNumber', +'currency' => 'getCurrency', +'customerEmail' => 'getCustomerEmail', +'customerFirstName' => 'getCustomerFirstName', +'customerLastName' => 'getCustomerLastName', +'customerCompany' => 'getCustomerCompany', +'customerPhone' => 'getCustomerPhone', +'addressLine1' => 'getAddressLine1', +'addressLine2' => 'getAddressLine2', +'addressCity' => 'getAddressCity', +'addressState' => 'getAddressState', +'addressZipcode' => 'getAddressZipcode', +'addressCountry' => 'getAddressCountry', +'excludeFromRevenue' => 'getExcludeFromRevenue', +'createdAt' => 'getCreatedAt', +'modifiedAt' => 'getModifiedAt', +'renewal' => 'getRenewal', +'automatic' => 'getAutomatic', +'billingType' => 'getBillingType', +'ipAddress' => 'getIpAddress', +'customerId' => 'getCustomerId', +'processedCompletionAt' => 'getProcessedCompletionAt', +'renewalKey' => 'getRenewalKey', +'vatNumberValid' => 'getVatNumberValid' ]; /** * Array of attributes where the key is the local name, @@ -345,8 +344,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -400,6 +397,7 @@ public function __construct(array $data = null) $this->container['customerId'] = isset($data['customerId']) ? $data['customerId'] : null; $this->container['processedCompletionAt'] = isset($data['processedCompletionAt']) ? $data['processedCompletionAt'] : null; $this->container['renewalKey'] = isset($data['renewalKey']) ? $data['renewalKey'] : null; + $this->container['vatNumberValid'] = isset($data['vatNumberValid']) ? $data['vatNumberValid'] : null; } /** @@ -525,6 +523,9 @@ public function listInvalidProperties() if ($this->container['renewalKey'] === null) { $invalidProperties[] = "'renewalKey' can't be null"; } + if ($this->container['vatNumberValid'] === null) { + $invalidProperties[] = "'vatNumberValid' can't be null"; + } return $invalidProperties; } @@ -1451,6 +1452,30 @@ public function setRenewalKey($renewalKey) return $this; } + + /** + * Gets vatNumberValid + * + * @return bool + */ + public function getVatNumberValid() + { + return $this->container['vatNumberValid']; + } + + /** + * Sets vatNumberValid + * + * @param bool $vatNumberValid vatNumberValid + * + * @return $this + */ + public function setVatNumberValid($vatNumberValid) + { + $this->container['vatNumberValid'] = $vatNumberValid; + + return $this; + } /** * Returns true if offset exists. False otherwise. * @@ -1521,5 +1546,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/OrderData.php b/src/Model/OrderData.php index d6dc115..50e0b58 100644 --- a/src/Model/OrderData.php +++ b/src/Model/OrderData.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,47 +57,46 @@ class OrderData implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'id' => 'int', - 'billing' => '\Yoast\MyYoastApiClient\Model\BillingDto', - 'cartHash' => 'string', - 'cartTax' => 'string', - 'createdVia' => 'string', - 'currency' => 'string', - 'customerId' => 'int', - 'customerIpAddress' => 'string', - 'customerNote' => 'string', - 'customerUserAgent' => 'string', - 'dateCompleted' => '\DateTime', - 'dateCompletedGmt' => '\DateTime', - 'dateCreated' => '\DateTime', - 'dateCreatedGmt' => '\DateTime', - 'dateModified' => '\DateTime', - 'dateModifiedGmt' => '\DateTime', - 'datePaid' => '\DateTime', - 'datePaidGmt' => '\DateTime', - 'discountTax' => 'string', - 'discountTotal' => 'string', - 'couponLines' => '\Yoast\MyYoastApiClient\Model\CouponLineDto[]', - 'feeLines' => 'string[]', - 'lineItems' => '\Yoast\MyYoastApiClient\Model\LineItemDto[]', - 'metaData' => '\Yoast\MyYoastApiClient\Model\MetaDataDto[]', - 'number' => 'string', - 'orderKey' => 'string', - 'parentId' => 'int', - 'paymentMethod' => 'string', - 'paymentMethodTitle' => 'string', - 'pricesIncludeTax' => 'bool', - 'refunds' => 'string[]', - 'shipping' => '\Yoast\MyYoastApiClient\Model\ShippingDto', - 'shippingLines' => 'string[]', - 'shippingTax' => 'string', - 'shippingTotal' => 'string', - 'status' => 'string', - 'taxLines' => '\Yoast\MyYoastApiClient\Model\TaxLineItem[]', - 'total' => 'string', - 'totalTax' => 'string', - 'transactionId' => 'string', - 'version' => 'string' - ]; +'billing' => '\Yoast\MyYoastApiClient\Model\BillingDto', +'cartHash' => 'string', +'cartTax' => 'string', +'createdVia' => 'string', +'currency' => 'string', +'customerId' => 'int', +'customerIpAddress' => 'string', +'customerNote' => 'string', +'customerUserAgent' => 'string', +'dateCompleted' => '\DateTime', +'dateCompletedGmt' => '\DateTime', +'dateCreated' => '\DateTime', +'dateCreatedGmt' => '\DateTime', +'dateModified' => '\DateTime', +'dateModifiedGmt' => '\DateTime', +'datePaid' => '\DateTime', +'datePaidGmt' => '\DateTime', +'discountTax' => 'string', +'discountTotal' => 'string', +'couponLines' => '\Yoast\MyYoastApiClient\Model\CouponLineDto[]', +'feeLines' => '\Yoast\MyYoastApiClient\Model\FeeLineDto[]', +'lineItems' => '\Yoast\MyYoastApiClient\Model\LineItemDto[]', +'metaData' => '\Yoast\MyYoastApiClient\Model\MetaDataDto[]', +'number' => 'string', +'orderKey' => 'string', +'parentId' => 'int', +'paymentMethod' => 'string', +'paymentMethodTitle' => 'string', +'pricesIncludeTax' => 'bool', +'refunds' => 'string[]', +'shipping' => '\Yoast\MyYoastApiClient\Model\ShippingDto', +'shippingLines' => 'string[]', +'shippingTax' => 'string', +'shippingTotal' => 'string', +'status' => 'string', +'taxLines' => '\Yoast\MyYoastApiClient\Model\TaxLineItem[]', +'total' => 'string', +'totalTax' => 'string', +'transactionId' => 'string', +'version' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -107,47 +105,46 @@ class OrderData implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'id' => null, - 'billing' => null, - 'cartHash' => null, - 'cartTax' => null, - 'createdVia' => null, - 'currency' => null, - 'customerId' => null, - 'customerIpAddress' => null, - 'customerNote' => null, - 'customerUserAgent' => null, - 'dateCompleted' => 'date-time', - 'dateCompletedGmt' => 'date-time', - 'dateCreated' => 'date-time', - 'dateCreatedGmt' => 'date-time', - 'dateModified' => 'date-time', - 'dateModifiedGmt' => 'date-time', - 'datePaid' => 'date-time', - 'datePaidGmt' => 'date-time', - 'discountTax' => null, - 'discountTotal' => null, - 'couponLines' => null, - 'feeLines' => null, - 'lineItems' => null, - 'metaData' => null, - 'number' => null, - 'orderKey' => null, - 'parentId' => null, - 'paymentMethod' => null, - 'paymentMethodTitle' => null, - 'pricesIncludeTax' => null, - 'refunds' => null, - 'shipping' => null, - 'shippingLines' => null, - 'shippingTax' => null, - 'shippingTotal' => null, - 'status' => null, - 'taxLines' => null, - 'total' => null, - 'totalTax' => null, - 'transactionId' => null, - 'version' => null - ]; +'billing' => null, +'cartHash' => null, +'cartTax' => null, +'createdVia' => null, +'currency' => null, +'customerId' => null, +'customerIpAddress' => null, +'customerNote' => null, +'customerUserAgent' => null, +'dateCompleted' => 'date-time', +'dateCompletedGmt' => 'date-time', +'dateCreated' => 'date-time', +'dateCreatedGmt' => 'date-time', +'dateModified' => 'date-time', +'dateModifiedGmt' => 'date-time', +'datePaid' => 'date-time', +'datePaidGmt' => 'date-time', +'discountTax' => null, +'discountTotal' => null, +'couponLines' => null, +'feeLines' => null, +'lineItems' => null, +'metaData' => null, +'number' => null, +'orderKey' => null, +'parentId' => null, +'paymentMethod' => null, +'paymentMethodTitle' => null, +'pricesIncludeTax' => null, +'refunds' => null, +'shipping' => null, +'shippingLines' => null, +'shippingTax' => null, +'shippingTotal' => null, +'status' => null, +'taxLines' => null, +'total' => null, +'totalTax' => null, +'transactionId' => null, +'version' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -177,47 +174,46 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'id' => 'id', - 'billing' => 'billing', - 'cartHash' => 'cart_hash', - 'cartTax' => 'cart_tax', - 'createdVia' => 'created_via', - 'currency' => 'currency', - 'customerId' => 'customer_id', - 'customerIpAddress' => 'customer_ip_address', - 'customerNote' => 'customer_note', - 'customerUserAgent' => 'customer_user_agent', - 'dateCompleted' => 'date_completed', - 'dateCompletedGmt' => 'date_completed_gmt', - 'dateCreated' => 'date_created', - 'dateCreatedGmt' => 'date_created_gmt', - 'dateModified' => 'date_modified', - 'dateModifiedGmt' => 'date_modified_gmt', - 'datePaid' => 'date_paid', - 'datePaidGmt' => 'date_paid_gmt', - 'discountTax' => 'discount_tax', - 'discountTotal' => 'discount_total', - 'couponLines' => 'coupon_lines', - 'feeLines' => 'fee_lines', - 'lineItems' => 'line_items', - 'metaData' => 'meta_data', - 'number' => 'number', - 'orderKey' => 'order_key', - 'parentId' => 'parent_id', - 'paymentMethod' => 'payment_method', - 'paymentMethodTitle' => 'payment_method_title', - 'pricesIncludeTax' => 'prices_include_tax', - 'refunds' => 'refunds', - 'shipping' => 'shipping', - 'shippingLines' => 'shipping_lines', - 'shippingTax' => 'shipping_tax', - 'shippingTotal' => 'shipping_total', - 'status' => 'status', - 'taxLines' => 'tax_lines', - 'total' => 'total', - 'totalTax' => 'total_tax', - 'transactionId' => 'transaction_id', - 'version' => 'version' - ]; +'billing' => 'billing', +'cartHash' => 'cart_hash', +'cartTax' => 'cart_tax', +'createdVia' => 'created_via', +'currency' => 'currency', +'customerId' => 'customer_id', +'customerIpAddress' => 'customer_ip_address', +'customerNote' => 'customer_note', +'customerUserAgent' => 'customer_user_agent', +'dateCompleted' => 'date_completed', +'dateCompletedGmt' => 'date_completed_gmt', +'dateCreated' => 'date_created', +'dateCreatedGmt' => 'date_created_gmt', +'dateModified' => 'date_modified', +'dateModifiedGmt' => 'date_modified_gmt', +'datePaid' => 'date_paid', +'datePaidGmt' => 'date_paid_gmt', +'discountTax' => 'discount_tax', +'discountTotal' => 'discount_total', +'couponLines' => 'coupon_lines', +'feeLines' => 'fee_lines', +'lineItems' => 'line_items', +'metaData' => 'meta_data', +'number' => 'number', +'orderKey' => 'order_key', +'parentId' => 'parent_id', +'paymentMethod' => 'payment_method', +'paymentMethodTitle' => 'payment_method_title', +'pricesIncludeTax' => 'prices_include_tax', +'refunds' => 'refunds', +'shipping' => 'shipping', +'shippingLines' => 'shipping_lines', +'shippingTax' => 'shipping_tax', +'shippingTotal' => 'shipping_total', +'status' => 'status', +'taxLines' => 'tax_lines', +'total' => 'total', +'totalTax' => 'total_tax', +'transactionId' => 'transaction_id', +'version' => 'version' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -226,47 +222,46 @@ public static function swaggerFormats() */ protected static $setters = [ 'id' => 'setId', - 'billing' => 'setBilling', - 'cartHash' => 'setCartHash', - 'cartTax' => 'setCartTax', - 'createdVia' => 'setCreatedVia', - 'currency' => 'setCurrency', - 'customerId' => 'setCustomerId', - 'customerIpAddress' => 'setCustomerIpAddress', - 'customerNote' => 'setCustomerNote', - 'customerUserAgent' => 'setCustomerUserAgent', - 'dateCompleted' => 'setDateCompleted', - 'dateCompletedGmt' => 'setDateCompletedGmt', - 'dateCreated' => 'setDateCreated', - 'dateCreatedGmt' => 'setDateCreatedGmt', - 'dateModified' => 'setDateModified', - 'dateModifiedGmt' => 'setDateModifiedGmt', - 'datePaid' => 'setDatePaid', - 'datePaidGmt' => 'setDatePaidGmt', - 'discountTax' => 'setDiscountTax', - 'discountTotal' => 'setDiscountTotal', - 'couponLines' => 'setCouponLines', - 'feeLines' => 'setFeeLines', - 'lineItems' => 'setLineItems', - 'metaData' => 'setMetaData', - 'number' => 'setNumber', - 'orderKey' => 'setOrderKey', - 'parentId' => 'setParentId', - 'paymentMethod' => 'setPaymentMethod', - 'paymentMethodTitle' => 'setPaymentMethodTitle', - 'pricesIncludeTax' => 'setPricesIncludeTax', - 'refunds' => 'setRefunds', - 'shipping' => 'setShipping', - 'shippingLines' => 'setShippingLines', - 'shippingTax' => 'setShippingTax', - 'shippingTotal' => 'setShippingTotal', - 'status' => 'setStatus', - 'taxLines' => 'setTaxLines', - 'total' => 'setTotal', - 'totalTax' => 'setTotalTax', - 'transactionId' => 'setTransactionId', - 'version' => 'setVersion' - ]; +'billing' => 'setBilling', +'cartHash' => 'setCartHash', +'cartTax' => 'setCartTax', +'createdVia' => 'setCreatedVia', +'currency' => 'setCurrency', +'customerId' => 'setCustomerId', +'customerIpAddress' => 'setCustomerIpAddress', +'customerNote' => 'setCustomerNote', +'customerUserAgent' => 'setCustomerUserAgent', +'dateCompleted' => 'setDateCompleted', +'dateCompletedGmt' => 'setDateCompletedGmt', +'dateCreated' => 'setDateCreated', +'dateCreatedGmt' => 'setDateCreatedGmt', +'dateModified' => 'setDateModified', +'dateModifiedGmt' => 'setDateModifiedGmt', +'datePaid' => 'setDatePaid', +'datePaidGmt' => 'setDatePaidGmt', +'discountTax' => 'setDiscountTax', +'discountTotal' => 'setDiscountTotal', +'couponLines' => 'setCouponLines', +'feeLines' => 'setFeeLines', +'lineItems' => 'setLineItems', +'metaData' => 'setMetaData', +'number' => 'setNumber', +'orderKey' => 'setOrderKey', +'parentId' => 'setParentId', +'paymentMethod' => 'setPaymentMethod', +'paymentMethodTitle' => 'setPaymentMethodTitle', +'pricesIncludeTax' => 'setPricesIncludeTax', +'refunds' => 'setRefunds', +'shipping' => 'setShipping', +'shippingLines' => 'setShippingLines', +'shippingTax' => 'setShippingTax', +'shippingTotal' => 'setShippingTotal', +'status' => 'setStatus', +'taxLines' => 'setTaxLines', +'total' => 'setTotal', +'totalTax' => 'setTotalTax', +'transactionId' => 'setTransactionId', +'version' => 'setVersion' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -275,47 +270,46 @@ public static function swaggerFormats() */ protected static $getters = [ 'id' => 'getId', - 'billing' => 'getBilling', - 'cartHash' => 'getCartHash', - 'cartTax' => 'getCartTax', - 'createdVia' => 'getCreatedVia', - 'currency' => 'getCurrency', - 'customerId' => 'getCustomerId', - 'customerIpAddress' => 'getCustomerIpAddress', - 'customerNote' => 'getCustomerNote', - 'customerUserAgent' => 'getCustomerUserAgent', - 'dateCompleted' => 'getDateCompleted', - 'dateCompletedGmt' => 'getDateCompletedGmt', - 'dateCreated' => 'getDateCreated', - 'dateCreatedGmt' => 'getDateCreatedGmt', - 'dateModified' => 'getDateModified', - 'dateModifiedGmt' => 'getDateModifiedGmt', - 'datePaid' => 'getDatePaid', - 'datePaidGmt' => 'getDatePaidGmt', - 'discountTax' => 'getDiscountTax', - 'discountTotal' => 'getDiscountTotal', - 'couponLines' => 'getCouponLines', - 'feeLines' => 'getFeeLines', - 'lineItems' => 'getLineItems', - 'metaData' => 'getMetaData', - 'number' => 'getNumber', - 'orderKey' => 'getOrderKey', - 'parentId' => 'getParentId', - 'paymentMethod' => 'getPaymentMethod', - 'paymentMethodTitle' => 'getPaymentMethodTitle', - 'pricesIncludeTax' => 'getPricesIncludeTax', - 'refunds' => 'getRefunds', - 'shipping' => 'getShipping', - 'shippingLines' => 'getShippingLines', - 'shippingTax' => 'getShippingTax', - 'shippingTotal' => 'getShippingTotal', - 'status' => 'getStatus', - 'taxLines' => 'getTaxLines', - 'total' => 'getTotal', - 'totalTax' => 'getTotalTax', - 'transactionId' => 'getTransactionId', - 'version' => 'getVersion' - ]; +'billing' => 'getBilling', +'cartHash' => 'getCartHash', +'cartTax' => 'getCartTax', +'createdVia' => 'getCreatedVia', +'currency' => 'getCurrency', +'customerId' => 'getCustomerId', +'customerIpAddress' => 'getCustomerIpAddress', +'customerNote' => 'getCustomerNote', +'customerUserAgent' => 'getCustomerUserAgent', +'dateCompleted' => 'getDateCompleted', +'dateCompletedGmt' => 'getDateCompletedGmt', +'dateCreated' => 'getDateCreated', +'dateCreatedGmt' => 'getDateCreatedGmt', +'dateModified' => 'getDateModified', +'dateModifiedGmt' => 'getDateModifiedGmt', +'datePaid' => 'getDatePaid', +'datePaidGmt' => 'getDatePaidGmt', +'discountTax' => 'getDiscountTax', +'discountTotal' => 'getDiscountTotal', +'couponLines' => 'getCouponLines', +'feeLines' => 'getFeeLines', +'lineItems' => 'getLineItems', +'metaData' => 'getMetaData', +'number' => 'getNumber', +'orderKey' => 'getOrderKey', +'parentId' => 'getParentId', +'paymentMethod' => 'getPaymentMethod', +'paymentMethodTitle' => 'getPaymentMethodTitle', +'pricesIncludeTax' => 'getPricesIncludeTax', +'refunds' => 'getRefunds', +'shipping' => 'getShipping', +'shippingLines' => 'getShippingLines', +'shippingTax' => 'getShippingTax', +'shippingTotal' => 'getShippingTotal', +'status' => 'getStatus', +'taxLines' => 'getTaxLines', +'total' => 'getTotal', +'totalTax' => 'getTotalTax', +'transactionId' => 'getTransactionId', +'version' => 'getVersion' ]; /** * Array of attributes where the key is the local name, @@ -360,8 +354,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -1053,7 +1045,7 @@ public function setCouponLines($couponLines) /** * Gets feeLines * - * @return string[] + * @return \Yoast\MyYoastApiClient\Model\FeeLineDto[] */ public function getFeeLines() { @@ -1063,7 +1055,7 @@ public function getFeeLines() /** * Sets feeLines * - * @param string[] $feeLines feeLines + * @param \Yoast\MyYoastApiClient\Model\FeeLineDto[] $feeLines feeLines * * @return $this */ @@ -1599,5 +1591,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/OrderFromWooDto.php b/src/Model/OrderFromWooDto.php index d9117c0..7c74a76 100644 --- a/src/Model/OrderFromWooDto.php +++ b/src/Model/OrderFromWooDto.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,8 +57,7 @@ class OrderFromWooDto implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'orderData' => '\Yoast\MyYoastApiClient\Model\OrderData', - 'extraData' => '\Yoast\MyYoastApiClient\Model\ExtraOrderData' - ]; +'extraData' => '\Yoast\MyYoastApiClient\Model\ExtraOrderData' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -68,8 +66,7 @@ class OrderFromWooDto implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'orderData' => null, - 'extraData' => null - ]; +'extraData' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -99,8 +96,7 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'orderData' => 'orderData', - 'extraData' => 'extraData' - ]; +'extraData' => 'extraData' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -109,8 +105,7 @@ public static function swaggerFormats() */ protected static $setters = [ 'orderData' => 'setOrderData', - 'extraData' => 'setExtraData' - ]; +'extraData' => 'setExtraData' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -119,8 +114,7 @@ public static function swaggerFormats() */ protected static $getters = [ 'orderData' => 'getOrderData', - 'extraData' => 'getExtraData' - ]; +'extraData' => 'getExtraData' ]; /** * Array of attributes where the key is the local name, @@ -165,8 +159,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -333,5 +325,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/Product.php b/src/Model/Product.php index 27dcaab..0558a65 100644 --- a/src/Model/Product.php +++ b/src/Model/Product.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,31 +57,30 @@ class Product implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'id' => 'string', - 'name' => 'string', - 'storeUrl' => 'string', - 'downloads' => '\Yoast\MyYoastApiClient\Model\ProductDownload[]', - 'glNumber' => 'string', - 'isDownloadOnly' => 'bool', - 'icon' => 'string', - 'sourceId' => 'int', - 'sourceShopId' => 'int', - 'shopProductType' => 'string', - 'shopStatus' => 'string', - 'price' => 'int', - 'shopRegularPrice' => 'int', - 'shopTaxStatus' => 'string', - 'shopTaxClass' => 'string', - 'currentVersion' => 'string', - 'changelog' => 'string', - 'type' => 'string', - 'currency' => 'string', - 'createdAt' => '\DateTime', - 'modifiedAt' => '\DateTime', - 'billingTerm' => 'string', - 'billingType' => 'string', - 'activationLimit' => 'int', - 'courseId' => 'string' - ]; +'name' => 'string', +'storeUrl' => 'string', +'downloads' => '\Yoast\MyYoastApiClient\Model\ProductDownload[]', +'glNumber' => 'string', +'isDownloadOnly' => 'bool', +'icon' => 'string', +'sourceId' => 'int', +'sourceShopId' => 'int', +'shopProductType' => 'string', +'shopStatus' => 'string', +'price' => 'int', +'shopRegularPrice' => 'int', +'shopTaxStatus' => 'string', +'shopTaxClass' => 'string', +'currentVersion' => 'string', +'changelog' => 'string', +'type' => 'string', +'currency' => 'string', +'createdAt' => '\DateTime', +'modifiedAt' => '\DateTime', +'billingTerm' => 'string', +'billingType' => 'string', +'activationLimit' => 'int', +'courseId' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -91,31 +89,30 @@ class Product implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'id' => null, - 'name' => null, - 'storeUrl' => null, - 'downloads' => null, - 'glNumber' => null, - 'isDownloadOnly' => null, - 'icon' => null, - 'sourceId' => null, - 'sourceShopId' => null, - 'shopProductType' => null, - 'shopStatus' => null, - 'price' => null, - 'shopRegularPrice' => null, - 'shopTaxStatus' => null, - 'shopTaxClass' => null, - 'currentVersion' => null, - 'changelog' => null, - 'type' => null, - 'currency' => null, - 'createdAt' => 'date-time', - 'modifiedAt' => 'date-time', - 'billingTerm' => null, - 'billingType' => null, - 'activationLimit' => null, - 'courseId' => 'uuid' - ]; +'name' => null, +'storeUrl' => null, +'downloads' => null, +'glNumber' => null, +'isDownloadOnly' => null, +'icon' => null, +'sourceId' => null, +'sourceShopId' => null, +'shopProductType' => null, +'shopStatus' => null, +'price' => null, +'shopRegularPrice' => null, +'shopTaxStatus' => null, +'shopTaxClass' => null, +'currentVersion' => null, +'changelog' => null, +'type' => null, +'currency' => null, +'createdAt' => 'date-time', +'modifiedAt' => 'date-time', +'billingTerm' => null, +'billingType' => null, +'activationLimit' => null, +'courseId' => 'uuid' ]; /** * Array of property to type mappings. Used for (de)serialization @@ -145,31 +142,30 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'id' => 'id', - 'name' => 'name', - 'storeUrl' => 'storeUrl', - 'downloads' => 'downloads', - 'glNumber' => 'glNumber', - 'isDownloadOnly' => 'isDownloadOnly', - 'icon' => 'icon', - 'sourceId' => 'sourceId', - 'sourceShopId' => 'sourceShopId', - 'shopProductType' => 'shopProductType', - 'shopStatus' => 'shopStatus', - 'price' => 'price', - 'shopRegularPrice' => 'shopRegularPrice', - 'shopTaxStatus' => 'shopTaxStatus', - 'shopTaxClass' => 'shopTaxClass', - 'currentVersion' => 'currentVersion', - 'changelog' => 'changelog', - 'type' => 'type', - 'currency' => 'currency', - 'createdAt' => 'createdAt', - 'modifiedAt' => 'modifiedAt', - 'billingTerm' => 'billingTerm', - 'billingType' => 'billingType', - 'activationLimit' => 'activationLimit', - 'courseId' => 'courseId' - ]; +'name' => 'name', +'storeUrl' => 'storeUrl', +'downloads' => 'downloads', +'glNumber' => 'glNumber', +'isDownloadOnly' => 'isDownloadOnly', +'icon' => 'icon', +'sourceId' => 'sourceId', +'sourceShopId' => 'sourceShopId', +'shopProductType' => 'shopProductType', +'shopStatus' => 'shopStatus', +'price' => 'price', +'shopRegularPrice' => 'shopRegularPrice', +'shopTaxStatus' => 'shopTaxStatus', +'shopTaxClass' => 'shopTaxClass', +'currentVersion' => 'currentVersion', +'changelog' => 'changelog', +'type' => 'type', +'currency' => 'currency', +'createdAt' => 'createdAt', +'modifiedAt' => 'modifiedAt', +'billingTerm' => 'billingTerm', +'billingType' => 'billingType', +'activationLimit' => 'activationLimit', +'courseId' => 'courseId' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -178,31 +174,30 @@ public static function swaggerFormats() */ protected static $setters = [ 'id' => 'setId', - 'name' => 'setName', - 'storeUrl' => 'setStoreUrl', - 'downloads' => 'setDownloads', - 'glNumber' => 'setGlNumber', - 'isDownloadOnly' => 'setIsDownloadOnly', - 'icon' => 'setIcon', - 'sourceId' => 'setSourceId', - 'sourceShopId' => 'setSourceShopId', - 'shopProductType' => 'setShopProductType', - 'shopStatus' => 'setShopStatus', - 'price' => 'setPrice', - 'shopRegularPrice' => 'setShopRegularPrice', - 'shopTaxStatus' => 'setShopTaxStatus', - 'shopTaxClass' => 'setShopTaxClass', - 'currentVersion' => 'setCurrentVersion', - 'changelog' => 'setChangelog', - 'type' => 'setType', - 'currency' => 'setCurrency', - 'createdAt' => 'setCreatedAt', - 'modifiedAt' => 'setModifiedAt', - 'billingTerm' => 'setBillingTerm', - 'billingType' => 'setBillingType', - 'activationLimit' => 'setActivationLimit', - 'courseId' => 'setCourseId' - ]; +'name' => 'setName', +'storeUrl' => 'setStoreUrl', +'downloads' => 'setDownloads', +'glNumber' => 'setGlNumber', +'isDownloadOnly' => 'setIsDownloadOnly', +'icon' => 'setIcon', +'sourceId' => 'setSourceId', +'sourceShopId' => 'setSourceShopId', +'shopProductType' => 'setShopProductType', +'shopStatus' => 'setShopStatus', +'price' => 'setPrice', +'shopRegularPrice' => 'setShopRegularPrice', +'shopTaxStatus' => 'setShopTaxStatus', +'shopTaxClass' => 'setShopTaxClass', +'currentVersion' => 'setCurrentVersion', +'changelog' => 'setChangelog', +'type' => 'setType', +'currency' => 'setCurrency', +'createdAt' => 'setCreatedAt', +'modifiedAt' => 'setModifiedAt', +'billingTerm' => 'setBillingTerm', +'billingType' => 'setBillingType', +'activationLimit' => 'setActivationLimit', +'courseId' => 'setCourseId' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -211,31 +206,30 @@ public static function swaggerFormats() */ protected static $getters = [ 'id' => 'getId', - 'name' => 'getName', - 'storeUrl' => 'getStoreUrl', - 'downloads' => 'getDownloads', - 'glNumber' => 'getGlNumber', - 'isDownloadOnly' => 'getIsDownloadOnly', - 'icon' => 'getIcon', - 'sourceId' => 'getSourceId', - 'sourceShopId' => 'getSourceShopId', - 'shopProductType' => 'getShopProductType', - 'shopStatus' => 'getShopStatus', - 'price' => 'getPrice', - 'shopRegularPrice' => 'getShopRegularPrice', - 'shopTaxStatus' => 'getShopTaxStatus', - 'shopTaxClass' => 'getShopTaxClass', - 'currentVersion' => 'getCurrentVersion', - 'changelog' => 'getChangelog', - 'type' => 'getType', - 'currency' => 'getCurrency', - 'createdAt' => 'getCreatedAt', - 'modifiedAt' => 'getModifiedAt', - 'billingTerm' => 'getBillingTerm', - 'billingType' => 'getBillingType', - 'activationLimit' => 'getActivationLimit', - 'courseId' => 'getCourseId' - ]; +'name' => 'getName', +'storeUrl' => 'getStoreUrl', +'downloads' => 'getDownloads', +'glNumber' => 'getGlNumber', +'isDownloadOnly' => 'getIsDownloadOnly', +'icon' => 'getIcon', +'sourceId' => 'getSourceId', +'sourceShopId' => 'getSourceShopId', +'shopProductType' => 'getShopProductType', +'shopStatus' => 'getShopStatus', +'price' => 'getPrice', +'shopRegularPrice' => 'getShopRegularPrice', +'shopTaxStatus' => 'getShopTaxStatus', +'shopTaxClass' => 'getShopTaxClass', +'currentVersion' => 'getCurrentVersion', +'changelog' => 'getChangelog', +'type' => 'getType', +'currency' => 'getCurrency', +'createdAt' => 'getCreatedAt', +'modifiedAt' => 'getModifiedAt', +'billingTerm' => 'getBillingTerm', +'billingType' => 'getBillingType', +'activationLimit' => 'getActivationLimit', +'courseId' => 'getCourseId' ]; /** * Array of attributes where the key is the local name, @@ -280,8 +274,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -1089,5 +1081,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/ProductCategory.php b/src/Model/ProductCategory.php index 0ec6ad4..58b78fe 100644 --- a/src/Model/ProductCategory.php +++ b/src/Model/ProductCategory.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,9 +57,8 @@ class ProductCategory implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'id' => 'int', - 'name' => 'string', - 'slug' => 'string' - ]; +'name' => 'string', +'slug' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -69,9 +67,8 @@ class ProductCategory implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'id' => null, - 'name' => null, - 'slug' => null - ]; +'name' => null, +'slug' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -101,9 +98,8 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'id' => 'id', - 'name' => 'name', - 'slug' => 'slug' - ]; +'name' => 'name', +'slug' => 'slug' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -112,9 +108,8 @@ public static function swaggerFormats() */ protected static $setters = [ 'id' => 'setId', - 'name' => 'setName', - 'slug' => 'setSlug' - ]; +'name' => 'setName', +'slug' => 'setSlug' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -123,9 +118,8 @@ public static function swaggerFormats() */ protected static $getters = [ 'id' => 'getId', - 'name' => 'getName', - 'slug' => 'getSlug' - ]; +'name' => 'getName', +'slug' => 'getSlug' ]; /** * Array of attributes where the key is the local name, @@ -170,8 +164,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -366,5 +358,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/ProductData.php b/src/Model/ProductData.php index 555b85a..1193788 100644 --- a/src/Model/ProductData.php +++ b/src/Model/ProductData.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,22 +57,21 @@ class ProductData implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'metaData' => '\Yoast\MyYoastApiClient\Model\MetaDataDto[]', - 'images' => '\Yoast\MyYoastApiClient\Model\ProductImage[]', - 'id' => 'int', - 'name' => 'string', - 'description' => 'string', - 'permalink' => 'string', - 'downloads' => '\Yoast\MyYoastApiClient\Model\ProductDownload[]', - 'sku' => 'string', - 'type' => 'string', - 'status' => 'string', - 'regularPrice' => 'string', - 'price' => 'string', - 'purchasable' => 'bool', - 'taxStatus' => 'string', - 'taxClass' => 'string', - 'categories' => '\Yoast\MyYoastApiClient\Model\ProductCategory[]' - ]; +'images' => '\Yoast\MyYoastApiClient\Model\ProductImage[]', +'id' => 'int', +'name' => 'string', +'description' => 'string', +'permalink' => 'string', +'downloads' => '\Yoast\MyYoastApiClient\Model\ProductDownload[]', +'sku' => 'string', +'type' => 'string', +'status' => 'string', +'regularPrice' => 'string', +'price' => 'string', +'purchasable' => 'bool', +'taxStatus' => 'string', +'taxClass' => 'string', +'categories' => '\Yoast\MyYoastApiClient\Model\ProductCategory[]' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -82,22 +80,21 @@ class ProductData implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'metaData' => null, - 'images' => null, - 'id' => null, - 'name' => null, - 'description' => null, - 'permalink' => null, - 'downloads' => null, - 'sku' => null, - 'type' => null, - 'status' => null, - 'regularPrice' => null, - 'price' => null, - 'purchasable' => null, - 'taxStatus' => null, - 'taxClass' => null, - 'categories' => null - ]; +'images' => null, +'id' => null, +'name' => null, +'description' => null, +'permalink' => null, +'downloads' => null, +'sku' => null, +'type' => null, +'status' => null, +'regularPrice' => null, +'price' => null, +'purchasable' => null, +'taxStatus' => null, +'taxClass' => null, +'categories' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -127,22 +124,21 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'metaData' => 'meta_data', - 'images' => 'images', - 'id' => 'id', - 'name' => 'name', - 'description' => 'description', - 'permalink' => 'permalink', - 'downloads' => 'downloads', - 'sku' => 'sku', - 'type' => 'type', - 'status' => 'status', - 'regularPrice' => 'regular_price', - 'price' => 'price', - 'purchasable' => 'purchasable', - 'taxStatus' => 'tax_status', - 'taxClass' => 'tax_class', - 'categories' => 'categories' - ]; +'images' => 'images', +'id' => 'id', +'name' => 'name', +'description' => 'description', +'permalink' => 'permalink', +'downloads' => 'downloads', +'sku' => 'sku', +'type' => 'type', +'status' => 'status', +'regularPrice' => 'regular_price', +'price' => 'price', +'purchasable' => 'purchasable', +'taxStatus' => 'tax_status', +'taxClass' => 'tax_class', +'categories' => 'categories' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -151,22 +147,21 @@ public static function swaggerFormats() */ protected static $setters = [ 'metaData' => 'setMetaData', - 'images' => 'setImages', - 'id' => 'setId', - 'name' => 'setName', - 'description' => 'setDescription', - 'permalink' => 'setPermalink', - 'downloads' => 'setDownloads', - 'sku' => 'setSku', - 'type' => 'setType', - 'status' => 'setStatus', - 'regularPrice' => 'setRegularPrice', - 'price' => 'setPrice', - 'purchasable' => 'setPurchasable', - 'taxStatus' => 'setTaxStatus', - 'taxClass' => 'setTaxClass', - 'categories' => 'setCategories' - ]; +'images' => 'setImages', +'id' => 'setId', +'name' => 'setName', +'description' => 'setDescription', +'permalink' => 'setPermalink', +'downloads' => 'setDownloads', +'sku' => 'setSku', +'type' => 'setType', +'status' => 'setStatus', +'regularPrice' => 'setRegularPrice', +'price' => 'setPrice', +'purchasable' => 'setPurchasable', +'taxStatus' => 'setTaxStatus', +'taxClass' => 'setTaxClass', +'categories' => 'setCategories' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -175,22 +170,21 @@ public static function swaggerFormats() */ protected static $getters = [ 'metaData' => 'getMetaData', - 'images' => 'getImages', - 'id' => 'getId', - 'name' => 'getName', - 'description' => 'getDescription', - 'permalink' => 'getPermalink', - 'downloads' => 'getDownloads', - 'sku' => 'getSku', - 'type' => 'getType', - 'status' => 'getStatus', - 'regularPrice' => 'getRegularPrice', - 'price' => 'getPrice', - 'purchasable' => 'getPurchasable', - 'taxStatus' => 'getTaxStatus', - 'taxClass' => 'getTaxClass', - 'categories' => 'getCategories' - ]; +'images' => 'getImages', +'id' => 'getId', +'name' => 'getName', +'description' => 'getDescription', +'permalink' => 'getPermalink', +'downloads' => 'getDownloads', +'sku' => 'getSku', +'type' => 'getType', +'status' => 'getStatus', +'regularPrice' => 'getRegularPrice', +'price' => 'getPrice', +'purchasable' => 'getPurchasable', +'taxStatus' => 'getTaxStatus', +'taxClass' => 'getTaxClass', +'categories' => 'getCategories' ]; /** * Array of attributes where the key is the local name, @@ -235,8 +229,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -795,5 +787,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/ProductDownload.php b/src/Model/ProductDownload.php index c8f62e0..6ccb084 100644 --- a/src/Model/ProductDownload.php +++ b/src/Model/ProductDownload.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,9 +57,8 @@ class ProductDownload implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'id' => 'string', - 'name' => 'string', - 'file' => 'string' - ]; +'name' => 'string', +'file' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -69,9 +67,8 @@ class ProductDownload implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'id' => null, - 'name' => null, - 'file' => null - ]; +'name' => null, +'file' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -101,9 +98,8 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'id' => 'id', - 'name' => 'name', - 'file' => 'file' - ]; +'name' => 'name', +'file' => 'file' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -112,9 +108,8 @@ public static function swaggerFormats() */ protected static $setters = [ 'id' => 'setId', - 'name' => 'setName', - 'file' => 'setFile' - ]; +'name' => 'setName', +'file' => 'setFile' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -123,9 +118,8 @@ public static function swaggerFormats() */ protected static $getters = [ 'id' => 'getId', - 'name' => 'getName', - 'file' => 'getFile' - ]; +'name' => 'getName', +'file' => 'getFile' ]; /** * Array of attributes where the key is the local name, @@ -170,8 +164,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -366,5 +358,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/ProductFromWooDto.php b/src/Model/ProductFromWooDto.php index 06edbc4..611ec83 100644 --- a/src/Model/ProductFromWooDto.php +++ b/src/Model/ProductFromWooDto.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,8 +57,7 @@ class ProductFromWooDto implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'productData' => '\Yoast\MyYoastApiClient\Model\ProductData', - 'extraData' => '\Yoast\MyYoastApiClient\Model\ExtraProductData' - ]; +'extraData' => '\Yoast\MyYoastApiClient\Model\ExtraProductData' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -68,8 +66,7 @@ class ProductFromWooDto implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'productData' => null, - 'extraData' => null - ]; +'extraData' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -99,8 +96,7 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'productData' => 'productData', - 'extraData' => 'extraData' - ]; +'extraData' => 'extraData' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -109,8 +105,7 @@ public static function swaggerFormats() */ protected static $setters = [ 'productData' => 'setProductData', - 'extraData' => 'setExtraData' - ]; +'extraData' => 'setExtraData' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -119,8 +114,7 @@ public static function swaggerFormats() */ protected static $getters = [ 'productData' => 'getProductData', - 'extraData' => 'getExtraData' - ]; +'extraData' => 'getExtraData' ]; /** * Array of attributes where the key is the local name, @@ -165,8 +159,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -333,5 +325,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/ProductGroup.php b/src/Model/ProductGroup.php index 7cf60ee..308b882 100644 --- a/src/Model/ProductGroup.php +++ b/src/Model/ProductGroup.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,18 +57,17 @@ class ProductGroup implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'id' => 'string', - 'updatedAt' => '\DateTime', - 'createdAt' => '\DateTime', - 'name' => 'string', - 'slug' => 'string', - 'description' => 'string', - 'icon' => 'string', - 'svgIcon' => 'string', - 'changelog' => 'string', - 'version' => 'string', - 'courseId' => 'string', - 'parentId' => 'string' - ]; +'updatedAt' => '\DateTime', +'createdAt' => '\DateTime', +'name' => 'string', +'slug' => 'string', +'description' => 'string', +'icon' => 'string', +'svgIcon' => 'string', +'changelog' => 'string', +'version' => 'string', +'courseId' => 'string', +'parentId' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -77,19 +75,18 @@ class ProductGroup implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerFormats = [ - 'id' => null, - 'updatedAt' => 'date-time', - 'createdAt' => 'date-time', - 'name' => null, - 'slug' => null, - 'description' => null, - 'icon' => null, - 'svgIcon' => null, - 'changelog' => null, - 'version' => null, - 'courseId' => 'uuid', - 'parentId' => 'uuid' - ]; + 'id' => 'uuid', +'updatedAt' => 'date-time', +'createdAt' => 'date-time', +'name' => null, +'slug' => null, +'description' => null, +'icon' => null, +'svgIcon' => null, +'changelog' => null, +'version' => null, +'courseId' => 'uuid', +'parentId' => 'uuid' ]; /** * Array of property to type mappings. Used for (de)serialization @@ -119,18 +116,17 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'id' => 'id', - 'updatedAt' => 'updatedAt', - 'createdAt' => 'createdAt', - 'name' => 'name', - 'slug' => 'slug', - 'description' => 'description', - 'icon' => 'icon', - 'svgIcon' => 'svgIcon', - 'changelog' => 'changelog', - 'version' => 'version', - 'courseId' => 'courseId', - 'parentId' => 'parentId' - ]; +'updatedAt' => 'updatedAt', +'createdAt' => 'createdAt', +'name' => 'name', +'slug' => 'slug', +'description' => 'description', +'icon' => 'icon', +'svgIcon' => 'svgIcon', +'changelog' => 'changelog', +'version' => 'version', +'courseId' => 'courseId', +'parentId' => 'parentId' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -139,18 +135,17 @@ public static function swaggerFormats() */ protected static $setters = [ 'id' => 'setId', - 'updatedAt' => 'setUpdatedAt', - 'createdAt' => 'setCreatedAt', - 'name' => 'setName', - 'slug' => 'setSlug', - 'description' => 'setDescription', - 'icon' => 'setIcon', - 'svgIcon' => 'setSvgIcon', - 'changelog' => 'setChangelog', - 'version' => 'setVersion', - 'courseId' => 'setCourseId', - 'parentId' => 'setParentId' - ]; +'updatedAt' => 'setUpdatedAt', +'createdAt' => 'setCreatedAt', +'name' => 'setName', +'slug' => 'setSlug', +'description' => 'setDescription', +'icon' => 'setIcon', +'svgIcon' => 'setSvgIcon', +'changelog' => 'setChangelog', +'version' => 'setVersion', +'courseId' => 'setCourseId', +'parentId' => 'setParentId' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -159,18 +154,17 @@ public static function swaggerFormats() */ protected static $getters = [ 'id' => 'getId', - 'updatedAt' => 'getUpdatedAt', - 'createdAt' => 'getCreatedAt', - 'name' => 'getName', - 'slug' => 'getSlug', - 'description' => 'getDescription', - 'icon' => 'getIcon', - 'svgIcon' => 'getSvgIcon', - 'changelog' => 'getChangelog', - 'version' => 'getVersion', - 'courseId' => 'getCourseId', - 'parentId' => 'getParentId' - ]; +'updatedAt' => 'getUpdatedAt', +'createdAt' => 'getCreatedAt', +'name' => 'getName', +'slug' => 'getSlug', +'description' => 'getDescription', +'icon' => 'getIcon', +'svgIcon' => 'getSvgIcon', +'changelog' => 'getChangelog', +'version' => 'getVersion', +'courseId' => 'getCourseId', +'parentId' => 'getParentId' ]; /** * Array of attributes where the key is the local name, @@ -215,8 +209,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -663,5 +655,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/ProductGroupExtraData.php b/src/Model/ProductGroupExtraData.php index 3f15b92..0162df6 100644 --- a/src/Model/ProductGroupExtraData.php +++ b/src/Model/ProductGroupExtraData.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,9 +57,8 @@ class ProductGroupExtraData implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'parentSlug' => 'string', - 'icon' => 'string', - 'changelog' => 'string' - ]; +'icon' => 'string', +'changelog' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -69,9 +67,8 @@ class ProductGroupExtraData implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'parentSlug' => null, - 'icon' => null, - 'changelog' => null - ]; +'icon' => null, +'changelog' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -101,9 +98,8 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'parentSlug' => 'parent_slug', - 'icon' => 'icon', - 'changelog' => 'changelog' - ]; +'icon' => 'icon', +'changelog' => 'changelog' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -112,9 +108,8 @@ public static function swaggerFormats() */ protected static $setters = [ 'parentSlug' => 'setParentSlug', - 'icon' => 'setIcon', - 'changelog' => 'setChangelog' - ]; +'icon' => 'setIcon', +'changelog' => 'setChangelog' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -123,9 +118,8 @@ public static function swaggerFormats() */ protected static $getters = [ 'parentSlug' => 'getParentSlug', - 'icon' => 'getIcon', - 'changelog' => 'getChangelog' - ]; +'icon' => 'getIcon', +'changelog' => 'getChangelog' ]; /** * Array of attributes where the key is the local name, @@ -170,8 +164,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -366,5 +358,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/ProductGroupFromWooDto.php b/src/Model/ProductGroupFromWooDto.php index 7db586c..7205e55 100644 --- a/src/Model/ProductGroupFromWooDto.php +++ b/src/Model/ProductGroupFromWooDto.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,9 +57,8 @@ class ProductGroupFromWooDto implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'productGroupTerm' => '\Yoast\MyYoastApiClient\Model\ProductGroupTerm', - 'productGroupMeta' => '\Yoast\MyYoastApiClient\Model\ProductGroupMeta', - 'extraData' => '\Yoast\MyYoastApiClient\Model\ProductGroupExtraData' - ]; +'productGroupMeta' => '\Yoast\MyYoastApiClient\Model\ProductGroupMeta', +'extraData' => '\Yoast\MyYoastApiClient\Model\ProductGroupExtraData' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -69,9 +67,8 @@ class ProductGroupFromWooDto implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'productGroupTerm' => null, - 'productGroupMeta' => null, - 'extraData' => null - ]; +'productGroupMeta' => null, +'extraData' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -101,9 +98,8 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'productGroupTerm' => 'productGroupTerm', - 'productGroupMeta' => 'productGroupMeta', - 'extraData' => 'extraData' - ]; +'productGroupMeta' => 'productGroupMeta', +'extraData' => 'extraData' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -112,9 +108,8 @@ public static function swaggerFormats() */ protected static $setters = [ 'productGroupTerm' => 'setProductGroupTerm', - 'productGroupMeta' => 'setProductGroupMeta', - 'extraData' => 'setExtraData' - ]; +'productGroupMeta' => 'setProductGroupMeta', +'extraData' => 'setExtraData' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -123,9 +118,8 @@ public static function swaggerFormats() */ protected static $getters = [ 'productGroupTerm' => 'getProductGroupTerm', - 'productGroupMeta' => 'getProductGroupMeta', - 'extraData' => 'getExtraData' - ]; +'productGroupMeta' => 'getProductGroupMeta', +'extraData' => 'getExtraData' ]; /** * Array of attributes where the key is the local name, @@ -170,8 +164,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -366,5 +358,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/ProductGroupMeta.php b/src/Model/ProductGroupMeta.php index 0abc254..880fee1 100644 --- a/src/Model/ProductGroupMeta.php +++ b/src/Model/ProductGroupMeta.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,9 +57,8 @@ class ProductGroupMeta implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'courseId' => 'string', - 'svgIcon' => 'string', - 'version' => 'string' - ]; +'svgIcon' => 'string', +'version' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -69,9 +67,8 @@ class ProductGroupMeta implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'courseId' => null, - 'svgIcon' => null, - 'version' => null - ]; +'svgIcon' => null, +'version' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -101,9 +98,8 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'courseId' => 'course_id', - 'svgIcon' => 'svg_icon', - 'version' => 'version' - ]; +'svgIcon' => 'svg_icon', +'version' => 'version' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -112,9 +108,8 @@ public static function swaggerFormats() */ protected static $setters = [ 'courseId' => 'setCourseId', - 'svgIcon' => 'setSvgIcon', - 'version' => 'setVersion' - ]; +'svgIcon' => 'setSvgIcon', +'version' => 'setVersion' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -123,9 +118,8 @@ public static function swaggerFormats() */ protected static $getters = [ 'courseId' => 'getCourseId', - 'svgIcon' => 'getSvgIcon', - 'version' => 'getVersion' - ]; +'svgIcon' => 'getSvgIcon', +'version' => 'getVersion' ]; /** * Array of attributes where the key is the local name, @@ -170,8 +164,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -366,5 +358,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/ProductGroupTerm.php b/src/Model/ProductGroupTerm.php index c85eaa3..dc49390 100644 --- a/src/Model/ProductGroupTerm.php +++ b/src/Model/ProductGroupTerm.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,9 +57,8 @@ class ProductGroupTerm implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'name' => 'string', - 'slug' => 'string', - 'description' => 'string' - ]; +'slug' => 'string', +'description' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -69,9 +67,8 @@ class ProductGroupTerm implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'name' => null, - 'slug' => null, - 'description' => null - ]; +'slug' => null, +'description' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -101,9 +98,8 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'name' => 'name', - 'slug' => 'slug', - 'description' => 'description' - ]; +'slug' => 'slug', +'description' => 'description' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -112,9 +108,8 @@ public static function swaggerFormats() */ protected static $setters = [ 'name' => 'setName', - 'slug' => 'setSlug', - 'description' => 'setDescription' - ]; +'slug' => 'setSlug', +'description' => 'setDescription' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -123,9 +118,8 @@ public static function swaggerFormats() */ protected static $getters = [ 'name' => 'getName', - 'slug' => 'getSlug', - 'description' => 'getDescription' - ]; +'slug' => 'getSlug', +'description' => 'getDescription' ]; /** * Array of attributes where the key is the local name, @@ -170,8 +164,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -366,5 +358,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/ProductImage.php b/src/Model/ProductImage.php index 31bde71..c1285cd 100644 --- a/src/Model/ProductImage.php +++ b/src/Model/ProductImage.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,15 +57,14 @@ class ProductImage implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'id' => 'int', - 'dateCreated' => '\DateTime', - 'dateCreatedGmt' => '\DateTime', - 'dateModified' => '\DateTime', - 'dateModifiedGmt' => '\DateTime', - 'src' => 'string', - 'name' => 'string', - 'alt' => 'string', - 'position' => 'int' - ]; +'dateCreated' => '\DateTime', +'dateCreatedGmt' => '\DateTime', +'dateModified' => '\DateTime', +'dateModifiedGmt' => '\DateTime', +'src' => 'string', +'name' => 'string', +'alt' => 'string', +'position' => 'int' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -75,15 +73,14 @@ class ProductImage implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'id' => null, - 'dateCreated' => 'date-time', - 'dateCreatedGmt' => 'date-time', - 'dateModified' => 'date-time', - 'dateModifiedGmt' => 'date-time', - 'src' => null, - 'name' => null, - 'alt' => null, - 'position' => null - ]; +'dateCreated' => 'date-time', +'dateCreatedGmt' => 'date-time', +'dateModified' => 'date-time', +'dateModifiedGmt' => 'date-time', +'src' => null, +'name' => null, +'alt' => null, +'position' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -113,15 +110,14 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'id' => 'id', - 'dateCreated' => 'date_created', - 'dateCreatedGmt' => 'date_created_gmt', - 'dateModified' => 'date_modified', - 'dateModifiedGmt' => 'date_modified_gmt', - 'src' => 'src', - 'name' => 'name', - 'alt' => 'alt', - 'position' => 'position' - ]; +'dateCreated' => 'date_created', +'dateCreatedGmt' => 'date_created_gmt', +'dateModified' => 'date_modified', +'dateModifiedGmt' => 'date_modified_gmt', +'src' => 'src', +'name' => 'name', +'alt' => 'alt', +'position' => 'position' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -130,15 +126,14 @@ public static function swaggerFormats() */ protected static $setters = [ 'id' => 'setId', - 'dateCreated' => 'setDateCreated', - 'dateCreatedGmt' => 'setDateCreatedGmt', - 'dateModified' => 'setDateModified', - 'dateModifiedGmt' => 'setDateModifiedGmt', - 'src' => 'setSrc', - 'name' => 'setName', - 'alt' => 'setAlt', - 'position' => 'setPosition' - ]; +'dateCreated' => 'setDateCreated', +'dateCreatedGmt' => 'setDateCreatedGmt', +'dateModified' => 'setDateModified', +'dateModifiedGmt' => 'setDateModifiedGmt', +'src' => 'setSrc', +'name' => 'setName', +'alt' => 'setAlt', +'position' => 'setPosition' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -147,15 +142,14 @@ public static function swaggerFormats() */ protected static $getters = [ 'id' => 'getId', - 'dateCreated' => 'getDateCreated', - 'dateCreatedGmt' => 'getDateCreatedGmt', - 'dateModified' => 'getDateModified', - 'dateModifiedGmt' => 'getDateModifiedGmt', - 'src' => 'getSrc', - 'name' => 'getName', - 'alt' => 'getAlt', - 'position' => 'getPosition' - ]; +'dateCreated' => 'getDateCreated', +'dateCreatedGmt' => 'getDateCreatedGmt', +'dateModified' => 'getDateModified', +'dateModifiedGmt' => 'getDateModifiedGmt', +'src' => 'getSrc', +'name' => 'getName', +'alt' => 'getAlt', +'position' => 'getPosition' ]; /** * Array of attributes where the key is the local name, @@ -200,8 +194,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -564,5 +556,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/ProgressData.php b/src/Model/ProgressData.php index 31db68e..7ebeaa0 100644 --- a/src/Model/ProgressData.php +++ b/src/Model/ProgressData.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,13 +57,12 @@ class ProgressData implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'status' => 'string', - 'progress' => 'int', - 'outsideTrialProgress' => 'bool', - 'studentId' => 'int', - 'courseId' => 'int', - 'isTrial' => 'bool', - 'trialCompleted' => 'bool' - ]; +'progress' => 'int', +'outsideTrialProgress' => 'bool', +'studentId' => 'int', +'courseId' => 'int', +'isTrial' => 'bool', +'trialCompleted' => 'bool' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -73,13 +71,12 @@ class ProgressData implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'status' => null, - 'progress' => null, - 'outsideTrialProgress' => null, - 'studentId' => null, - 'courseId' => null, - 'isTrial' => null, - 'trialCompleted' => null - ]; +'progress' => null, +'outsideTrialProgress' => null, +'studentId' => null, +'courseId' => null, +'isTrial' => null, +'trialCompleted' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -109,13 +106,12 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'status' => 'status', - 'progress' => 'progress', - 'outsideTrialProgress' => 'outsideTrialProgress', - 'studentId' => 'studentId', - 'courseId' => 'courseId', - 'isTrial' => 'isTrial', - 'trialCompleted' => 'trialCompleted' - ]; +'progress' => 'progress', +'outsideTrialProgress' => 'outsideTrialProgress', +'studentId' => 'studentId', +'courseId' => 'courseId', +'isTrial' => 'isTrial', +'trialCompleted' => 'trialCompleted' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -124,13 +120,12 @@ public static function swaggerFormats() */ protected static $setters = [ 'status' => 'setStatus', - 'progress' => 'setProgress', - 'outsideTrialProgress' => 'setOutsideTrialProgress', - 'studentId' => 'setStudentId', - 'courseId' => 'setCourseId', - 'isTrial' => 'setIsTrial', - 'trialCompleted' => 'setTrialCompleted' - ]; +'progress' => 'setProgress', +'outsideTrialProgress' => 'setOutsideTrialProgress', +'studentId' => 'setStudentId', +'courseId' => 'setCourseId', +'isTrial' => 'setIsTrial', +'trialCompleted' => 'setTrialCompleted' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -139,13 +134,12 @@ public static function swaggerFormats() */ protected static $getters = [ 'status' => 'getStatus', - 'progress' => 'getProgress', - 'outsideTrialProgress' => 'getOutsideTrialProgress', - 'studentId' => 'getStudentId', - 'courseId' => 'getCourseId', - 'isTrial' => 'getIsTrial', - 'trialCompleted' => 'getTrialCompleted' - ]; +'progress' => 'getProgress', +'outsideTrialProgress' => 'getOutsideTrialProgress', +'studentId' => 'getStudentId', +'courseId' => 'getCourseId', +'isTrial' => 'getIsTrial', +'trialCompleted' => 'getTrialCompleted' ]; /** * Array of attributes where the key is the local name, @@ -190,8 +184,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -498,5 +490,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/ProvisionerData.php b/src/Model/ProvisionerData.php new file mode 100644 index 0000000..50c32ec --- /dev/null +++ b/src/Model/ProvisionerData.php @@ -0,0 +1,393 @@ + 'string', +'updatedAt' => '\DateTime', +'createdAt' => '\DateTime', +'userId' => 'string' ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => 'uuid', +'updatedAt' => 'date-time', +'createdAt' => 'date-time', +'userId' => 'uuid' ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', +'updatedAt' => 'updatedAt', +'createdAt' => 'createdAt', +'userId' => 'userId' ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', +'updatedAt' => 'setUpdatedAt', +'createdAt' => 'setCreatedAt', +'userId' => 'setUserId' ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', +'updatedAt' => 'getUpdatedAt', +'createdAt' => 'getCreatedAt', +'userId' => 'getUserId' ]; + + /** + * 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::$swaggerModelName; + } + + + + /** + * 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->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['updatedAt'] = isset($data['updatedAt']) ? $data['updatedAt'] : null; + $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null; + $this->container['userId'] = isset($data['userId']) ? $data['userId'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['updatedAt'] === null) { + $invalidProperties[] = "'updatedAt' can't be null"; + } + if ($this->container['createdAt'] === null) { + $invalidProperties[] = "'createdAt' can't be null"; + } + if ($this->container['userId'] === null) { + $invalidProperties[] = "'userId' 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 id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id id + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets updatedAt + * + * @return \DateTime + */ + public function getUpdatedAt() + { + return $this->container['updatedAt']; + } + + /** + * Sets updatedAt + * + * @param \DateTime $updatedAt updatedAt + * + * @return $this + */ + public function setUpdatedAt($updatedAt) + { + $this->container['updatedAt'] = $updatedAt; + + return $this; + } + + /** + * Gets createdAt + * + * @return \DateTime + */ + public function getCreatedAt() + { + return $this->container['createdAt']; + } + + /** + * Sets createdAt + * + * @param \DateTime $createdAt createdAt + * + * @return $this + */ + public function setCreatedAt($createdAt) + { + $this->container['createdAt'] = $createdAt; + + return $this; + } + + /** + * Gets userId + * + * @return string + */ + public function getUserId() + { + return $this->container['userId']; + } + + /** + * Sets userId + * + * @param string $userId userId + * + * @return $this + */ + public function setUserId($userId) + { + $this->container['userId'] = $userId; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} diff --git a/src/Model/PurgeKVRequestDto.php b/src/Model/PurgeKVRequestDto.php index f8930b5..5cbd2aa 100644 --- a/src/Model/PurgeKVRequestDto.php +++ b/src/Model/PurgeKVRequestDto.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -57,8 +56,7 @@ class PurgeKVRequestDto implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerTypes = [ - 'limit' => 'float' - ]; + 'limit' => 'int' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -66,8 +64,7 @@ class PurgeKVRequestDto implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerFormats = [ - 'limit' => null - ]; + 'limit' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -96,8 +93,7 @@ public static function swaggerFormats() * @var string[] */ protected static $attributeMap = [ - 'limit' => 'limit' - ]; + 'limit' => 'limit' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -105,8 +101,7 @@ public static function swaggerFormats() * @var string[] */ protected static $setters = [ - 'limit' => 'setLimit' - ]; + 'limit' => 'setLimit' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -114,8 +109,7 @@ public static function swaggerFormats() * @var string[] */ protected static $getters = [ - 'limit' => 'getLimit' - ]; + 'limit' => 'getLimit' ]; /** * Array of attributes where the key is the local name, @@ -160,8 +154,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -189,10 +181,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if (!is_null($this->container['limit']) && ($this->container['limit'] < 1)) { - $invalidProperties[] = "invalid value for 'limit', must be bigger than or equal to 1."; - } - return $invalidProperties; } @@ -211,7 +199,7 @@ public function valid() /** * Gets limit * - * @return float + * @return int */ public function getLimit() { @@ -221,17 +209,12 @@ public function getLimit() /** * Sets limit * - * @param float $limit limit + * @param int $limit limit * * @return $this */ public function setLimit($limit) { - - if (!is_null($limit) && ($limit < 1)) { - throw new \InvalidArgumentException('invalid value for $limit when calling PurgeKVRequestDto., must be bigger than or equal to 1.'); - } - $this->container['limit'] = $limit; return $this; @@ -306,5 +289,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/Refund.php b/src/Model/Refund.php index 63a6aec..92ddcce 100644 --- a/src/Model/Refund.php +++ b/src/Model/Refund.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,15 +57,14 @@ class Refund implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'id' => 'string', - 'amount' => 'int', - 'date' => '\DateTime', - 'modifiedAt' => '\DateTime', - 'reason' => 'string', - 'sourceId' => 'int', - 'sourceShopId' => 'int', - 'createdAt' => '\DateTime', - 'orderId' => 'string' - ]; +'amount' => 'int', +'date' => '\DateTime', +'modifiedAt' => '\DateTime', +'reason' => 'string', +'sourceId' => 'int', +'sourceShopId' => 'int', +'createdAt' => '\DateTime', +'orderId' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -75,15 +73,14 @@ class Refund implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'id' => null, - 'amount' => null, - 'date' => 'date-time', - 'modifiedAt' => 'date-time', - 'reason' => null, - 'sourceId' => null, - 'sourceShopId' => null, - 'createdAt' => 'date-time', - 'orderId' => 'uuid' - ]; +'amount' => null, +'date' => 'date-time', +'modifiedAt' => 'date-time', +'reason' => null, +'sourceId' => null, +'sourceShopId' => null, +'createdAt' => 'date-time', +'orderId' => 'uuid' ]; /** * Array of property to type mappings. Used for (de)serialization @@ -113,15 +110,14 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'id' => 'id', - 'amount' => 'amount', - 'date' => 'date', - 'modifiedAt' => 'modifiedAt', - 'reason' => 'reason', - 'sourceId' => 'sourceId', - 'sourceShopId' => 'sourceShopId', - 'createdAt' => 'createdAt', - 'orderId' => 'orderId' - ]; +'amount' => 'amount', +'date' => 'date', +'modifiedAt' => 'modifiedAt', +'reason' => 'reason', +'sourceId' => 'sourceId', +'sourceShopId' => 'sourceShopId', +'createdAt' => 'createdAt', +'orderId' => 'orderId' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -130,15 +126,14 @@ public static function swaggerFormats() */ protected static $setters = [ 'id' => 'setId', - 'amount' => 'setAmount', - 'date' => 'setDate', - 'modifiedAt' => 'setModifiedAt', - 'reason' => 'setReason', - 'sourceId' => 'setSourceId', - 'sourceShopId' => 'setSourceShopId', - 'createdAt' => 'setCreatedAt', - 'orderId' => 'setOrderId' - ]; +'amount' => 'setAmount', +'date' => 'setDate', +'modifiedAt' => 'setModifiedAt', +'reason' => 'setReason', +'sourceId' => 'setSourceId', +'sourceShopId' => 'setSourceShopId', +'createdAt' => 'setCreatedAt', +'orderId' => 'setOrderId' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -147,15 +142,14 @@ public static function swaggerFormats() */ protected static $getters = [ 'id' => 'getId', - 'amount' => 'getAmount', - 'date' => 'getDate', - 'modifiedAt' => 'getModifiedAt', - 'reason' => 'getReason', - 'sourceId' => 'getSourceId', - 'sourceShopId' => 'getSourceShopId', - 'createdAt' => 'getCreatedAt', - 'orderId' => 'getOrderId' - ]; +'amount' => 'getAmount', +'date' => 'getDate', +'modifiedAt' => 'getModifiedAt', +'reason' => 'getReason', +'sourceId' => 'getSourceId', +'sourceShopId' => 'getSourceShopId', +'createdAt' => 'getCreatedAt', +'orderId' => 'getOrderId' ]; /** * Array of attributes where the key is the local name, @@ -200,8 +194,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -564,5 +556,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/RefundDataDto.php b/src/Model/RefundDataDto.php index 35b2e18..3292b72 100644 --- a/src/Model/RefundDataDto.php +++ b/src/Model/RefundDataDto.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,15 +57,14 @@ class RefundDataDto implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'id' => 'int', - 'dateCreated' => '\DateTime', - 'dateCreatedGmt' => '\DateTime', - 'amount' => 'string', - 'reason' => 'string', - 'refundedBy' => 'float', - 'refundedPayment' => 'bool', - 'metaData' => '\Yoast\MyYoastApiClient\Model\MetaDataDto[]', - 'lineItems' => '\Yoast\MyYoastApiClient\Model\LineItemDto[]' - ]; +'dateCreated' => '\DateTime', +'dateCreatedGmt' => '\DateTime', +'amount' => 'string', +'reason' => 'string', +'refundedBy' => 'int', +'refundedPayment' => 'bool', +'metaData' => '\Yoast\MyYoastApiClient\Model\MetaDataDto[]', +'lineItems' => '\Yoast\MyYoastApiClient\Model\LineItemDto[]' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -75,15 +73,14 @@ class RefundDataDto implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'id' => null, - 'dateCreated' => 'date-time', - 'dateCreatedGmt' => 'date-time', - 'amount' => null, - 'reason' => null, - 'refundedBy' => null, - 'refundedPayment' => null, - 'metaData' => null, - 'lineItems' => null - ]; +'dateCreated' => 'date-time', +'dateCreatedGmt' => 'date-time', +'amount' => null, +'reason' => null, +'refundedBy' => null, +'refundedPayment' => null, +'metaData' => null, +'lineItems' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -113,15 +110,14 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'id' => 'id', - 'dateCreated' => 'date_created', - 'dateCreatedGmt' => 'date_created_gmt', - 'amount' => 'amount', - 'reason' => 'reason', - 'refundedBy' => 'refunded_by', - 'refundedPayment' => 'refunded_payment', - 'metaData' => 'meta_data', - 'lineItems' => 'line_items' - ]; +'dateCreated' => 'date_created', +'dateCreatedGmt' => 'date_created_gmt', +'amount' => 'amount', +'reason' => 'reason', +'refundedBy' => 'refunded_by', +'refundedPayment' => 'refunded_payment', +'metaData' => 'meta_data', +'lineItems' => 'line_items' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -130,15 +126,14 @@ public static function swaggerFormats() */ protected static $setters = [ 'id' => 'setId', - 'dateCreated' => 'setDateCreated', - 'dateCreatedGmt' => 'setDateCreatedGmt', - 'amount' => 'setAmount', - 'reason' => 'setReason', - 'refundedBy' => 'setRefundedBy', - 'refundedPayment' => 'setRefundedPayment', - 'metaData' => 'setMetaData', - 'lineItems' => 'setLineItems' - ]; +'dateCreated' => 'setDateCreated', +'dateCreatedGmt' => 'setDateCreatedGmt', +'amount' => 'setAmount', +'reason' => 'setReason', +'refundedBy' => 'setRefundedBy', +'refundedPayment' => 'setRefundedPayment', +'metaData' => 'setMetaData', +'lineItems' => 'setLineItems' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -147,15 +142,14 @@ public static function swaggerFormats() */ protected static $getters = [ 'id' => 'getId', - 'dateCreated' => 'getDateCreated', - 'dateCreatedGmt' => 'getDateCreatedGmt', - 'amount' => 'getAmount', - 'reason' => 'getReason', - 'refundedBy' => 'getRefundedBy', - 'refundedPayment' => 'getRefundedPayment', - 'metaData' => 'getMetaData', - 'lineItems' => 'getLineItems' - ]; +'dateCreated' => 'getDateCreated', +'dateCreatedGmt' => 'getDateCreatedGmt', +'amount' => 'getAmount', +'reason' => 'getReason', +'refundedBy' => 'getRefundedBy', +'refundedPayment' => 'getRefundedPayment', +'metaData' => 'getMetaData', +'lineItems' => 'getLineItems' ]; /** * Array of attributes where the key is the local name, @@ -200,8 +194,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -402,7 +394,7 @@ public function setReason($reason) /** * Gets refundedBy * - * @return float + * @return int */ public function getRefundedBy() { @@ -412,7 +404,7 @@ public function getRefundedBy() /** * Sets refundedBy * - * @param float $refundedBy refundedBy + * @param int $refundedBy refundedBy * * @return $this */ @@ -564,5 +556,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/RenameBodyDto.php b/src/Model/RenameBodyDto.php index 5f0890e..96ded9e 100644 --- a/src/Model/RenameBodyDto.php +++ b/src/Model/RenameBodyDto.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -57,8 +56,7 @@ class RenameBodyDto implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerTypes = [ - 'name' => 'string' - ]; + 'name' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -66,8 +64,7 @@ class RenameBodyDto implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerFormats = [ - 'name' => null - ]; + 'name' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -96,8 +93,7 @@ public static function swaggerFormats() * @var string[] */ protected static $attributeMap = [ - 'name' => 'name' - ]; + 'name' => 'name' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -105,8 +101,7 @@ public static function swaggerFormats() * @var string[] */ protected static $setters = [ - 'name' => 'setName' - ]; + 'name' => 'setName' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -114,8 +109,7 @@ public static function swaggerFormats() * @var string[] */ protected static $getters = [ - 'name' => 'getName' - ]; + 'name' => 'getName' ]; /** * Array of attributes where the key is the local name, @@ -160,8 +154,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -300,5 +292,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/ResetPasswordDto.php b/src/Model/ResetPasswordDto.php index 08cfe83..f81f6ed 100644 --- a/src/Model/ResetPasswordDto.php +++ b/src/Model/ResetPasswordDto.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,10 +57,9 @@ class ResetPasswordDto implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'userLogin' => 'string', - 'password1' => 'string', - 'password2' => 'string', - 'key' => 'string' - ]; +'password1' => 'string', +'password2' => 'string', +'key' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -70,10 +68,9 @@ class ResetPasswordDto implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'userLogin' => null, - 'password1' => null, - 'password2' => null, - 'key' => null - ]; +'password1' => null, +'password2' => null, +'key' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -103,10 +100,9 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'userLogin' => 'user_login', - 'password1' => 'password1', - 'password2' => 'password2', - 'key' => 'key' - ]; +'password1' => 'password1', +'password2' => 'password2', +'key' => 'key' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -115,10 +111,9 @@ public static function swaggerFormats() */ protected static $setters = [ 'userLogin' => 'setUserLogin', - 'password1' => 'setPassword1', - 'password2' => 'setPassword2', - 'key' => 'setKey' - ]; +'password1' => 'setPassword1', +'password2' => 'setPassword2', +'key' => 'setKey' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -127,10 +122,9 @@ public static function swaggerFormats() */ protected static $getters = [ 'userLogin' => 'getUserLogin', - 'password1' => 'getPassword1', - 'password2' => 'getPassword2', - 'key' => 'getKey' - ]; +'password1' => 'getPassword1', +'password2' => 'getPassword2', +'key' => 'getKey' ]; /** * Array of attributes where the key is the local name, @@ -175,8 +169,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -399,5 +391,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/Role.php b/src/Model/Role.php new file mode 100644 index 0000000..a5a8bc4 --- /dev/null +++ b/src/Model/Role.php @@ -0,0 +1,426 @@ + 'int', +'name' => 'string', +'description' => 'string', +'created' => '\DateTime', +'modified' => '\DateTime' ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => null, +'name' => null, +'description' => null, +'created' => 'date-time', +'modified' => 'date-time' ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', +'name' => 'name', +'description' => 'description', +'created' => 'created', +'modified' => 'modified' ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', +'name' => 'setName', +'description' => 'setDescription', +'created' => 'setCreated', +'modified' => 'setModified' ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', +'name' => 'getName', +'description' => 'getDescription', +'created' => 'getCreated', +'modified' => 'getModified' ]; + + /** + * 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::$swaggerModelName; + } + + + + /** + * 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->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['name'] = isset($data['name']) ? $data['name'] : null; + $this->container['description'] = isset($data['description']) ? $data['description'] : null; + $this->container['created'] = isset($data['created']) ? $data['created'] : null; + $this->container['modified'] = isset($data['modified']) ? $data['modified'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['description'] === null) { + $invalidProperties[] = "'description' can't be null"; + } + if ($this->container['created'] === null) { + $invalidProperties[] = "'created' can't be null"; + } + if ($this->container['modified'] === null) { + $invalidProperties[] = "'modified' 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 id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id id + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name name + * + * @return $this + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets description + * + * @return string + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string $description description + * + * @return $this + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets created + * + * @return \DateTime + */ + public function getCreated() + { + return $this->container['created']; + } + + /** + * Sets created + * + * @param \DateTime $created created + * + * @return $this + */ + public function setCreated($created) + { + $this->container['created'] = $created; + + return $this; + } + + /** + * Gets modified + * + * @return \DateTime + */ + public function getModified() + { + return $this->container['modified']; + } + + /** + * Sets modified + * + * @param \DateTime $modified modified + * + * @return $this + */ + public function setModified($modified) + { + $this->container['modified'] = $modified; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} diff --git a/src/Model/RoleIDDto.php b/src/Model/RoleIDDto.php index f79c948..ccd3b9d 100644 --- a/src/Model/RoleIDDto.php +++ b/src/Model/RoleIDDto.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -57,8 +56,7 @@ class RoleIDDto implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerTypes = [ - 'roleId' => 'float' - ]; + 'roleId' => 'int' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -66,8 +64,7 @@ class RoleIDDto implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerFormats = [ - 'roleId' => null - ]; + 'roleId' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -96,8 +93,7 @@ public static function swaggerFormats() * @var string[] */ protected static $attributeMap = [ - 'roleId' => 'roleId' - ]; + 'roleId' => 'roleId' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -105,8 +101,7 @@ public static function swaggerFormats() * @var string[] */ protected static $setters = [ - 'roleId' => 'setRoleId' - ]; + 'roleId' => 'setRoleId' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -114,8 +109,7 @@ public static function swaggerFormats() * @var string[] */ protected static $getters = [ - 'roleId' => 'getRoleId' - ]; + 'roleId' => 'getRoleId' ]; /** * Array of attributes where the key is the local name, @@ -160,8 +154,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -210,7 +202,7 @@ public function valid() /** * Gets roleId * - * @return float + * @return int */ public function getRoleId() { @@ -220,7 +212,7 @@ public function getRoleId() /** * Sets roleId * - * @param float $roleId roleId + * @param int $roleId roleId * * @return $this */ @@ -300,5 +292,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/SendResetPasswordEmailDto.php b/src/Model/SendResetPasswordEmailDto.php index 108763d..fa8b8d1 100644 --- a/src/Model/SendResetPasswordEmailDto.php +++ b/src/Model/SendResetPasswordEmailDto.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -57,8 +56,7 @@ class SendResetPasswordEmailDto implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerTypes = [ - 'email' => 'string' - ]; + 'email' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -66,8 +64,7 @@ class SendResetPasswordEmailDto implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerFormats = [ - 'email' => null - ]; + 'email' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -96,8 +93,7 @@ public static function swaggerFormats() * @var string[] */ protected static $attributeMap = [ - 'email' => 'email' - ]; + 'email' => 'email' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -105,8 +101,7 @@ public static function swaggerFormats() * @var string[] */ protected static $setters = [ - 'email' => 'setEmail' - ]; + 'email' => 'setEmail' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -114,8 +109,7 @@ public static function swaggerFormats() * @var string[] */ protected static $getters = [ - 'email' => 'getEmail' - ]; + 'email' => 'getEmail' ]; /** * Array of attributes where the key is the local name, @@ -160,8 +154,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -300,5 +292,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/SetExpiryDateDto.php b/src/Model/SetExpiryDateDto.php index e5af658..09a7f23 100644 --- a/src/Model/SetExpiryDateDto.php +++ b/src/Model/SetExpiryDateDto.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,8 +57,7 @@ class SetExpiryDateDto implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'subscriptionId' => 'string', - 'expiryDate' => '\DateTime' - ]; +'expiryDate' => '\DateTime' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -68,8 +66,7 @@ class SetExpiryDateDto implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'subscriptionId' => null, - 'expiryDate' => 'date-time' - ]; +'expiryDate' => 'date-time' ]; /** * Array of property to type mappings. Used for (de)serialization @@ -99,8 +96,7 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'subscriptionId' => 'subscriptionId', - 'expiryDate' => 'expiryDate' - ]; +'expiryDate' => 'expiryDate' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -109,8 +105,7 @@ public static function swaggerFormats() */ protected static $setters = [ 'subscriptionId' => 'setSubscriptionId', - 'expiryDate' => 'setExpiryDate' - ]; +'expiryDate' => 'setExpiryDate' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -119,8 +114,7 @@ public static function swaggerFormats() */ protected static $getters = [ 'subscriptionId' => 'getSubscriptionId', - 'expiryDate' => 'getExpiryDate' - ]; +'expiryDate' => 'getExpiryDate' ]; /** * Array of attributes where the key is the local name, @@ -165,8 +159,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -333,5 +325,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/SetProvisionedSiteDto.php b/src/Model/SetProvisionedSiteDto.php new file mode 100644 index 0000000..be9c9ff --- /dev/null +++ b/src/Model/SetProvisionedSiteDto.php @@ -0,0 +1,294 @@ + 'string' ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'site' => null ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'site' => 'site' ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'site' => 'setSite' ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'site' => 'getSite' ]; + + /** + * 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::$swaggerModelName; + } + + + + /** + * 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->container['site'] = isset($data['site']) ? $data['site'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['site'] === null) { + $invalidProperties[] = "'site' 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 site + * + * @return string + */ + public function getSite() + { + return $this->container['site']; + } + + /** + * Sets site + * + * @param string $site The site that should be connected to this subscription. + * + * @return $this + */ + public function setSite($site) + { + $this->container['site'] = $site; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} diff --git a/src/Model/ShippingDto.php b/src/Model/ShippingDto.php index 5968f93..16163db 100644 --- a/src/Model/ShippingDto.php +++ b/src/Model/ShippingDto.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,15 +57,14 @@ class ShippingDto implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'address1' => 'string', - 'address2' => 'string', - 'city' => 'string', - 'company' => 'string', - 'country' => 'string', - 'firstName' => 'string', - 'lastName' => 'string', - 'postcode' => 'string', - 'state' => 'string' - ]; +'address2' => 'string', +'city' => 'string', +'company' => 'string', +'country' => 'string', +'firstName' => 'string', +'lastName' => 'string', +'postcode' => 'string', +'state' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -75,15 +73,14 @@ class ShippingDto implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'address1' => null, - 'address2' => null, - 'city' => null, - 'company' => null, - 'country' => null, - 'firstName' => null, - 'lastName' => null, - 'postcode' => null, - 'state' => null - ]; +'address2' => null, +'city' => null, +'company' => null, +'country' => null, +'firstName' => null, +'lastName' => null, +'postcode' => null, +'state' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -113,15 +110,14 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'address1' => 'address_1', - 'address2' => 'address_2', - 'city' => 'city', - 'company' => 'company', - 'country' => 'country', - 'firstName' => 'first_name', - 'lastName' => 'last_name', - 'postcode' => 'postcode', - 'state' => 'state' - ]; +'address2' => 'address_2', +'city' => 'city', +'company' => 'company', +'country' => 'country', +'firstName' => 'first_name', +'lastName' => 'last_name', +'postcode' => 'postcode', +'state' => 'state' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -130,15 +126,14 @@ public static function swaggerFormats() */ protected static $setters = [ 'address1' => 'setAddress1', - 'address2' => 'setAddress2', - 'city' => 'setCity', - 'company' => 'setCompany', - 'country' => 'setCountry', - 'firstName' => 'setFirstName', - 'lastName' => 'setLastName', - 'postcode' => 'setPostcode', - 'state' => 'setState' - ]; +'address2' => 'setAddress2', +'city' => 'setCity', +'company' => 'setCompany', +'country' => 'setCountry', +'firstName' => 'setFirstName', +'lastName' => 'setLastName', +'postcode' => 'setPostcode', +'state' => 'setState' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -147,15 +142,14 @@ public static function swaggerFormats() */ protected static $getters = [ 'address1' => 'getAddress1', - 'address2' => 'getAddress2', - 'city' => 'getCity', - 'company' => 'getCompany', - 'country' => 'getCountry', - 'firstName' => 'getFirstName', - 'lastName' => 'getLastName', - 'postcode' => 'getPostcode', - 'state' => 'getState' - ]; +'address2' => 'getAddress2', +'city' => 'getCity', +'company' => 'getCompany', +'country' => 'getCountry', +'firstName' => 'getFirstName', +'lastName' => 'getLastName', +'postcode' => 'getPostcode', +'state' => 'getState' ]; /** * Array of attributes where the key is the local name, @@ -200,8 +194,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -564,5 +556,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/SignupAccountDto.php b/src/Model/SignupAccountDto.php index 4c06f1f..2361697 100644 --- a/src/Model/SignupAccountDto.php +++ b/src/Model/SignupAccountDto.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,9 +57,8 @@ class SignupAccountDto implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'password' => 'string', - 'repeatPassword' => 'string', - 'userEmail' => 'string' - ]; +'repeatPassword' => 'string', +'userEmail' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -69,9 +67,8 @@ class SignupAccountDto implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'password' => null, - 'repeatPassword' => null, - 'userEmail' => null - ]; +'repeatPassword' => null, +'userEmail' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -101,9 +98,8 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'password' => 'password', - 'repeatPassword' => 'repeatPassword', - 'userEmail' => 'userEmail' - ]; +'repeatPassword' => 'repeatPassword', +'userEmail' => 'userEmail' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -112,9 +108,8 @@ public static function swaggerFormats() */ protected static $setters = [ 'password' => 'setPassword', - 'repeatPassword' => 'setRepeatPassword', - 'userEmail' => 'setUserEmail' - ]; +'repeatPassword' => 'setRepeatPassword', +'userEmail' => 'setUserEmail' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -123,9 +118,8 @@ public static function swaggerFormats() */ protected static $getters = [ 'password' => 'getPassword', - 'repeatPassword' => 'getRepeatPassword', - 'userEmail' => 'getUserEmail' - ]; +'repeatPassword' => 'getRepeatPassword', +'userEmail' => 'getUserEmail' ]; /** * Array of attributes where the key is the local name, @@ -170,8 +164,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -366,5 +358,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/Site.php b/src/Model/Site.php index b81da1a..fecd0e9 100644 --- a/src/Model/Site.php +++ b/src/Model/Site.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,22 +57,22 @@ class Site implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'id' => 'string', - 'url' => 'string', - 'header' => 'string', - 'icon' => 'string', - 'creationDate' => '\DateTime', - 'hostname' => 'string', - 'protocol' => 'string', - 'port' => 'int', - 'path' => 'string', - 'createdAt' => '\DateTime', - 'modifiedAt' => '\DateTime', - 'type' => 'string', - 'status' => 'string', - 'clientId' => 'string', - 'clientSecret' => 'string', - 'userId' => 'string' - ]; +'url' => 'string', +'header' => 'string', +'icon' => 'string', +'creationDate' => '\DateTime', +'hostname' => 'string', +'protocol' => 'string', +'port' => 'int', +'path' => 'string', +'createdAt' => '\DateTime', +'modifiedAt' => '\DateTime', +'type' => 'string', +'status' => 'string', +'clientId' => 'string', +'clientSecret' => 'string', +'userId' => 'string', +'provisionerId' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -82,22 +81,22 @@ class Site implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'id' => null, - 'url' => null, - 'header' => null, - 'icon' => null, - 'creationDate' => 'date-time', - 'hostname' => null, - 'protocol' => null, - 'port' => null, - 'path' => null, - 'createdAt' => 'date-time', - 'modifiedAt' => 'date-time', - 'type' => null, - 'status' => null, - 'clientId' => null, - 'clientSecret' => null, - 'userId' => 'uuid' - ]; +'url' => null, +'header' => null, +'icon' => null, +'creationDate' => 'date-time', +'hostname' => null, +'protocol' => null, +'port' => null, +'path' => null, +'createdAt' => 'date-time', +'modifiedAt' => 'date-time', +'type' => null, +'status' => null, +'clientId' => null, +'clientSecret' => null, +'userId' => 'uuid', +'provisionerId' => 'uuid' ]; /** * Array of property to type mappings. Used for (de)serialization @@ -127,22 +126,22 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'id' => 'id', - 'url' => 'url', - 'header' => 'header', - 'icon' => 'icon', - 'creationDate' => 'creationDate', - 'hostname' => 'hostname', - 'protocol' => 'protocol', - 'port' => 'port', - 'path' => 'path', - 'createdAt' => 'createdAt', - 'modifiedAt' => 'modifiedAt', - 'type' => 'type', - 'status' => 'status', - 'clientId' => 'clientId', - 'clientSecret' => 'clientSecret', - 'userId' => 'userId' - ]; +'url' => 'url', +'header' => 'header', +'icon' => 'icon', +'creationDate' => 'creationDate', +'hostname' => 'hostname', +'protocol' => 'protocol', +'port' => 'port', +'path' => 'path', +'createdAt' => 'createdAt', +'modifiedAt' => 'modifiedAt', +'type' => 'type', +'status' => 'status', +'clientId' => 'clientId', +'clientSecret' => 'clientSecret', +'userId' => 'userId', +'provisionerId' => 'provisionerId' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -151,22 +150,22 @@ public static function swaggerFormats() */ protected static $setters = [ 'id' => 'setId', - 'url' => 'setUrl', - 'header' => 'setHeader', - 'icon' => 'setIcon', - 'creationDate' => 'setCreationDate', - 'hostname' => 'setHostname', - 'protocol' => 'setProtocol', - 'port' => 'setPort', - 'path' => 'setPath', - 'createdAt' => 'setCreatedAt', - 'modifiedAt' => 'setModifiedAt', - 'type' => 'setType', - 'status' => 'setStatus', - 'clientId' => 'setClientId', - 'clientSecret' => 'setClientSecret', - 'userId' => 'setUserId' - ]; +'url' => 'setUrl', +'header' => 'setHeader', +'icon' => 'setIcon', +'creationDate' => 'setCreationDate', +'hostname' => 'setHostname', +'protocol' => 'setProtocol', +'port' => 'setPort', +'path' => 'setPath', +'createdAt' => 'setCreatedAt', +'modifiedAt' => 'setModifiedAt', +'type' => 'setType', +'status' => 'setStatus', +'clientId' => 'setClientId', +'clientSecret' => 'setClientSecret', +'userId' => 'setUserId', +'provisionerId' => 'setProvisionerId' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -175,22 +174,22 @@ public static function swaggerFormats() */ protected static $getters = [ 'id' => 'getId', - 'url' => 'getUrl', - 'header' => 'getHeader', - 'icon' => 'getIcon', - 'creationDate' => 'getCreationDate', - 'hostname' => 'getHostname', - 'protocol' => 'getProtocol', - 'port' => 'getPort', - 'path' => 'getPath', - 'createdAt' => 'getCreatedAt', - 'modifiedAt' => 'getModifiedAt', - 'type' => 'getType', - 'status' => 'getStatus', - 'clientId' => 'getClientId', - 'clientSecret' => 'getClientSecret', - 'userId' => 'getUserId' - ]; +'url' => 'getUrl', +'header' => 'getHeader', +'icon' => 'getIcon', +'creationDate' => 'getCreationDate', +'hostname' => 'getHostname', +'protocol' => 'getProtocol', +'port' => 'getPort', +'path' => 'getPath', +'createdAt' => 'getCreatedAt', +'modifiedAt' => 'getModifiedAt', +'type' => 'getType', +'status' => 'getStatus', +'clientId' => 'getClientId', +'clientSecret' => 'getClientSecret', +'userId' => 'getUserId', +'provisionerId' => 'getProvisionerId' ]; /** * Array of attributes where the key is the local name, @@ -235,8 +234,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -268,6 +265,7 @@ public function __construct(array $data = null) $this->container['clientId'] = isset($data['clientId']) ? $data['clientId'] : null; $this->container['clientSecret'] = isset($data['clientSecret']) ? $data['clientSecret'] : null; $this->container['userId'] = isset($data['userId']) ? $data['userId'] : null; + $this->container['provisionerId'] = isset($data['provisionerId']) ? $data['provisionerId'] : null; } /** @@ -327,6 +325,9 @@ public function listInvalidProperties() if ($this->container['userId'] === null) { $invalidProperties[] = "'userId' can't be null"; } + if ($this->container['provisionerId'] === null) { + $invalidProperties[] = "'provisionerId' can't be null"; + } return $invalidProperties; } @@ -725,6 +726,30 @@ public function setUserId($userId) return $this; } + + /** + * Gets provisionerId + * + * @return string + */ + public function getProvisionerId() + { + return $this->container['provisionerId']; + } + + /** + * Sets provisionerId + * + * @param string $provisionerId provisionerId + * + * @return $this + */ + public function setProvisionerId($provisionerId) + { + $this->container['provisionerId'] = $provisionerId; + + return $this; + } /** * Returns true if offset exists. False otherwise. * @@ -795,5 +820,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/SubscribeByEmailBodyDto.php b/src/Model/SubscribeByEmailBodyDto.php index 180ab49..958e742 100644 --- a/src/Model/SubscribeByEmailBodyDto.php +++ b/src/Model/SubscribeByEmailBodyDto.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,9 +57,8 @@ class SubscribeByEmailBodyDto implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'email' => 'string', - 'firstName' => 'string', - 'lastName' => 'string' - ]; +'firstName' => 'string', +'lastName' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -69,9 +67,8 @@ class SubscribeByEmailBodyDto implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'email' => null, - 'firstName' => null, - 'lastName' => null - ]; +'firstName' => null, +'lastName' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -101,9 +98,8 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'email' => 'email', - 'firstName' => 'firstName', - 'lastName' => 'lastName' - ]; +'firstName' => 'firstName', +'lastName' => 'lastName' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -112,9 +108,8 @@ public static function swaggerFormats() */ protected static $setters = [ 'email' => 'setEmail', - 'firstName' => 'setFirstName', - 'lastName' => 'setLastName' - ]; +'firstName' => 'setFirstName', +'lastName' => 'setLastName' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -123,9 +118,8 @@ public static function swaggerFormats() */ protected static $getters = [ 'email' => 'getEmail', - 'firstName' => 'getFirstName', - 'lastName' => 'getLastName' - ]; +'firstName' => 'getFirstName', +'lastName' => 'getLastName' ]; /** * Array of attributes where the key is the local name, @@ -170,8 +164,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -366,5 +358,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/Subscription.php b/src/Model/Subscription.php index 8c9fff6..9e7111c 100644 --- a/src/Model/Subscription.php +++ b/src/Model/Subscription.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,26 +57,28 @@ class Subscription implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'id' => 'string', - 'startDate' => '\DateTime', - 'endDate' => '\DateTime', - 'sourceId' => 'int', - 'sourceLineItemId' => 'int', - 'sourceShopId' => 'int', - 'status' => 'string', - 'currency' => 'string', - 'date' => '\DateTime', - 'price' => 'int', - 'name' => 'string', - 'nextPayment' => '\DateTime', - 'limit' => 'int', - 'used' => 'int', - 'createdAt' => '\DateTime', - 'modifiedAt' => '\DateTime', - 'requiresManualRenewal' => 'bool', - 'renewalSecret' => 'string', - 'subscriptionNumber' => 'string', - 'lastBillingTerm' => 'string' - ]; +'startDate' => '\DateTime', +'endDate' => '\DateTime', +'sourceId' => 'int', +'sourceLineItemId' => 'int', +'sourceShopId' => 'int', +'status' => 'string', +'currency' => 'string', +'date' => '\DateTime', +'price' => 'int', +'name' => 'string', +'nextPayment' => '\DateTime', +'limit' => 'int', +'used' => 'int', +'createdAt' => '\DateTime', +'modifiedAt' => '\DateTime', +'requiresManualRenewal' => 'bool', +'renewalSecret' => 'string', +'subscriptionNumber' => 'string', +'lastBillingTerm' => 'string', +'subscriberId' => 'string', +'productId' => 'Uuid', +'provisionerId' => 'Uuid' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -86,26 +87,28 @@ class Subscription implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'id' => null, - 'startDate' => 'date-time', - 'endDate' => 'date-time', - 'sourceId' => null, - 'sourceLineItemId' => null, - 'sourceShopId' => null, - 'status' => null, - 'currency' => null, - 'date' => 'date-time', - 'price' => null, - 'name' => null, - 'nextPayment' => 'date-time', - 'limit' => null, - 'used' => null, - 'createdAt' => 'date-time', - 'modifiedAt' => 'date-time', - 'requiresManualRenewal' => null, - 'renewalSecret' => null, - 'subscriptionNumber' => null, - 'lastBillingTerm' => null - ]; +'startDate' => 'date-time', +'endDate' => 'date-time', +'sourceId' => null, +'sourceLineItemId' => null, +'sourceShopId' => null, +'status' => null, +'currency' => null, +'date' => 'date-time', +'price' => null, +'name' => null, +'nextPayment' => 'date-time', +'limit' => null, +'used' => null, +'createdAt' => 'date-time', +'modifiedAt' => 'date-time', +'requiresManualRenewal' => null, +'renewalSecret' => null, +'subscriptionNumber' => null, +'lastBillingTerm' => null, +'subscriberId' => 'uuid', +'productId' => null, +'provisionerId' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -135,26 +138,28 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'id' => 'id', - 'startDate' => 'startDate', - 'endDate' => 'endDate', - 'sourceId' => 'sourceId', - 'sourceLineItemId' => 'sourceLineItemId', - 'sourceShopId' => 'sourceShopId', - 'status' => 'status', - 'currency' => 'currency', - 'date' => 'date', - 'price' => 'price', - 'name' => 'name', - 'nextPayment' => 'nextPayment', - 'limit' => 'limit', - 'used' => 'used', - 'createdAt' => 'createdAt', - 'modifiedAt' => 'modifiedAt', - 'requiresManualRenewal' => 'requiresManualRenewal', - 'renewalSecret' => 'renewalSecret', - 'subscriptionNumber' => 'subscriptionNumber', - 'lastBillingTerm' => 'lastBillingTerm' - ]; +'startDate' => 'startDate', +'endDate' => 'endDate', +'sourceId' => 'sourceId', +'sourceLineItemId' => 'sourceLineItemId', +'sourceShopId' => 'sourceShopId', +'status' => 'status', +'currency' => 'currency', +'date' => 'date', +'price' => 'price', +'name' => 'name', +'nextPayment' => 'nextPayment', +'limit' => 'limit', +'used' => 'used', +'createdAt' => 'createdAt', +'modifiedAt' => 'modifiedAt', +'requiresManualRenewal' => 'requiresManualRenewal', +'renewalSecret' => 'renewalSecret', +'subscriptionNumber' => 'subscriptionNumber', +'lastBillingTerm' => 'lastBillingTerm', +'subscriberId' => 'subscriberId', +'productId' => 'productId', +'provisionerId' => 'provisionerId' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -163,26 +168,28 @@ public static function swaggerFormats() */ protected static $setters = [ 'id' => 'setId', - 'startDate' => 'setStartDate', - 'endDate' => 'setEndDate', - 'sourceId' => 'setSourceId', - 'sourceLineItemId' => 'setSourceLineItemId', - 'sourceShopId' => 'setSourceShopId', - 'status' => 'setStatus', - 'currency' => 'setCurrency', - 'date' => 'setDate', - 'price' => 'setPrice', - 'name' => 'setName', - 'nextPayment' => 'setNextPayment', - 'limit' => 'setLimit', - 'used' => 'setUsed', - 'createdAt' => 'setCreatedAt', - 'modifiedAt' => 'setModifiedAt', - 'requiresManualRenewal' => 'setRequiresManualRenewal', - 'renewalSecret' => 'setRenewalSecret', - 'subscriptionNumber' => 'setSubscriptionNumber', - 'lastBillingTerm' => 'setLastBillingTerm' - ]; +'startDate' => 'setStartDate', +'endDate' => 'setEndDate', +'sourceId' => 'setSourceId', +'sourceLineItemId' => 'setSourceLineItemId', +'sourceShopId' => 'setSourceShopId', +'status' => 'setStatus', +'currency' => 'setCurrency', +'date' => 'setDate', +'price' => 'setPrice', +'name' => 'setName', +'nextPayment' => 'setNextPayment', +'limit' => 'setLimit', +'used' => 'setUsed', +'createdAt' => 'setCreatedAt', +'modifiedAt' => 'setModifiedAt', +'requiresManualRenewal' => 'setRequiresManualRenewal', +'renewalSecret' => 'setRenewalSecret', +'subscriptionNumber' => 'setSubscriptionNumber', +'lastBillingTerm' => 'setLastBillingTerm', +'subscriberId' => 'setSubscriberId', +'productId' => 'setProductId', +'provisionerId' => 'setProvisionerId' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -191,26 +198,28 @@ public static function swaggerFormats() */ protected static $getters = [ 'id' => 'getId', - 'startDate' => 'getStartDate', - 'endDate' => 'getEndDate', - 'sourceId' => 'getSourceId', - 'sourceLineItemId' => 'getSourceLineItemId', - 'sourceShopId' => 'getSourceShopId', - 'status' => 'getStatus', - 'currency' => 'getCurrency', - 'date' => 'getDate', - 'price' => 'getPrice', - 'name' => 'getName', - 'nextPayment' => 'getNextPayment', - 'limit' => 'getLimit', - 'used' => 'getUsed', - 'createdAt' => 'getCreatedAt', - 'modifiedAt' => 'getModifiedAt', - 'requiresManualRenewal' => 'getRequiresManualRenewal', - 'renewalSecret' => 'getRenewalSecret', - 'subscriptionNumber' => 'getSubscriptionNumber', - 'lastBillingTerm' => 'getLastBillingTerm' - ]; +'startDate' => 'getStartDate', +'endDate' => 'getEndDate', +'sourceId' => 'getSourceId', +'sourceLineItemId' => 'getSourceLineItemId', +'sourceShopId' => 'getSourceShopId', +'status' => 'getStatus', +'currency' => 'getCurrency', +'date' => 'getDate', +'price' => 'getPrice', +'name' => 'getName', +'nextPayment' => 'getNextPayment', +'limit' => 'getLimit', +'used' => 'getUsed', +'createdAt' => 'getCreatedAt', +'modifiedAt' => 'getModifiedAt', +'requiresManualRenewal' => 'getRequiresManualRenewal', +'renewalSecret' => 'getRenewalSecret', +'subscriptionNumber' => 'getSubscriptionNumber', +'lastBillingTerm' => 'getLastBillingTerm', +'subscriberId' => 'getSubscriberId', +'productId' => 'getProductId', +'provisionerId' => 'getProvisionerId' ]; /** * Array of attributes where the key is the local name, @@ -255,8 +264,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -292,6 +299,9 @@ public function __construct(array $data = null) $this->container['renewalSecret'] = isset($data['renewalSecret']) ? $data['renewalSecret'] : null; $this->container['subscriptionNumber'] = isset($data['subscriptionNumber']) ? $data['subscriptionNumber'] : null; $this->container['lastBillingTerm'] = isset($data['lastBillingTerm']) ? $data['lastBillingTerm'] : null; + $this->container['subscriberId'] = isset($data['subscriberId']) ? $data['subscriberId'] : null; + $this->container['productId'] = isset($data['productId']) ? $data['productId'] : null; + $this->container['provisionerId'] = isset($data['provisionerId']) ? $data['provisionerId'] : null; } /** @@ -363,6 +373,12 @@ public function listInvalidProperties() if ($this->container['lastBillingTerm'] === null) { $invalidProperties[] = "'lastBillingTerm' can't be null"; } + if ($this->container['subscriberId'] === null) { + $invalidProperties[] = "'subscriberId' can't be null"; + } + if ($this->container['productId'] === null) { + $invalidProperties[] = "'productId' can't be null"; + } return $invalidProperties; } @@ -857,6 +873,78 @@ public function setLastBillingTerm($lastBillingTerm) return $this; } + + /** + * Gets subscriberId + * + * @return string + */ + public function getSubscriberId() + { + return $this->container['subscriberId']; + } + + /** + * Sets subscriberId + * + * @param string $subscriberId subscriberId + * + * @return $this + */ + public function setSubscriberId($subscriberId) + { + $this->container['subscriberId'] = $subscriberId; + + return $this; + } + + /** + * Gets productId + * + * @return Uuid + */ + public function getProductId() + { + return $this->container['productId']; + } + + /** + * Sets productId + * + * @param Uuid $productId productId + * + * @return $this + */ + public function setProductId($productId) + { + $this->container['productId'] = $productId; + + return $this; + } + + /** + * Gets provisionerId + * + * @return Uuid + */ + public function getProvisionerId() + { + return $this->container['provisionerId']; + } + + /** + * Sets provisionerId + * + * @param Uuid $provisionerId provisionerId + * + * @return $this + */ + public function setProvisionerId($provisionerId) + { + $this->container['provisionerId'] = $provisionerId; + + return $this; + } /** * Returns true if offset exists. False otherwise. * @@ -927,5 +1015,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/SubscriptionProvisioningResponseDto.php b/src/Model/SubscriptionProvisioningResponseDto.php new file mode 100644 index 0000000..8f308b6 --- /dev/null +++ b/src/Model/SubscriptionProvisioningResponseDto.php @@ -0,0 +1,492 @@ + 'string', +'subscriptionNumber' => 'string', +'status' => 'string', +'startDate' => 'int', +'endDate' => 'int', +'pluginDownloadUrls' => 'string[]', +'siteUrl' => 'string' ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'iD' => null, +'subscriptionNumber' => null, +'status' => null, +'startDate' => null, +'endDate' => null, +'pluginDownloadUrls' => null, +'siteUrl' => null ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'iD' => 'ID', +'subscriptionNumber' => 'subscriptionNumber', +'status' => 'status', +'startDate' => 'startDate', +'endDate' => 'endDate', +'pluginDownloadUrls' => 'pluginDownloadUrls', +'siteUrl' => 'siteUrl' ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'iD' => 'setID', +'subscriptionNumber' => 'setSubscriptionNumber', +'status' => 'setStatus', +'startDate' => 'setStartDate', +'endDate' => 'setEndDate', +'pluginDownloadUrls' => 'setPluginDownloadUrls', +'siteUrl' => 'setSiteUrl' ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'iD' => 'getID', +'subscriptionNumber' => 'getSubscriptionNumber', +'status' => 'getStatus', +'startDate' => 'getStartDate', +'endDate' => 'getEndDate', +'pluginDownloadUrls' => 'getPluginDownloadUrls', +'siteUrl' => 'getSiteUrl' ]; + + /** + * 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::$swaggerModelName; + } + + + + /** + * 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->container['iD'] = isset($data['iD']) ? $data['iD'] : null; + $this->container['subscriptionNumber'] = isset($data['subscriptionNumber']) ? $data['subscriptionNumber'] : null; + $this->container['status'] = isset($data['status']) ? $data['status'] : null; + $this->container['startDate'] = isset($data['startDate']) ? $data['startDate'] : null; + $this->container['endDate'] = isset($data['endDate']) ? $data['endDate'] : null; + $this->container['pluginDownloadUrls'] = isset($data['pluginDownloadUrls']) ? $data['pluginDownloadUrls'] : null; + $this->container['siteUrl'] = isset($data['siteUrl']) ? $data['siteUrl'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['iD'] === null) { + $invalidProperties[] = "'iD' can't be null"; + } + if ($this->container['subscriptionNumber'] === null) { + $invalidProperties[] = "'subscriptionNumber' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + if ($this->container['startDate'] === null) { + $invalidProperties[] = "'startDate' can't be null"; + } + if ($this->container['endDate'] === null) { + $invalidProperties[] = "'endDate' can't be null"; + } + if ($this->container['pluginDownloadUrls'] === null) { + $invalidProperties[] = "'pluginDownloadUrls' can't be null"; + } + if ($this->container['siteUrl'] === null) { + $invalidProperties[] = "'siteUrl' 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 iD + * + * @return string + */ + public function getID() + { + return $this->container['iD']; + } + + /** + * Sets iD + * + * @param string $iD The subscription ID to be used privately. + * + * @return $this + */ + public function setID($iD) + { + $this->container['iD'] = $iD; + + return $this; + } + + /** + * Gets subscriptionNumber + * + * @return string + */ + public function getSubscriptionNumber() + { + return $this->container['subscriptionNumber']; + } + + /** + * Sets subscriptionNumber + * + * @param string $subscriptionNumber The subscription invoice number, can be communicated publicly. + * + * @return $this + */ + public function setSubscriptionNumber($subscriptionNumber) + { + $this->container['subscriptionNumber'] = $subscriptionNumber; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status The status of the subscription. + * + * @return $this + */ + public function setStatus($status) + { + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets startDate + * + * @return int + */ + public function getStartDate() + { + return $this->container['startDate']; + } + + /** + * Sets startDate + * + * @param int $startDate The date the subscription has started. + * + * @return $this + */ + public function setStartDate($startDate) + { + $this->container['startDate'] = $startDate; + + return $this; + } + + /** + * Gets endDate + * + * @return int + */ + public function getEndDate() + { + return $this->container['endDate']; + } + + /** + * Sets endDate + * + * @param int $endDate The date the subscription will expire. + * + * @return $this + */ + public function setEndDate($endDate) + { + $this->container['endDate'] = $endDate; + + return $this; + } + + /** + * Gets pluginDownloadUrls + * + * @return string[] + */ + public function getPluginDownloadUrls() + { + return $this->container['pluginDownloadUrls']; + } + + /** + * Sets pluginDownloadUrls + * + * @param string[] $pluginDownloadUrls The URLs for the latest version of the download for the products in the subscription. + * + * @return $this + */ + public function setPluginDownloadUrls($pluginDownloadUrls) + { + $this->container['pluginDownloadUrls'] = $pluginDownloadUrls; + + return $this; + } + + /** + * Gets siteUrl + * + * @return string + */ + public function getSiteUrl() + { + return $this->container['siteUrl']; + } + + /** + * Sets siteUrl + * + * @param string $siteUrl The URL for the site connected to this subscription. + * + * @return $this + */ + public function setSiteUrl($siteUrl) + { + $this->container['siteUrl'] = $siteUrl; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} diff --git a/src/Model/SwitchSubscriptionNumberOfTimesDto.php b/src/Model/SwitchSubscriptionNumberOfTimesDto.php index f6e57a0..ef601ef 100644 --- a/src/Model/SwitchSubscriptionNumberOfTimesDto.php +++ b/src/Model/SwitchSubscriptionNumberOfTimesDto.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,9 +57,8 @@ class SwitchSubscriptionNumberOfTimesDto implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'fromSourceId' => 'int', - 'toSourceId' => 'int', - 'productId' => 'int' - ]; +'toSourceId' => 'int', +'productId' => 'int' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -69,9 +67,8 @@ class SwitchSubscriptionNumberOfTimesDto implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'fromSourceId' => null, - 'toSourceId' => null, - 'productId' => null - ]; +'toSourceId' => null, +'productId' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -101,9 +98,8 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'fromSourceId' => 'fromSourceId', - 'toSourceId' => 'toSourceId', - 'productId' => 'productId' - ]; +'toSourceId' => 'toSourceId', +'productId' => 'productId' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -112,9 +108,8 @@ public static function swaggerFormats() */ protected static $setters = [ 'fromSourceId' => 'setFromSourceId', - 'toSourceId' => 'setToSourceId', - 'productId' => 'setProductId' - ]; +'toSourceId' => 'setToSourceId', +'productId' => 'setProductId' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -123,9 +118,8 @@ public static function swaggerFormats() */ protected static $getters = [ 'fromSourceId' => 'getFromSourceId', - 'toSourceId' => 'getToSourceId', - 'productId' => 'getProductId' - ]; +'toSourceId' => 'getToSourceId', +'productId' => 'getProductId' ]; /** * Array of attributes where the key is the local name, @@ -170,8 +164,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -366,5 +358,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/TaxLineItem.php b/src/Model/TaxLineItem.php index 1ebd9f8..e7e046f 100644 --- a/src/Model/TaxLineItem.php +++ b/src/Model/TaxLineItem.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,14 +57,13 @@ class TaxLineItem implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'id' => 'int', - 'compound' => 'bool', - 'label' => 'string', - 'metaData' => '\Yoast\MyYoastApiClient\Model\MetaDataDto[]', - 'rateCode' => 'string', - 'rateId' => 'int', - 'shippingTaxTotal' => 'string', - 'taxTotal' => 'string' - ]; +'compound' => 'bool', +'label' => 'string', +'metaData' => '\Yoast\MyYoastApiClient\Model\MetaDataDto[]', +'rateCode' => 'string', +'rateId' => 'int', +'shippingTaxTotal' => 'string', +'taxTotal' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -74,14 +72,13 @@ class TaxLineItem implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'id' => null, - 'compound' => null, - 'label' => null, - 'metaData' => null, - 'rateCode' => null, - 'rateId' => null, - 'shippingTaxTotal' => null, - 'taxTotal' => null - ]; +'compound' => null, +'label' => null, +'metaData' => null, +'rateCode' => null, +'rateId' => null, +'shippingTaxTotal' => null, +'taxTotal' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -111,14 +108,13 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'id' => 'id', - 'compound' => 'compound', - 'label' => 'label', - 'metaData' => 'meta_data', - 'rateCode' => 'rate_code', - 'rateId' => 'rate_id', - 'shippingTaxTotal' => 'shipping_tax_total', - 'taxTotal' => 'tax_total' - ]; +'compound' => 'compound', +'label' => 'label', +'metaData' => 'meta_data', +'rateCode' => 'rate_code', +'rateId' => 'rate_id', +'shippingTaxTotal' => 'shipping_tax_total', +'taxTotal' => 'tax_total' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -127,14 +123,13 @@ public static function swaggerFormats() */ protected static $setters = [ 'id' => 'setId', - 'compound' => 'setCompound', - 'label' => 'setLabel', - 'metaData' => 'setMetaData', - 'rateCode' => 'setRateCode', - 'rateId' => 'setRateId', - 'shippingTaxTotal' => 'setShippingTaxTotal', - 'taxTotal' => 'setTaxTotal' - ]; +'compound' => 'setCompound', +'label' => 'setLabel', +'metaData' => 'setMetaData', +'rateCode' => 'setRateCode', +'rateId' => 'setRateId', +'shippingTaxTotal' => 'setShippingTaxTotal', +'taxTotal' => 'setTaxTotal' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -143,14 +138,13 @@ public static function swaggerFormats() */ protected static $getters = [ 'id' => 'getId', - 'compound' => 'getCompound', - 'label' => 'getLabel', - 'metaData' => 'getMetaData', - 'rateCode' => 'getRateCode', - 'rateId' => 'getRateId', - 'shippingTaxTotal' => 'getShippingTaxTotal', - 'taxTotal' => 'getTaxTotal' - ]; +'compound' => 'getCompound', +'label' => 'getLabel', +'metaData' => 'getMetaData', +'rateCode' => 'getRateCode', +'rateId' => 'getRateId', +'shippingTaxTotal' => 'getShippingTaxTotal', +'taxTotal' => 'getTaxTotal' ]; /** * Array of attributes where the key is the local name, @@ -195,8 +189,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -531,5 +523,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/TicketDTO.php b/src/Model/TicketDTO.php index cc41e6b..1348026 100644 --- a/src/Model/TicketDTO.php +++ b/src/Model/TicketDTO.php @@ -1,6 +1,6 @@ 'string', - 'number' => 'string', - 'subject' => 'string' - ]; +'number' => 'string', +'subject' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -69,9 +67,8 @@ class TicketDTO implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'id' => null, - 'number' => null, - 'subject' => null - ]; +'number' => null, +'subject' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -101,9 +98,8 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'id' => 'id', - 'number' => 'number', - 'subject' => 'subject' - ]; +'number' => 'number', +'subject' => 'subject' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -112,9 +108,8 @@ public static function swaggerFormats() */ protected static $setters = [ 'id' => 'setId', - 'number' => 'setNumber', - 'subject' => 'setSubject' - ]; +'number' => 'setNumber', +'subject' => 'setSubject' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -123,9 +118,8 @@ public static function swaggerFormats() */ protected static $getters = [ 'id' => 'getId', - 'number' => 'getNumber', - 'subject' => 'getSubject' - ]; +'number' => 'getNumber', +'subject' => 'getSubject' ]; /** * Array of attributes where the key is the local name, @@ -170,8 +164,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -366,5 +358,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/Transaction.php b/src/Model/Transaction.php index e7855d5..b474cea 100644 --- a/src/Model/Transaction.php +++ b/src/Model/Transaction.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -57,10 +56,9 @@ class Transaction implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerTypes = [ - 'capturedAmount' => 'float', - 'refundedAmount' => 'float', - 'refunds' => 'string[]' - ]; + 'capturedAmount' => 'int', +'refundedAmount' => 'int', +'refunds' => 'string[]' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -69,9 +67,8 @@ class Transaction implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'capturedAmount' => null, - 'refundedAmount' => null, - 'refunds' => null - ]; +'refundedAmount' => null, +'refunds' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -101,9 +98,8 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'capturedAmount' => 'capturedAmount', - 'refundedAmount' => 'refundedAmount', - 'refunds' => 'refunds' - ]; +'refundedAmount' => 'refundedAmount', +'refunds' => 'refunds' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -112,9 +108,8 @@ public static function swaggerFormats() */ protected static $setters = [ 'capturedAmount' => 'setCapturedAmount', - 'refundedAmount' => 'setRefundedAmount', - 'refunds' => 'setRefunds' - ]; +'refundedAmount' => 'setRefundedAmount', +'refunds' => 'setRefunds' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -123,9 +118,8 @@ public static function swaggerFormats() */ protected static $getters = [ 'capturedAmount' => 'getCapturedAmount', - 'refundedAmount' => 'getRefundedAmount', - 'refunds' => 'getRefunds' - ]; +'refundedAmount' => 'getRefundedAmount', +'refunds' => 'getRefunds' ]; /** * Array of attributes where the key is the local name, @@ -170,8 +164,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -228,7 +220,7 @@ public function valid() /** * Gets capturedAmount * - * @return float + * @return int */ public function getCapturedAmount() { @@ -238,7 +230,7 @@ public function getCapturedAmount() /** * Sets capturedAmount * - * @param float $capturedAmount capturedAmount + * @param int $capturedAmount capturedAmount * * @return $this */ @@ -252,7 +244,7 @@ public function setCapturedAmount($capturedAmount) /** * Gets refundedAmount * - * @return float + * @return int */ public function getRefundedAmount() { @@ -262,7 +254,7 @@ public function getRefundedAmount() /** * Sets refundedAmount * - * @param float $refundedAmount refundedAmount + * @param int $refundedAmount refundedAmount * * @return $this */ @@ -366,5 +358,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/TransactionDataDto.php b/src/Model/TransactionDataDto.php index 67503b6..3afc0a9 100644 --- a/src/Model/TransactionDataDto.php +++ b/src/Model/TransactionDataDto.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,12 +57,11 @@ class TransactionDataDto implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'transactionId' => 'string', - 'paymentId' => 'string', - 'createdOn' => 'string', - 'updatedOn' => 'string', - 'paid' => 'bool', - 'transactionObject' => '\Yoast\MyYoastApiClient\Model\Transaction' - ]; +'paymentId' => 'string', +'createdOn' => 'string', +'updatedOn' => 'string', +'paid' => 'bool', +'transactionObject' => '\Yoast\MyYoastApiClient\Model\Transaction' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -72,12 +70,11 @@ class TransactionDataDto implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'transactionId' => null, - 'paymentId' => null, - 'createdOn' => null, - 'updatedOn' => null, - 'paid' => null, - 'transactionObject' => null - ]; +'paymentId' => null, +'createdOn' => null, +'updatedOn' => null, +'paid' => null, +'transactionObject' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -107,12 +104,11 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'transactionId' => 'transactionId', - 'paymentId' => 'paymentId', - 'createdOn' => 'createdOn', - 'updatedOn' => 'updatedOn', - 'paid' => 'paid', - 'transactionObject' => 'transactionObject' - ]; +'paymentId' => 'paymentId', +'createdOn' => 'createdOn', +'updatedOn' => 'updatedOn', +'paid' => 'paid', +'transactionObject' => 'transactionObject' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -121,12 +117,11 @@ public static function swaggerFormats() */ protected static $setters = [ 'transactionId' => 'setTransactionId', - 'paymentId' => 'setPaymentId', - 'createdOn' => 'setCreatedOn', - 'updatedOn' => 'setUpdatedOn', - 'paid' => 'setPaid', - 'transactionObject' => 'setTransactionObject' - ]; +'paymentId' => 'setPaymentId', +'createdOn' => 'setCreatedOn', +'updatedOn' => 'setUpdatedOn', +'paid' => 'setPaid', +'transactionObject' => 'setTransactionObject' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -135,12 +130,11 @@ public static function swaggerFormats() */ protected static $getters = [ 'transactionId' => 'getTransactionId', - 'paymentId' => 'getPaymentId', - 'createdOn' => 'getCreatedOn', - 'updatedOn' => 'getUpdatedOn', - 'paid' => 'getPaid', - 'transactionObject' => 'getTransactionObject' - ]; +'paymentId' => 'getPaymentId', +'createdOn' => 'getCreatedOn', +'updatedOn' => 'getUpdatedOn', +'paid' => 'getPaid', +'transactionObject' => 'getTransactionObject' ]; /** * Array of attributes where the key is the local name, @@ -185,8 +179,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -465,5 +457,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/TransferDto.php b/src/Model/TransferDto.php index 75c20af..7ace1fd 100644 --- a/src/Model/TransferDto.php +++ b/src/Model/TransferDto.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,8 +57,7 @@ class TransferDto implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'fromSourceId' => 'int', - 'toSourceId' => 'int' - ]; +'toSourceId' => 'int' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -68,8 +66,7 @@ class TransferDto implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'fromSourceId' => null, - 'toSourceId' => null - ]; +'toSourceId' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -99,8 +96,7 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'fromSourceId' => 'fromSourceId', - 'toSourceId' => 'toSourceId' - ]; +'toSourceId' => 'toSourceId' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -109,8 +105,7 @@ public static function swaggerFormats() */ protected static $setters = [ 'fromSourceId' => 'setFromSourceId', - 'toSourceId' => 'setToSourceId' - ]; +'toSourceId' => 'setToSourceId' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -119,8 +114,7 @@ public static function swaggerFormats() */ protected static $getters = [ 'fromSourceId' => 'getFromSourceId', - 'toSourceId' => 'getToSourceId' - ]; +'toSourceId' => 'getToSourceId' ]; /** * Array of attributes where the key is the local name, @@ -165,8 +159,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -333,5 +325,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/TransferOwnershipDto.php b/src/Model/TransferOwnershipDto.php index 1cf2f5e..08cbca3 100644 --- a/src/Model/TransferOwnershipDto.php +++ b/src/Model/TransferOwnershipDto.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,8 +57,7 @@ class TransferOwnershipDto implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'fromCustomerId' => 'string', - 'toCustomerId' => 'string' - ]; +'toCustomerId' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -68,8 +66,7 @@ class TransferOwnershipDto implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'fromCustomerId' => null, - 'toCustomerId' => null - ]; +'toCustomerId' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -99,8 +96,7 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'fromCustomerId' => 'fromCustomerId', - 'toCustomerId' => 'toCustomerId' - ]; +'toCustomerId' => 'toCustomerId' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -109,8 +105,7 @@ public static function swaggerFormats() */ protected static $setters = [ 'fromCustomerId' => 'setFromCustomerId', - 'toCustomerId' => 'setToCustomerId' - ]; +'toCustomerId' => 'setToCustomerId' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -119,8 +114,7 @@ public static function swaggerFormats() */ protected static $getters = [ 'fromCustomerId' => 'getFromCustomerId', - 'toCustomerId' => 'getToCustomerId' - ]; +'toCustomerId' => 'getToCustomerId' ]; /** * Array of attributes where the key is the local name, @@ -165,8 +159,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -333,5 +325,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/TransferSiteDto.php b/src/Model/TransferSiteDto.php index a5a13ca..2bcc2fa 100644 --- a/src/Model/TransferSiteDto.php +++ b/src/Model/TransferSiteDto.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,8 +57,7 @@ class TransferSiteDto implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'fromSourceId' => 'int', - 'toSourceId' => 'int' - ]; +'toSourceId' => 'int' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -68,8 +66,7 @@ class TransferSiteDto implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'fromSourceId' => null, - 'toSourceId' => null - ]; +'toSourceId' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -99,8 +96,7 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'fromSourceId' => 'fromSourceId', - 'toSourceId' => 'toSourceId' - ]; +'toSourceId' => 'toSourceId' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -109,8 +105,7 @@ public static function swaggerFormats() */ protected static $setters = [ 'fromSourceId' => 'setFromSourceId', - 'toSourceId' => 'setToSourceId' - ]; +'toSourceId' => 'setToSourceId' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -119,8 +114,7 @@ public static function swaggerFormats() */ protected static $getters = [ 'fromSourceId' => 'getFromSourceId', - 'toSourceId' => 'getToSourceId' - ]; +'toSourceId' => 'getToSourceId' ]; /** * Array of attributes where the key is the local name, @@ -165,8 +159,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -333,5 +325,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/UpdateAllKVRequestDto.php b/src/Model/UpdateAllKVRequestDto.php index e97bc6e..50388a0 100644 --- a/src/Model/UpdateAllKVRequestDto.php +++ b/src/Model/UpdateAllKVRequestDto.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,9 +57,8 @@ class UpdateAllKVRequestDto implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'urls' => 'string[]', - 'pageSize' => 'float', - 'page' => 'float' - ]; +'pageSize' => 'int', +'page' => 'int' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -69,9 +67,8 @@ class UpdateAllKVRequestDto implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'urls' => null, - 'pageSize' => null, - 'page' => null - ]; +'pageSize' => null, +'page' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -101,9 +98,8 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'urls' => 'urls', - 'pageSize' => 'pageSize', - 'page' => 'page' - ]; +'pageSize' => 'pageSize', +'page' => 'page' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -112,9 +108,8 @@ public static function swaggerFormats() */ protected static $setters = [ 'urls' => 'setUrls', - 'pageSize' => 'setPageSize', - 'page' => 'setPage' - ]; +'pageSize' => 'setPageSize', +'page' => 'setPage' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -123,9 +118,8 @@ public static function swaggerFormats() */ protected static $getters = [ 'urls' => 'getUrls', - 'pageSize' => 'getPageSize', - 'page' => 'getPage' - ]; +'pageSize' => 'getPageSize', +'page' => 'getPage' ]; /** * Array of attributes where the key is the local name, @@ -170,8 +164,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -243,7 +235,7 @@ public function setUrls($urls) /** * Gets pageSize * - * @return float + * @return int */ public function getPageSize() { @@ -253,7 +245,7 @@ public function getPageSize() /** * Sets pageSize * - * @param float $pageSize pageSize + * @param int $pageSize pageSize * * @return $this */ @@ -267,7 +259,7 @@ public function setPageSize($pageSize) /** * Gets page * - * @return float + * @return int */ public function getPage() { @@ -277,7 +269,7 @@ public function getPage() /** * Sets page * - * @param float $page page + * @param int $page page * * @return $this */ @@ -357,5 +349,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/UpdateDto.php b/src/Model/UpdateDto.php new file mode 100644 index 0000000..ace67ee --- /dev/null +++ b/src/Model/UpdateDto.php @@ -0,0 +1,294 @@ + 'string' ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'email' => null ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'email' => 'email' ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'email' => 'setEmail' ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'email' => 'getEmail' ]; + + /** + * 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::$swaggerModelName; + } + + + + /** + * 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->container['email'] = isset($data['email']) ? $data['email'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['email'] === null) { + $invalidProperties[] = "'email' 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 email + * + * @return string + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string $email email + * + * @return $this + */ + public function setEmail($email) + { + $this->container['email'] = $email; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} diff --git a/src/Model/UpdateFileDto.php b/src/Model/UpdateFileDto.php index 2fecdbb..ef60727 100644 --- a/src/Model/UpdateFileDto.php +++ b/src/Model/UpdateFileDto.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -57,9 +56,8 @@ class UpdateFileDto implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerTypes = [ - 'secret' => 'string', - 'version' => 'string' - ]; + 'version' => 'string', +'overwrite' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -67,9 +65,8 @@ class UpdateFileDto implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerFormats = [ - 'secret' => null, - 'version' => null - ]; + 'version' => null, +'overwrite' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -98,9 +95,8 @@ public static function swaggerFormats() * @var string[] */ protected static $attributeMap = [ - 'secret' => 'secret', - 'version' => 'version' - ]; + 'version' => 'version', +'overwrite' => 'overwrite' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -108,9 +104,8 @@ public static function swaggerFormats() * @var string[] */ protected static $setters = [ - 'secret' => 'setSecret', - 'version' => 'setVersion' - ]; + 'version' => 'setVersion', +'overwrite' => 'setOverwrite' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -118,9 +113,8 @@ public static function swaggerFormats() * @var string[] */ protected static $getters = [ - 'secret' => 'getSecret', - 'version' => 'getVersion' - ]; + 'version' => 'getVersion', +'overwrite' => 'getOverwrite' ]; /** * Array of attributes where the key is the local name, @@ -165,8 +159,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -182,8 +174,8 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['secret'] = isset($data['secret']) ? $data['secret'] : null; $this->container['version'] = isset($data['version']) ? $data['version'] : null; + $this->container['overwrite'] = isset($data['overwrite']) ? $data['overwrite'] : null; } /** @@ -195,9 +187,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['secret'] === null) { - $invalidProperties[] = "'secret' can't be null"; - } if ($this->container['version'] === null) { $invalidProperties[] = "'version' can't be null"; } @@ -217,49 +206,49 @@ public function valid() /** - * Gets secret + * Gets version * * @return string */ - public function getSecret() + public function getVersion() { - return $this->container['secret']; + return $this->container['version']; } /** - * Sets secret + * Sets version * - * @param string $secret secret + * @param string $version version * * @return $this */ - public function setSecret($secret) + public function setVersion($version) { - $this->container['secret'] = $secret; + $this->container['version'] = $version; return $this; } /** - * Gets version + * Gets overwrite * * @return string */ - public function getVersion() + public function getOverwrite() { - return $this->container['version']; + return $this->container['overwrite']; } /** - * Sets version + * Sets overwrite * - * @param string $version version + * @param string $overwrite overwrite * * @return $this */ - public function setVersion($version) + public function setOverwrite($overwrite) { - $this->container['version'] = $version; + $this->container['overwrite'] = $overwrite; return $this; } @@ -333,5 +322,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/UpdateSiteDto.php b/src/Model/UpdateSiteDto.php index a1fb3b1..b4edcc8 100644 --- a/src/Model/UpdateSiteDto.php +++ b/src/Model/UpdateSiteDto.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -57,8 +56,7 @@ class UpdateSiteDto implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerTypes = [ - 'type' => 'string' - ]; + 'type' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -66,8 +64,7 @@ class UpdateSiteDto implements ModelInterface, ArrayAccess * @var string[] */ protected static $swaggerFormats = [ - 'type' => null - ]; + 'type' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -96,8 +93,7 @@ public static function swaggerFormats() * @var string[] */ protected static $attributeMap = [ - 'type' => 'type' - ]; + 'type' => 'type' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -105,8 +101,7 @@ public static function swaggerFormats() * @var string[] */ protected static $setters = [ - 'type' => 'setType' - ]; + 'type' => 'setType' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -114,8 +109,7 @@ public static function swaggerFormats() * @var string[] */ protected static $getters = [ - 'type' => 'getType' - ]; + 'type' => 'getType' ]; /** * Array of attributes where the key is the local name, @@ -160,8 +154,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -300,5 +292,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/UpdateUserDto.php b/src/Model/UpdateUserDto.php index 2a5b495..1139698 100644 --- a/src/Model/UpdateUserDto.php +++ b/src/Model/UpdateUserDto.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,11 +57,10 @@ class UpdateUserDto implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'userEmail' => 'string', - 'userFirstName' => 'string', - 'userLastName' => 'string', - 'userAvatarUrl' => 'string', - 'enabled' => 'bool' - ]; +'userFirstName' => 'string', +'userLastName' => 'string', +'userAvatarUrl' => 'string', +'enabled' => 'bool' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -71,11 +69,10 @@ class UpdateUserDto implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'userEmail' => null, - 'userFirstName' => null, - 'userLastName' => null, - 'userAvatarUrl' => null, - 'enabled' => null - ]; +'userFirstName' => null, +'userLastName' => null, +'userAvatarUrl' => null, +'enabled' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -105,11 +102,10 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'userEmail' => 'userEmail', - 'userFirstName' => 'userFirstName', - 'userLastName' => 'userLastName', - 'userAvatarUrl' => 'userAvatarUrl', - 'enabled' => 'enabled' - ]; +'userFirstName' => 'userFirstName', +'userLastName' => 'userLastName', +'userAvatarUrl' => 'userAvatarUrl', +'enabled' => 'enabled' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -118,11 +114,10 @@ public static function swaggerFormats() */ protected static $setters = [ 'userEmail' => 'setUserEmail', - 'userFirstName' => 'setUserFirstName', - 'userLastName' => 'setUserLastName', - 'userAvatarUrl' => 'setUserAvatarUrl', - 'enabled' => 'setEnabled' - ]; +'userFirstName' => 'setUserFirstName', +'userLastName' => 'setUserLastName', +'userAvatarUrl' => 'setUserAvatarUrl', +'enabled' => 'setEnabled' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -131,11 +126,10 @@ public static function swaggerFormats() */ protected static $getters = [ 'userEmail' => 'getUserEmail', - 'userFirstName' => 'getUserFirstName', - 'userLastName' => 'getUserLastName', - 'userAvatarUrl' => 'getUserAvatarUrl', - 'enabled' => 'getEnabled' - ]; +'userFirstName' => 'getUserFirstName', +'userLastName' => 'getUserLastName', +'userAvatarUrl' => 'getUserAvatarUrl', +'enabled' => 'getEnabled' ]; /** * Array of attributes where the key is the local name, @@ -180,8 +174,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -429,5 +421,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/UpdateUserToWordpressDto.php b/src/Model/UpdateUserToWordpressDto.php index 6a9825a..57e1e29 100644 --- a/src/Model/UpdateUserToWordpressDto.php +++ b/src/Model/UpdateUserToWordpressDto.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,9 +57,8 @@ class UpdateUserToWordpressDto implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'email' => 'string', - 'firstName' => 'string', - 'lastName' => 'string' - ]; +'firstName' => 'string', +'lastName' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -69,9 +67,8 @@ class UpdateUserToWordpressDto implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'email' => null, - 'firstName' => null, - 'lastName' => null - ]; +'firstName' => null, +'lastName' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -101,9 +98,8 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'email' => 'email', - 'firstName' => 'first_name', - 'lastName' => 'last_name' - ]; +'firstName' => 'first_name', +'lastName' => 'last_name' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -112,9 +108,8 @@ public static function swaggerFormats() */ protected static $setters = [ 'email' => 'setEmail', - 'firstName' => 'setFirstName', - 'lastName' => 'setLastName' - ]; +'firstName' => 'setFirstName', +'lastName' => 'setLastName' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -123,9 +118,8 @@ public static function swaggerFormats() */ protected static $getters = [ 'email' => 'getEmail', - 'firstName' => 'getFirstName', - 'lastName' => 'getLastName' - ]; +'firstName' => 'getFirstName', +'lastName' => 'getLastName' ]; /** * Array of attributes where the key is the local name, @@ -170,8 +164,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -366,5 +358,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/UserDto.php b/src/Model/UserDto.php index e250b77..fce5b0b 100644 --- a/src/Model/UserDto.php +++ b/src/Model/UserDto.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,11 +57,10 @@ class UserDto implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'fname' => 'string', - 'lname' => 'string', - 'id' => 'float', - 'role' => 'string', - 'convRedirect' => 'float' - ]; +'lname' => 'string', +'id' => 'int', +'role' => 'string', +'convRedirect' => 'int' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -71,11 +69,10 @@ class UserDto implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'fname' => null, - 'lname' => null, - 'id' => null, - 'role' => null, - 'convRedirect' => null - ]; +'lname' => null, +'id' => null, +'role' => null, +'convRedirect' => null ]; /** * Array of property to type mappings. Used for (de)serialization @@ -105,11 +102,10 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'fname' => 'fname', - 'lname' => 'lname', - 'id' => 'id', - 'role' => 'role', - 'convRedirect' => 'convRedirect' - ]; +'lname' => 'lname', +'id' => 'id', +'role' => 'role', +'convRedirect' => 'convRedirect' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -118,11 +114,10 @@ public static function swaggerFormats() */ protected static $setters = [ 'fname' => 'setFname', - 'lname' => 'setLname', - 'id' => 'setId', - 'role' => 'setRole', - 'convRedirect' => 'setConvRedirect' - ]; +'lname' => 'setLname', +'id' => 'setId', +'role' => 'setRole', +'convRedirect' => 'setConvRedirect' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -131,11 +126,10 @@ public static function swaggerFormats() */ protected static $getters = [ 'fname' => 'getFname', - 'lname' => 'getLname', - 'id' => 'getId', - 'role' => 'getRole', - 'convRedirect' => 'getConvRedirect' - ]; +'lname' => 'getLname', +'id' => 'getId', +'role' => 'getRole', +'convRedirect' => 'getConvRedirect' ]; /** * Array of attributes where the key is the local name, @@ -180,8 +174,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -294,7 +286,7 @@ public function setLname($lname) /** * Gets id * - * @return float + * @return int */ public function getId() { @@ -304,7 +296,7 @@ public function getId() /** * Sets id * - * @param float $id id + * @param int $id id * * @return $this */ @@ -342,7 +334,7 @@ public function setRole($role) /** * Gets convRedirect * - * @return float + * @return int */ public function getConvRedirect() { @@ -352,7 +344,7 @@ public function getConvRedirect() /** * Sets convRedirect * - * @param float $convRedirect convRedirect + * @param int $convRedirect convRedirect * * @return $this */ @@ -432,5 +424,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/Model/UserIdentity.php b/src/Model/UserIdentity.php index 41ba6a9..41da812 100644 --- a/src/Model/UserIdentity.php +++ b/src/Model/UserIdentity.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -58,17 +57,16 @@ class UserIdentity implements ModelInterface, ArrayAccess */ protected static $swaggerTypes = [ 'id' => 'int', - 'provider' => 'string', - 'authScheme' => 'string', - 'externalId' => 'string', - 'profile' => 'object', - 'credentials' => 'object', - 'created' => '\DateTime', - 'modified' => '\DateTime', - 'createdAt' => '\DateTime', - 'modifiedAt' => '\DateTime', - 'userId' => 'string' - ]; +'provider' => 'string', +'authScheme' => 'string', +'externalId' => 'string', +'profile' => 'object', +'credentials' => 'object', +'created' => '\DateTime', +'modified' => '\DateTime', +'createdAt' => '\DateTime', +'modifiedAt' => '\DateTime', +'userId' => 'string' ]; /** * Array of property to format mappings. Used for (de)serialization @@ -77,17 +75,16 @@ class UserIdentity implements ModelInterface, ArrayAccess */ protected static $swaggerFormats = [ 'id' => null, - 'provider' => null, - 'authScheme' => null, - 'externalId' => null, - 'profile' => null, - 'credentials' => null, - 'created' => 'date-time', - 'modified' => 'date-time', - 'createdAt' => 'date-time', - 'modifiedAt' => 'date-time', - 'userId' => 'uuid' - ]; +'provider' => null, +'authScheme' => null, +'externalId' => null, +'profile' => null, +'credentials' => null, +'created' => 'date-time', +'modified' => 'date-time', +'createdAt' => 'date-time', +'modifiedAt' => 'date-time', +'userId' => 'uuid' ]; /** * Array of property to type mappings. Used for (de)serialization @@ -117,17 +114,16 @@ public static function swaggerFormats() */ protected static $attributeMap = [ 'id' => 'id', - 'provider' => 'provider', - 'authScheme' => 'authScheme', - 'externalId' => 'externalId', - 'profile' => 'profile', - 'credentials' => 'credentials', - 'created' => 'created', - 'modified' => 'modified', - 'createdAt' => 'createdAt', - 'modifiedAt' => 'modifiedAt', - 'userId' => 'userId' - ]; +'provider' => 'provider', +'authScheme' => 'authScheme', +'externalId' => 'externalId', +'profile' => 'profile', +'credentials' => 'credentials', +'created' => 'created', +'modified' => 'modified', +'createdAt' => 'createdAt', +'modifiedAt' => 'modifiedAt', +'userId' => 'userId' ]; /** * Array of attributes to setter functions (for deserialization of responses) @@ -136,17 +132,16 @@ public static function swaggerFormats() */ protected static $setters = [ 'id' => 'setId', - 'provider' => 'setProvider', - 'authScheme' => 'setAuthScheme', - 'externalId' => 'setExternalId', - 'profile' => 'setProfile', - 'credentials' => 'setCredentials', - 'created' => 'setCreated', - 'modified' => 'setModified', - 'createdAt' => 'setCreatedAt', - 'modifiedAt' => 'setModifiedAt', - 'userId' => 'setUserId' - ]; +'provider' => 'setProvider', +'authScheme' => 'setAuthScheme', +'externalId' => 'setExternalId', +'profile' => 'setProfile', +'credentials' => 'setCredentials', +'created' => 'setCreated', +'modified' => 'setModified', +'createdAt' => 'setCreatedAt', +'modifiedAt' => 'setModifiedAt', +'userId' => 'setUserId' ]; /** * Array of attributes to getter functions (for serialization of requests) @@ -155,17 +150,16 @@ public static function swaggerFormats() */ protected static $getters = [ 'id' => 'getId', - 'provider' => 'getProvider', - 'authScheme' => 'getAuthScheme', - 'externalId' => 'getExternalId', - 'profile' => 'getProfile', - 'credentials' => 'getCredentials', - 'created' => 'getCreated', - 'modified' => 'getModified', - 'createdAt' => 'getCreatedAt', - 'modifiedAt' => 'getModifiedAt', - 'userId' => 'getUserId' - ]; +'provider' => 'getProvider', +'authScheme' => 'getAuthScheme', +'externalId' => 'getExternalId', +'profile' => 'getProfile', +'credentials' => 'getCredentials', +'created' => 'getCreated', +'modified' => 'getModified', +'createdAt' => 'getCreatedAt', +'modifiedAt' => 'getModifiedAt', +'userId' => 'getUserId' ]; /** * Array of attributes where the key is the local name, @@ -210,8 +204,6 @@ public function getModelName() - - /** * Associative array for storing property values * @@ -630,5 +622,3 @@ public function __toString() return json_encode(ObjectSerializer::sanitizeForSerialization($this)); } } - - diff --git a/src/ObjectSerializer.php b/src/ObjectSerializer.php index 6be90c6..07c86bc 100644 --- a/src/ObjectSerializer.php +++ b/src/ObjectSerializer.php @@ -18,9 +18,8 @@ * OpenAPI spec version: 1.0.0 * * Generated by: https://github.com/swagger-api/swagger-codegen.git - * Swagger Codegen version: 2.4.15 + * Swagger Codegen version: 3.0.24 */ - /** * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen @@ -43,12 +42,11 @@ class ObjectSerializer * Serialize data * * @param mixed $data the data to serialize - * @param string $type the SwaggerType of the data * @param string $format the format of the Swagger type of the data * * @return string|object serialized form of $data */ - public static function sanitizeForSerialization($data, $type = null, $format = null) + public static function sanitizeForSerialization($data, $format = null) { if (is_scalar($data) || null === $data) { return $data; @@ -59,11 +57,6 @@ public static function sanitizeForSerialization($data, $type = null, $format = n $data[$property] = self::sanitizeForSerialization($value); } return $data; - } elseif ($data instanceof \stdClass) { - foreach ($data as $property => $value) { - $data->$property = self::sanitizeForSerialization($value); - } - return $data; } elseif (is_object($data)) { $values = []; $formats = $data::swaggerFormats(); @@ -73,7 +66,7 @@ public static function sanitizeForSerialization($data, $type = null, $format = n if ($value !== null && !in_array($swaggerType, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true) && method_exists($swaggerType, 'getAllowableEnumValues') - && !in_array($value, $swaggerType::getAllowableEnumValues(), true)) { + && !in_array($value, $swaggerType::getAllowableEnumValues())) { $imploded = implode("', '", $swaggerType::getAllowableEnumValues()); throw new \InvalidArgumentException("Invalid value for enum '$swaggerType', must be one of: '$imploded'"); } @@ -124,22 +117,23 @@ public static function toPathValue($value) * later. * * @param string[]|string|\DateTime $object an object to be serialized to a string + * @param string|null $format the format of the parameter * * @return string the serialized object */ - public static function toQueryValue($object) + public static function toQueryValue($object, $format = null) { if (is_array($object)) { return implode(',', $object); } else { - return self::toString($object); + return self::toString($object, $format); } } /** * Take value and turn it into a string suitable for inclusion in * the header. If it's a string, pass through unchanged - * If it's a datetime object, format it in ISO8601 + * If it's a datetime object, format it in RFC3339 * * @param string $value a string which will be part of the header * @@ -153,7 +147,7 @@ public static function toHeaderValue($value) /** * Take value and turn it into a string suitable for inclusion in * the http body (form parameter). If it's a string, pass through unchanged - * If it's a datetime object, format it in ISO8601 + * If it's a datetime object, format it in RFC3339 * * @param string|\SplFileObject $value the value of the form parameter * @@ -171,16 +165,18 @@ public static function toFormValue($value) /** * Take value and turn it into a string suitable for inclusion in * the parameter. If it's a string, pass through unchanged - * If it's a datetime object, format it in ISO8601 + * If it's a datetime object, format it in RFC3339 + * If it's a date, format it in Y-m-d * * @param string|\DateTime $value the value of the parameter + * @param string|null $format the format of the parameter * * @return string the header string */ - public static function toString($value) + public static function toString($value, $format = null) { - if ($value instanceof \DateTime) { // datetime in ISO8601 format - return $value->format(\DateTime::ATOM); + if ($value instanceof \DateTime) { + return ($format === 'date') ? $value->format('Y-m-d') : $value->format(\DateTime::ATOM); } else { return $value; } @@ -289,7 +285,7 @@ public static function deserialize($data, $class, $httpHeaders = null) return new \SplFileObject($filename, 'r'); } elseif (method_exists($class, 'getAllowableEnumValues')) { - if (!in_array($data, $class::getAllowableEnumValues(), true)) { + if (!in_array($data, $class::getAllowableEnumValues())) { $imploded = implode("', '", $class::getAllowableEnumValues()); throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'"); } @@ -298,7 +294,7 @@ public static function deserialize($data, $class, $httpHeaders = null) // 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})) { - $subclass = '\Yoast\MyYoastApiClient\Model\\' . $data->{$discriminator}; + $subclass = '{{invokerPackage}}\Model\\' . $data->{$discriminator}; if (is_subclass_of($subclass, $class)) { $class = $subclass; } diff --git a/test/Api/AdmissionApiTest.php b/test/Api/AdmissionApiTest.php new file mode 100644 index 0000000..f101f1b --- /dev/null +++ b/test/Api/AdmissionApiTest.php @@ -0,0 +1,122 @@ +