diff --git a/README.md b/README.md deleted file mode 100644 index 6687a73..0000000 --- a/README.md +++ /dev/null @@ -1,475 +0,0 @@ -# my-yoast-php-client -The Yoast provisioning 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.v3.generators.php.PhpClientCodegen - -## Requirements - -PHP 5.5 and later - -## Installation & Usage -### Composer - -To install the bindings via [Composer](http://getcomposer.org/), add the following to `composer.json`: - -``` -{ - "repositories": [ - { - "type": "git", - "url": "http://github.com/yoast/my-yoast-php-client.git" - } - ], - "require": { - "yoast/my-yoast-php-client": "*@dev" - } -} -``` - -Then run `composer install` - -### Manual Installation - -Download the files and include `autoload.php`: - -```php - require_once('/path/to/my-yoast-php-client/vendor/autoload.php'); -``` - -## Tests - -To run the unit tests: - -``` -composer install -./vendor/bin/phpunit -``` - -## Getting Started - -Please follow the [installation procedure](#installation--usage) and then run the following: - -```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\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->apiAdmissionsGet($filter); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling AdmissionApi->apiAdmissionsGet: ', $e->getMessage(), PHP_EOL; -} - -// 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\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->apiAdmissionsIdGet($id); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling AdmissionApi->apiAdmissionsIdGet: ', $e->getMessage(), PHP_EOL; -} - -// 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\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->apiAdmissionsIdPut($body, $id); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling AdmissionApi->apiAdmissionsIdPut: ', $e->getMessage(), PHP_EOL; -} - -// 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\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->apiAdmissionsPagedGet($filter); -} catch (Exception $e) { - echo 'Exception when calling AdmissionApi->apiAdmissionsPagedGet: ', $e->getMessage(), PHP_EOL; -} - -// 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\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->apiAdmissionsPost($body); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling AdmissionApi->apiAdmissionsPost: ', $e->getMessage(), PHP_EOL; -} - -// 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\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\TransferAdmissionDto(); // \Yoast\MyYoastApiClient\Model\TransferAdmissionDto | - -try { - $result = $apiInstance->apiAdmissionsTransferPost($body); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling AdmissionApi->apiAdmissionsTransferPost: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://my.yoast.test:3000/* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*AdmissionApi* | [**apiAdmissionsGet**](docs/Api/AdmissionApi.md#apiadmissionsget) | **GET** /api/Admissions | Get admissions -*AdmissionApi* | [**apiAdmissionsIdGet**](docs/Api/AdmissionApi.md#apiadmissionsidget) | **GET** /api/Admissions/{id} | Get an admission -*AdmissionApi* | [**apiAdmissionsIdPut**](docs/Api/AdmissionApi.md#apiadmissionsidput) | **PUT** /api/Admissions/{id} | Update an admission -*AdmissionApi* | [**apiAdmissionsPagedGet**](docs/Api/AdmissionApi.md#apiadmissionspagedget) | **GET** /api/Admissions/paged | Get admissions -*AdmissionApi* | [**apiAdmissionsPost**](docs/Api/AdmissionApi.md#apiadmissionspost) | **POST** /api/Admissions | Invite a customer -*AdmissionApi* | [**apiAdmissionsTransferPost**](docs/Api/AdmissionApi.md#apiadmissionstransferpost) | **POST** /api/Admissions/transfer | Transfer admissions between customers -*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* | [**apiBlacklistPagedGet**](docs/Api/BlacklistApi.md#apiblacklistpagedget) | **GET** /api/Blacklist/paged | Gets blacklisted sites -*BlacklistApi* | [**apiBlacklistPost**](docs/Api/BlacklistApi.md#apiblacklistpost) | **POST** /api/Blacklist | Creates a blacklisted site -*ChangelogApi* | [**apiChangelogsPut**](docs/Api/ChangelogApi.md#apichangelogsput) | **PUT** /api/Changelogs | Upsert a changelog -*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* | [**apiCourseEnrollmentsPagedGet**](docs/Api/CourseEnrollmentApi.md#apicourseenrollmentspagedget) | **GET** /api/CourseEnrollments/paged | Get customers -*CourseEnrollmentApi* | [**apiCourseEnrollmentsTransferPost**](docs/Api/CourseEnrollmentApi.md#apicourseenrollmentstransferpost) | **POST** /api/CourseEnrollments/transfer | Transfer course enrollments -*CustomerApi* | [**apiCustomersAcademyCourseAccessListSourceIdGet**](docs/Api/CustomerApi.md#apicustomersacademycourseaccesslistsourceidget) | **GET** /api/Customers/academyCourseAccessList/{sourceId} | Academy Course access -*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* | [**apiCustomersCreateAccountPost**](docs/Api/CustomerApi.md#apicustomerscreateaccountpost) | **POST** /api/Customers/create-account | Creates an account for a customer on yoast.com without the signup flow. -*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* | [**apiCustomersIdGdprDeleteDelete**](docs/Api/CustomerApi.md#apicustomersidgdprdeletedelete) | **DELETE** /api/Customers/{id}/gdpr-delete | Performs a \"GDPR forget me\" request. -*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* | [**apiCustomersNewsletterTZhjyjwsYFUMPzNNhJaVADZZIrixRSbXOFgptZJyyKGet**](docs/Api/CustomerApi.md#apicustomersnewslettertzhjyjwsyfumpznnhjavadzzirixrsbxofgptzjyykget) | **GET** /api/Customers/newsletter/tZhjyjwsYFUMPzNNhJaVADZZIrixRSbXOFgptZJyyK | -*CustomerApi* | [**apiCustomersNewsletterTZhjyjwsYFUMPzNNhJaVADZZIrixRSbXOFgptZJyyKPost**](docs/Api/CustomerApi.md#apicustomersnewslettertzhjyjwsyfumpznnhjavadzzirixrsbxofgptzjyykpost) | **POST** /api/Customers/newsletter/tZhjyjwsYFUMPzNNhJaVADZZIrixRSbXOFgptZJyyK | Entry point for the mailchimp webhooks -*CustomerApi* | [**apiCustomersNewsletterWALazNYUBfqZIeUDiqyzETbLdbkODeTCjKokMKcbJVPost**](docs/Api/CustomerApi.md#apicustomersnewsletterwalaznyubfqzieudiqyzetbldbkodetcjkokmkcbjvpost) | **POST** /api/Customers/newsletter/wALazNYUBfqZIeUDiqyzETbLdbkODeTCjKokMKcbJV | Entry point for the mailblue webhooks -*CustomerApi* | [**apiCustomersPagedGet**](docs/Api/CustomerApi.md#apicustomerspagedget) | **GET** /api/Customers/paged | Get customers -*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 following the normal signup flow. -*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 | -*EmailApi* | [**apiEmailsBulkSendPost**](docs/Api/EmailApi.md#apiemailsbulksendpost) | **POST** /api/Emails/bulk-send | -*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. -*GDPRApi* | [**apiCustomersIdGdprDeleteDelete**](docs/Api/GDPRApi.md#apicustomersidgdprdeletedelete) | **DELETE** /api/Customers/{id}/gdpr-delete | Performs a \"GDPR forget me\" request. -*HelpscoutApi* | [**helpscoutPost**](docs/Api/HelpscoutApi.md#helpscoutpost) | **POST** /helpscout | Get information about a customer -*MailingListApi* | [**apiMailingListGet**](docs/Api/MailingListApi.md#apimailinglistget) | **GET** /api/Mailing-list | Get mailingLists Names. -*MailingListApi* | [**apiMailingListIsSubscribedToNewsletterGet**](docs/Api/MailingListApi.md#apimailinglistissubscribedtonewsletterget) | **GET** /api/Mailing-list/isSubscribedToNewsletter | Get the subscription status. -*MailingListApi* | [**apiMailingListStatusGet**](docs/Api/MailingListApi.md#apimailingliststatusget) | **GET** /api/Mailing-list/status | Get the subscription status. -*MailingListApi* | [**apiMailingListSubscribePost**](docs/Api/MailingListApi.md#apimailinglistsubscribepost) | **POST** /api/Mailing-list/subscribe | Subscribe contact to a mailing list. -*MailingListApi* | [**apiMailingListUnsubscribeFromNewsletterPost**](docs/Api/MailingListApi.md#apimailinglistunsubscribefromnewsletterpost) | **POST** /api/Mailing-list/unsubscribeFromNewsletter | Unsubscribe to a mailing list. -*MailingListApi* | [**apiMailingListUnsubscribePost**](docs/Api/MailingListApi.md#apimailinglistunsubscribepost) | **POST** /api/Mailing-list/unsubscribe | Unsubscribe to a mailing list. -*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 -*OrderApi* | [**apiOrdersInvoiceNumberInvoiceNumberGet**](docs/Api/OrderApi.md#apiordersinvoicenumberinvoicenumberget) | **GET** /api/Orders/InvoiceNumber/{invoiceNumber} | Get a order by invoiceNumber -*OrderApi* | [**apiOrdersPagedGet**](docs/Api/OrderApi.md#apiorderspagedget) | **GET** /api/Orders/paged | Get orders -*OrderApi* | [**apiOrdersProductGroupsInvoiceNumberGet**](docs/Api/OrderApi.md#apiordersproductgroupsinvoicenumberget) | **GET** /api/Orders/productGroups/{invoiceNumber} | Get productGroups by invoiceNumber -*PackagesApi* | [**packagesDistOrgNameArchiveZipGet**](docs/Api/PackagesApi.md#packagesdistorgnamearchivezipget) | **GET** /packages/dist/{org}/{name}/{archive}.zip | Serves an .zip of the plugin. -*PackagesApi* | [**packagesP2OrgNameJsonGet**](docs/Api/PackagesApi.md#packagesp2orgnamejsonget) | **GET** /packages/p2/{org}/{name}.json | Serves the requested provider.json -*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 -*ProductGroupApi* | [**apiProductGroupsUpdateDownloadPatch**](docs/Api/ProductGroupApi.md#apiproductgroupsupdatedownloadpatch) | **PATCH** /api/ProductGroups/updateDownload | Update the download -*ProvisionerApi* | [**apiProvisionerDataGet**](docs/Api/ProvisionerApi.md#apiprovisionerdataget) | **GET** /api/ProvisionerData | Get provisioner data -*ProvisionerApi* | [**apiProvisionerDataIdGet**](docs/Api/ProvisionerApi.md#apiprovisionerdataidget) | **GET** /api/ProvisionerData/{id} | Get provisioner data -*ProvisioningAccountApi* | [**apiProvisioningAccountRegenerateTokenPost**](docs/Api/ProvisioningAccountApi.md#apiprovisioningaccountregeneratetokenpost) | **POST** /api/provisioning/account/regenerate-token | Generate a new auth token -*ProvisioningDownloadsApi* | [**apiProvisioningDownloadsCurrentVersionGet**](docs/Api/ProvisioningDownloadsApi.md#apiprovisioningdownloadscurrentversionget) | **GET** /api/provisioning/downloads/currentVersion | Retrieve the current version for the productCode for the provisioner. -*ProvisioningDownloadsApi* | [**apiProvisioningDownloadsCurrentZipGet**](docs/Api/ProvisioningDownloadsApi.md#apiprovisioningdownloadscurrentzipget) | **GET** /api/provisioning/downloads/currentZip | Redirect to the current zip for the productCode. -*ProvisioningUsersApi* | [**apiProvisioningUserScheduleDeletePost**](docs/Api/ProvisioningUsersApi.md#apiprovisioninguserscheduledeletepost) | **POST** /api/provisioning/user/schedule-delete | Schedule a delete for a subscription -*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* | [**apiSitesGetSiteStatusGet**](docs/Api/SiteApi.md#apisitesgetsitestatusget) | **GET** /api/Sites/getSiteStatus | Get a url's HTTP status -*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* | [**apiSitesPagedGet**](docs/Api/SiteApi.md#apisitespagedget) | **GET** /api/Sites/paged | Get sites -*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* | [**apiSubscriptionsIdForceCancelPost**](docs/Api/SubscriptionApi.md#apisubscriptionsidforcecancelpost) | **POST** /api/Subscriptions/{id}/force-cancel | Forcefully cancel 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* | [**apiSubscriptionsLinkSitePost**](docs/Api/SubscriptionApi.md#apisubscriptionslinksitepost) | **POST** /api/Subscriptions/link-site | Link a subscription to provided site URL -*SubscriptionApi* | [**apiSubscriptionsPagedGet**](docs/Api/SubscriptionApi.md#apisubscriptionspagedget) | **GET** /api/Subscriptions/paged | Get subscriptions -*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 -*SubscriptionProvisioningApi* | [**apiProvisioningSubscriptionsCreatePost**](docs/Api/SubscriptionProvisioningApi.md#apiprovisioningsubscriptionscreatepost) | **POST** /api/provisioning/subscriptions/create | Create a subscription -*SubscriptionProvisioningApi* | [**apiProvisioningSubscriptionsIdCancelPost**](docs/Api/SubscriptionProvisioningApi.md#apiprovisioningsubscriptionsidcancelpost) | **POST** /api/provisioning/subscriptions/{id}/cancel | Cancel a single subscription -*SubscriptionProvisioningApi* | [**apiProvisioningSubscriptionsIdGet**](docs/Api/SubscriptionProvisioningApi.md#apiprovisioningsubscriptionsidget) | **GET** /api/provisioning/subscriptions/{id} | Get a subscription -*SubscriptionProvisioningApi* | [**apiProvisioningSubscriptionsIdRenewPost**](docs/Api/SubscriptionProvisioningApi.md#apiprovisioningsubscriptionsidrenewpost) | **POST** /api/provisioning/subscriptions/{id}/renew | Renew a subscription -*SubscriptionProvisioningApi* | [**apiProvisioningSubscriptionsIdSetSitePost**](docs/Api/SubscriptionProvisioningApi.md#apiprovisioningsubscriptionsidsetsitepost) | **POST** /api/provisioning/subscriptions/{id}/set-site | Link a subscription to a site -*WorkerApi* | [**apiWorkerGetRecurringJobsGet**](docs/Api/WorkerApi.md#apiworkergetrecurringjobsget) | **GET** /api/Worker/getRecurringJobs | -*WorkerApi* | [**apiWorkerGetRecurringJobsNameGet**](docs/Api/WorkerApi.md#apiworkergetrecurringjobsnameget) | **GET** /api/Worker/getRecurringJobs/{name} | -*WorkerApi* | [**apiWorkerGetScheduledJobsNameGet**](docs/Api/WorkerApi.md#apiworkergetscheduledjobsnameget) | **GET** /api/Worker/getScheduledJobs/{name} | -*WorkerApi* | [**apiWorkerJobIdDelete**](docs/Api/WorkerApi.md#apiworkerjobiddelete) | **DELETE** /api/Worker/job/{id} | -*WorkerApi* | [**apiWorkerJobIdGet**](docs/Api/WorkerApi.md#apiworkerjobidget) | **GET** /api/Worker/job/{id} | -*WorkerApi* | [**apiWorkerJobPost**](docs/Api/WorkerApi.md#apiworkerjobpost) | **POST** /api/Worker/job | - -## Documentation For Models - - - [AcademyCourseAccessListDto](docs/Model/AcademyCourseAccessListDto.md) - - [AccessToken](docs/Model/AccessToken.md) - - [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) - - [Changelog](docs/Model/Changelog.md) - - [ComposerToken](docs/Model/ComposerToken.md) - - [CouponLineDto](docs/Model/CouponLineDto.md) - - [Course](docs/Model/Course.md) - - [CourseDataDto](docs/Model/CourseDataDto.md) - - [CourseEnrollment](docs/Model/CourseEnrollment.md) - - [CourseEnrollmentFromAcademyDto](docs/Model/CourseEnrollmentFromAcademyDto.md) - - [CreateAccountDto](docs/Model/CreateAccountDto.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) - - [CustomerDetails](docs/Model/CustomerDetails.md) - - [CustomerFromWooDto](docs/Model/CustomerFromWooDto.md) - - [CustomerNote](docs/Model/CustomerNote.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) - - [InviteDto](docs/Model/InviteDto.md) - - [JSZip](docs/Model/JSZip.md) - - [JobOptionsDto](docs/Model/JobOptionsDto.md) - - [LineItemDto](docs/Model/LineItemDto.md) - - [LineItemTax](docs/Model/LineItemTax.md) - - [LinkSiteDto](docs/Model/LinkSiteDto.md) - - [LoginDto](docs/Model/LoginDto.md) - - [LoginUserDto](docs/Model/LoginUserDto.md) - - [MetaDataDto](docs/Model/MetaDataDto.md) - - [Order](docs/Model/Order.md) - - [OrderData](docs/Model/OrderData.md) - - [OrderFromWooDto](docs/Model/OrderFromWooDto.md) - - [OrderRefundDto](docs/Model/OrderRefundDto.md) - - [Product](docs/Model/Product.md) - - [ProductCategory](docs/Model/ProductCategory.md) - - [ProductData](docs/Model/ProductData.md) - - [ProductDownload](docs/Model/ProductDownload.md) - - [ProductFromWooDto](docs/Model/ProductFromWooDto.md) - - [ProductGroup](docs/Model/ProductGroup.md) - - [ProductGroupExtraData](docs/Model/ProductGroupExtraData.md) - - [ProductGroupFromWooDto](docs/Model/ProductGroupFromWooDto.md) - - [ProductGroupMeta](docs/Model/ProductGroupMeta.md) - - [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) - - [RegenerateTokenResponseDto](docs/Model/RegenerateTokenResponseDto.md) - - [RenameBodyDto](docs/Model/RenameBodyDto.md) - - [ResetPasswordDto](docs/Model/ResetPasswordDto.md) - - [RoleIDDto](docs/Model/RoleIDDto.md) - - [ScheduleDeleteUserDto](docs/Model/ScheduleDeleteUserDto.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) - - [SubscribeDto](docs/Model/SubscribeDto.md) - - [Subscription](docs/Model/Subscription.md) - - [SubscriptionProvisioningResponseDto](docs/Model/SubscriptionProvisioningResponseDto.md) - - [SwitchSubscriptionNumberOfTimesDto](docs/Model/SwitchSubscriptionNumberOfTimesDto.md) - - [TaxLineItem](docs/Model/TaxLineItem.md) - - [Transaction](docs/Model/Transaction.md) - - [TransactionDataDto](docs/Model/TransactionDataDto.md) - - [TransferAdmissionDto](docs/Model/TransferAdmissionDto.md) - - [TransferDto](docs/Model/TransferDto.md) - - [TransferOwnershipDto](docs/Model/TransferOwnershipDto.md) - - [TransferSiteDto](docs/Model/TransferSiteDto.md) - - [UnsubscribeDto](docs/Model/UnsubscribeDto.md) - - [UnsubscribeFromNewsletterDto](docs/Model/UnsubscribeFromNewsletterDto.md) - - [UpdateAllKVRequestDto](docs/Model/UpdateAllKVRequestDto.md) - - [UpdateDownloadDto](docs/Model/UpdateDownloadDto.md) - - [UpdateDto](docs/Model/UpdateDto.md) - - [UpdateFileDto](docs/Model/UpdateFileDto.md) - - [UpdateSiteDto](docs/Model/UpdateSiteDto.md) - - [UpdateUserDto](docs/Model/UpdateUserDto.md) - - [UpdateUserToWordpressDto](docs/Model/UpdateUserToWordpressDto.md) - - [UpsertChangelogDto](docs/Model/UpsertChangelogDto.md) - - [UserIdentity](docs/Model/UserIdentity.md) - -## Documentation For Authorization - - -## bearer - -- **Type**: API key -- **API key parameter name**: access_token -- **Location**: URL query string - - -## Author - - - diff --git a/composer.json b/composer.json deleted file mode 100644 index 3157452..0000000 --- a/composer.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "yoast/my-yoast-php-client", - "description": "", - "keywords": [ - "swagger", - "php", - "sdk", - "api" - ], - "homepage": "http://swagger.io", - "license": "proprietary", - "authors": [ - { - "name": "Swagger and contributors", - "homepage": "https://github.com/swagger-api/swagger-codegen" - } - ], - "require": { - "php": ">=5.5", - "ext-curl": "*", - "ext-json": "*", - "ext-mbstring": "*", - "guzzlehttp/guzzle": "^6.2" - }, - "require-dev": { - "phpunit/phpunit": "^4.8", - "squizlabs/php_codesniffer": "~2.6", - "friendsofphp/php-cs-fixer": "~1.12" - }, - "autoload": { - "psr-4": { "Yoast\\MyYoastApiClient\\" : "src/" } - }, - "autoload-dev": { - "psr-4": { "Yoast\\MyYoastApiClient\\" : "test/" } - } -} diff --git a/docs/Api/AdmissionApi.md b/docs/Api/AdmissionApi.md deleted file mode 100644 index 3e738e0..0000000 --- a/docs/Api/AdmissionApi.md +++ /dev/null @@ -1,338 +0,0 @@ -# Yoast\MyYoastApiClient\AdmissionApi - -All URIs are relative to *http://my.yoast.test:3000/* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**apiAdmissionsGet**](AdmissionApi.md#apiadmissionsget) | **GET** /api/Admissions | Get admissions -[**apiAdmissionsIdGet**](AdmissionApi.md#apiadmissionsidget) | **GET** /api/Admissions/{id} | Get an admission -[**apiAdmissionsIdPut**](AdmissionApi.md#apiadmissionsidput) | **PUT** /api/Admissions/{id} | Update an admission -[**apiAdmissionsPagedGet**](AdmissionApi.md#apiadmissionspagedget) | **GET** /api/Admissions/paged | Get admissions -[**apiAdmissionsPost**](AdmissionApi.md#apiadmissionspost) | **POST** /api/Admissions | Invite a customer -[**apiAdmissionsTransferPost**](AdmissionApi.md#apiadmissionstransferpost) | **POST** /api/Admissions/transfer | Transfer admissions between customers - -# **apiAdmissionsGet** -> \Yoast\MyYoastApiClient\Model\Admission[] apiAdmissionsGet($filter) - -Get admissions - -Get and filter admissions - -### 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\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->apiAdmissionsGet($filter); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling AdmissionApi->apiAdmissionsGet: ', $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) - -# **apiAdmissionsIdGet** -> \Yoast\MyYoastApiClient\Model\Admission apiAdmissionsIdGet($id) - -Get an admission - -Get a single admission - -### 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\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->apiAdmissionsIdGet($id); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling AdmissionApi->apiAdmissionsIdGet: ', $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) - -# **apiAdmissionsIdPut** -> \Yoast\MyYoastApiClient\Model\Admission apiAdmissionsIdPut($body, $id) - -Update an admission - -Changes the student for a certain admission - -### 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\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->apiAdmissionsIdPut($body, $id); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling AdmissionApi->apiAdmissionsIdPut: ', $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) - -# **apiAdmissionsPagedGet** -> apiAdmissionsPagedGet($filter) - -Get admissions - -Get and filter admissions - -### 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\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->apiAdmissionsPagedGet($filter); -} catch (Exception $e) { - echo 'Exception when calling AdmissionApi->apiAdmissionsPagedGet: ', $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) - -# **apiAdmissionsPost** -> \Yoast\MyYoastApiClient\Model\Admission apiAdmissionsPost($body) - -Invite a customer - -Invites another customer by email to use this admission - -### 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\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->apiAdmissionsPost($body); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling AdmissionApi->apiAdmissionsPost: ', $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) - -# **apiAdmissionsTransferPost** -> \Yoast\MyYoastApiClient\Model\Admission[] apiAdmissionsTransferPost($body) - -Transfer admissions between customers - -Transfers all admission from one customer to another - -### 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\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\TransferAdmissionDto(); // \Yoast\MyYoastApiClient\Model\TransferAdmissionDto | - -try { - $result = $apiInstance->apiAdmissionsTransferPost($body); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling AdmissionApi->apiAdmissionsTransferPost: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**\Yoast\MyYoastApiClient\Model\TransferAdmissionDto**](../Model/TransferAdmissionDto.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 deleted file mode 100644 index 27125ab..0000000 --- a/docs/Api/AuthApi.md +++ /dev/null @@ -1,283 +0,0 @@ -# Yoast\MyYoastApiClient\AuthApi - -All URIs are relative to *http://my.yoast.test:3000/* - -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 | - -# **apiCustomersLoginPost** -> \Yoast\MyYoastApiClient\Model\AccessToken apiCustomersLoginPost($body) - -Log in a user on MyYoast. - -This is only done for internal user accounts which, in contrast to user accounts, do have set passwords in MyYoast. - -### Example -```php -apiCustomersLoginPost($body); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling AuthApi->apiCustomersLoginPost: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**\Yoast\MyYoastApiClient\Model\LoginDto**](../Model/LoginDto.md)| | - -### Return type - -[**\Yoast\MyYoastApiClient\Model\AccessToken**](../Model/AccessToken.md) - -### Authorization - -No authorization required - -### 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) - -# **apiCustomersLoginUserPost** -> object apiCustomersLoginUserPost($body) - - - -### Example -```php -apiCustomersLoginUserPost($body); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling AuthApi->apiCustomersLoginUserPost: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**\Yoast\MyYoastApiClient\Model\LoginUserDto**](../Model/LoginUserDto.md)| | - -### Return type - -**object** - -### Authorization - -No authorization required - -### 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) - -# **apiCustomersLogoutUserPost** -> object apiCustomersLogoutUserPost() - -Logout the user on Yoast.com. - -### Example -```php -apiCustomersLogoutUserPost(); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling AuthApi->apiCustomersLogoutUserPost: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters -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) - -# **authYoastCallbackGet** -> authYoastCallbackGet() - - - -### Example -```php -authYoastCallbackGet(); -} catch (Exception $e) { - echo 'Exception when calling AuthApi->authYoastCallbackGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### 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) - -# **authYoastGet** -> authYoastGet() - - - -### Example -```php -authYoastGet(); -} catch (Exception $e) { - echo 'Exception when calling AuthApi->authYoastGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### 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) - -# **logoutGet** -> logoutGet() - - - -### 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\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 -); - -try { - $apiInstance->logoutGet(); -} catch (Exception $e) { - echo 'Exception when calling AuthApi->logoutGet: ', $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) - diff --git a/docs/Api/BlacklistApi.md b/docs/Api/BlacklistApi.md deleted file mode 100644 index ab17f4b..0000000 --- a/docs/Api/BlacklistApi.md +++ /dev/null @@ -1,227 +0,0 @@ -# Yoast\MyYoastApiClient\BlacklistApi - -All URIs are relative to *http://my.yoast.test:3000/* - -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 -[**apiBlacklistPagedGet**](BlacklistApi.md#apiblacklistpagedget) | **GET** /api/Blacklist/paged | Gets blacklisted sites -[**apiBlacklistPost**](BlacklistApi.md#apiblacklistpost) | **POST** /api/Blacklist | Creates a blacklisted site - -# **apiBlacklistGet** -> \Yoast\MyYoastApiClient\Model\Blacklist[] apiBlacklistGet($filter) - -Gets blacklisted sites - -Get and filter blacklisted sites - -### 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\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->apiBlacklistGet($filter); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling BlacklistApi->apiBlacklistGet: ', $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) - -# **apiBlacklistIdDelete** -> string apiBlacklistIdDelete($id) - -Remove a site from the blacklist - -Deletes a single blacklisted site - -### 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\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 -); -$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | - -try { - $result = $apiInstance->apiBlacklistIdDelete($id); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling BlacklistApi->apiBlacklistIdDelete: ', $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) - -# **apiBlacklistPagedGet** -> \Yoast\MyYoastApiClient\Model\Blacklist[] apiBlacklistPagedGet($filter) - -Gets blacklisted sites - -Get and filter blacklisted sites - -### 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\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->apiBlacklistPagedGet($filter); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling BlacklistApi->apiBlacklistPagedGet: ', $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) - -# **apiBlacklistPost** -> string apiBlacklistPost($body) - -Creates a blacklisted site - -Creates a single site - -### 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\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 -); -$body = new \Yoast\MyYoastApiClient\Model\CreateBlacklistSiteDto(); // \Yoast\MyYoastApiClient\Model\CreateBlacklistSiteDto | - -try { - $result = $apiInstance->apiBlacklistPost($body); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling BlacklistApi->apiBlacklistPost: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**\Yoast\MyYoastApiClient\Model\CreateBlacklistSiteDto**](../Model/CreateBlacklistSiteDto.md)| | - -### Return type - -**string** - -### 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/ChangelogApi.md b/docs/Api/ChangelogApi.md deleted file mode 100644 index 83ae96d..0000000 --- a/docs/Api/ChangelogApi.md +++ /dev/null @@ -1,62 +0,0 @@ -# Yoast\MyYoastApiClient\ChangelogApi - -All URIs are relative to *http://my.yoast.test:3000/* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**apiChangelogsPut**](ChangelogApi.md#apichangelogsput) | **PUT** /api/Changelogs | Upsert a changelog - -# **apiChangelogsPut** -> \Yoast\MyYoastApiClient\Model\Changelog apiChangelogsPut($body) - -Upsert a changelog - -Upsert a changelog for a product group. - -### 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\ChangelogApi( - // 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\UpsertChangelogDto(); // \Yoast\MyYoastApiClient\Model\UpsertChangelogDto | - -try { - $result = $apiInstance->apiChangelogsPut($body); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling ChangelogApi->apiChangelogsPut: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**\Yoast\MyYoastApiClient\Model\UpsertChangelogDto**](../Model/UpsertChangelogDto.md)| | - -### Return type - -[**\Yoast\MyYoastApiClient\Model\Changelog**](../Model/Changelog.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/CloudflareApi.md b/docs/Api/CloudflareApi.md deleted file mode 100644 index ea66df3..0000000 --- a/docs/Api/CloudflareApi.md +++ /dev/null @@ -1,113 +0,0 @@ -# Yoast\MyYoastApiClient\CloudflareApi - -All URIs are relative to *http://my.yoast.test:3000/* - -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 - -# **apiCloudflareKvRegisteredDomainsPurgePost** -> object[] apiCloudflareKvRegisteredDomainsPurgePost($body) - -Purge kv pairs from the registered domains key value store in Cloudflare - -### 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\CloudflareApi( - // 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\PurgeKVRequestDto(); // \Yoast\MyYoastApiClient\Model\PurgeKVRequestDto | - -try { - $result = $apiInstance->apiCloudflareKvRegisteredDomainsPurgePost($body); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling CloudflareApi->apiCloudflareKvRegisteredDomainsPurgePost: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**\Yoast\MyYoastApiClient\Model\PurgeKVRequestDto**](../Model/PurgeKVRequestDto.md)| | - -### Return type - -**object[]** - -### 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) - -# **apiCloudflareKvRegisteredDomainsUpdateAllPost** -> object apiCloudflareKvRegisteredDomainsUpdateAllPost($body) - -Update sites in the registered domains key value store in Cloudflare - -### 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\CloudflareApi( - // 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\UpdateAllKVRequestDto(); // \Yoast\MyYoastApiClient\Model\UpdateAllKVRequestDto | - -try { - $result = $apiInstance->apiCloudflareKvRegisteredDomainsUpdateAllPost($body); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling CloudflareApi->apiCloudflareKvRegisteredDomainsUpdateAllPost: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**\Yoast\MyYoastApiClient\Model\UpdateAllKVRequestDto**](../Model/UpdateAllKVRequestDto.md)| | - -### Return type - -**object** - -### 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/ComposerTokenApi.md b/docs/Api/ComposerTokenApi.md deleted file mode 100644 index 0073dab..0000000 --- a/docs/Api/ComposerTokenApi.md +++ /dev/null @@ -1,174 +0,0 @@ -# Yoast\MyYoastApiClient\ComposerTokenApi - -All URIs are relative to *http://my.yoast.test:3000/* - -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 - -# **apiComposerTokensGeneratePost** -> \Yoast\MyYoastApiClient\Model\ComposerToken apiComposerTokensGeneratePost($body) - -Generates a Composer token - -Generates a personal token for the logged in customer that can be used to download our plugins with Composer. - -### 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\ComposerTokenApi( - // 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\GenerateDto(); // \Yoast\MyYoastApiClient\Model\GenerateDto | - -try { - $result = $apiInstance->apiComposerTokensGeneratePost($body); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling ComposerTokenApi->apiComposerTokensGeneratePost: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**\Yoast\MyYoastApiClient\Model\GenerateDto**](../Model/GenerateDto.md)| | - -### Return type - -[**\Yoast\MyYoastApiClient\Model\ComposerToken**](../Model/ComposerToken.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) - -# **apiComposerTokensIdDeletePost** -> \Yoast\MyYoastApiClient\Model\ComposerToken apiComposerTokensIdDeletePost($id) - -Disable a composer token - -Renders a single composer token unusable - -### 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\ComposerTokenApi( - // 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 = "id_example"; // string | - -try { - $result = $apiInstance->apiComposerTokensIdDeletePost($id); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling ComposerTokenApi->apiComposerTokensIdDeletePost: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| | - -### Return type - -[**\Yoast\MyYoastApiClient\Model\ComposerToken**](../Model/ComposerToken.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) - -# **apiComposerTokensIdRenamePost** -> \Yoast\MyYoastApiClient\Model\ComposerToken apiComposerTokensIdRenamePost($body, $id) - -Renames a Composer token - -Changes the name of a Composer token - -### 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\ComposerTokenApi( - // 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\RenameBodyDto(); // \Yoast\MyYoastApiClient\Model\RenameBodyDto | -$id = "id_example"; // string | - -try { - $result = $apiInstance->apiComposerTokensIdRenamePost($body, $id); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling ComposerTokenApi->apiComposerTokensIdRenamePost: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**\Yoast\MyYoastApiClient\Model\RenameBodyDto**](../Model/RenameBodyDto.md)| | - **id** | **string**| | - -### Return type - -[**\Yoast\MyYoastApiClient\Model\ComposerToken**](../Model/ComposerToken.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/CourseApi.md b/docs/Api/CourseApi.md deleted file mode 100644 index 990f6d2..0000000 --- a/docs/Api/CourseApi.md +++ /dev/null @@ -1,169 +0,0 @@ -# Yoast\MyYoastApiClient\CourseApi - -All URIs are relative to *http://my.yoast.test:3000/* - -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} | - -# **apiCoursesFromAcademyPut** -> \Yoast\MyYoastApiClient\Model\Course apiCoursesFromAcademyPut($body) - -Upserts a course - -Updates a course, or creates it if it doesn't exist - -### 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\CourseApi( - // 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\FromAcademyDto(); // \Yoast\MyYoastApiClient\Model\FromAcademyDto | - -try { - $result = $apiInstance->apiCoursesFromAcademyPut($body); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling CourseApi->apiCoursesFromAcademyPut: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**\Yoast\MyYoastApiClient\Model\FromAcademyDto**](../Model/FromAcademyDto.md)| | - -### Return type - -[**\Yoast\MyYoastApiClient\Model\Course**](../Model/Course.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) - -# **apiCoursesGet** -> \Yoast\MyYoastApiClient\Model\Course[] apiCoursesGet($filter) - -Get courses - -Get and filter courses - -### 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\CourseApi( - // 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->apiCoursesGet($filter); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling CourseApi->apiCoursesGet: ', $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\Course[]**](../Model/Course.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) - -# **apiCoursesIdGet** -> apiCoursesIdGet($id) - - - -### 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\CourseApi( - // 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 { - $apiInstance->apiCoursesIdGet($id); -} catch (Exception $e) { - echo 'Exception when calling CourseApi->apiCoursesIdGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**string**](../Model/.md)| | - -### 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) - diff --git a/docs/Api/CourseEnrollmentApi.md b/docs/Api/CourseEnrollmentApi.md deleted file mode 100644 index 6fc97a9..0000000 --- a/docs/Api/CourseEnrollmentApi.md +++ /dev/null @@ -1,451 +0,0 @@ -# Yoast\MyYoastApiClient\CourseEnrollmentApi - -All URIs are relative to *http://my.yoast.test:3000/* - -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 -[**apiCourseEnrollmentsPagedGet**](CourseEnrollmentApi.md#apicourseenrollmentspagedget) | **GET** /api/CourseEnrollments/paged | Get customers -[**apiCourseEnrollmentsTransferPost**](CourseEnrollmentApi.md#apicourseenrollmentstransferpost) | **POST** /api/CourseEnrollments/transfer | Transfer course enrollments - -# **apiCourseEnrollmentsBulkInvitePost** -> \Yoast\MyYoastApiClient\Model\CourseEnrollment[] apiCourseEnrollmentsBulkInvitePost($body) - -Bulk invite for Course Enrollment. - -Bulk invites another Customer by email to use this Course Enrollment. - -### 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\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 -); -$body = new \Yoast\MyYoastApiClient\Model\BulkInviteDto(); // \Yoast\MyYoastApiClient\Model\BulkInviteDto | - -try { - $result = $apiInstance->apiCourseEnrollmentsBulkInvitePost($body); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling CourseEnrollmentApi->apiCourseEnrollmentsBulkInvitePost: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**\Yoast\MyYoastApiClient\Model\BulkInviteDto**](../Model/BulkInviteDto.md)| | - -### Return type - -[**\Yoast\MyYoastApiClient\Model\CourseEnrollment[]**](../Model/CourseEnrollment.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) - -# **apiCourseEnrollmentsFromAcademyPut** -> apiCourseEnrollmentsFromAcademyPut($body) - -Update a CourseEnrollment - -Updates the progress for a certain course and student with data from academy.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\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 -); -$body = new \Yoast\MyYoastApiClient\Model\CourseEnrollmentFromAcademyDto(); // \Yoast\MyYoastApiClient\Model\CourseEnrollmentFromAcademyDto | - -try { - $apiInstance->apiCourseEnrollmentsFromAcademyPut($body); -} catch (Exception $e) { - echo 'Exception when calling CourseEnrollmentApi->apiCourseEnrollmentsFromAcademyPut: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**\Yoast\MyYoastApiClient\Model\CourseEnrollmentFromAcademyDto**](../Model/CourseEnrollmentFromAcademyDto.md)| | - -### Return type - -void (empty response body) - -### Authorization - -[bearer](../../README.md#bearer) - -### HTTP request headers - - - **Content-Type**: 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) - -Get course enrollments - -Get and filter course enrollments - -### 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\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 { - $result = $apiInstance->apiCourseEnrollmentsGet($filter); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling CourseEnrollmentApi->apiCourseEnrollmentsGet: ', $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\CourseEnrollment[]**](../Model/CourseEnrollment.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) - -# **apiCourseEnrollmentsGetLegacyExpiringGet** -> \Yoast\MyYoastApiClient\Model\CourseEnrollment[] apiCourseEnrollmentsGetLegacyExpiringGet($from, $until) - -Get legacy course enrollments that expire between two given dates - -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 -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`. - // This is optional, `GuzzleHttp\Client` will be used as default. - 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 | - -try { - $result = $apiInstance->apiCourseEnrollmentsGetLegacyExpiringGet($from, $until); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling CourseEnrollmentApi->apiCourseEnrollmentsGetLegacyExpiringGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **from** | **\DateTime**| | - **until** | **\DateTime**| | - -### Return type - -[**\Yoast\MyYoastApiClient\Model\CourseEnrollment[]**](../Model/CourseEnrollment.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) - -# **apiCourseEnrollmentsIdGet** -> \Yoast\MyYoastApiClient\Model\CourseEnrollment apiCourseEnrollmentsIdGet($id, $filter) - -Get a course enrollment - -Get a single course enrollment - -### 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\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 -); -$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | -$filter = new \stdClass; // object | Used for filtering/joining the results. - -try { - $result = $apiInstance->apiCourseEnrollmentsIdGet($id, $filter); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling CourseEnrollmentApi->apiCourseEnrollmentsIdGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**string**](../Model/.md)| | - **filter** | [**object**](../Model/.md)| Used for filtering/joining the results. | [optional] - -### Return type - -[**\Yoast\MyYoastApiClient\Model\CourseEnrollment**](../Model/CourseEnrollment.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) - -# **apiCourseEnrollmentsIdInvitePost** -> \Yoast\MyYoastApiClient\Model\CourseEnrollment apiCourseEnrollmentsIdInvitePost($body, $id) - -Invite a customer - -Invites another Customer by email to use this Course Enrollment - -### 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\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 -); -$body = new \Yoast\MyYoastApiClient\Model\InviteDto(); // \Yoast\MyYoastApiClient\Model\InviteDto | -$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | - -try { - $result = $apiInstance->apiCourseEnrollmentsIdInvitePost($body, $id); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling CourseEnrollmentApi->apiCourseEnrollmentsIdInvitePost: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**\Yoast\MyYoastApiClient\Model\InviteDto**](../Model/InviteDto.md)| | - **id** | [**string**](../Model/.md)| | - -### Return type - -[**\Yoast\MyYoastApiClient\Model\CourseEnrollment**](../Model/CourseEnrollment.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) - -# **apiCourseEnrollmentsPagedGet** -> apiCourseEnrollmentsPagedGet($filter) - -Get customers - -Get and filter customer - -### 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\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->apiCourseEnrollmentsPagedGet($filter); -} catch (Exception $e) { - echo 'Exception when calling CourseEnrollmentApi->apiCourseEnrollmentsPagedGet: ', $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) - -# **apiCourseEnrollmentsTransferPost** -> \Yoast\MyYoastApiClient\Model\CourseEnrollment[] apiCourseEnrollmentsTransferPost($body) - -Transfer course enrollments - -Transfers all Course Enrollments from one Customer to another. - -### 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\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 -); -$body = new \Yoast\MyYoastApiClient\Model\TransferDto(); // \Yoast\MyYoastApiClient\Model\TransferDto | - -try { - $result = $apiInstance->apiCourseEnrollmentsTransferPost($body); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling CourseEnrollmentApi->apiCourseEnrollmentsTransferPost: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**\Yoast\MyYoastApiClient\Model\TransferDto**](../Model/TransferDto.md)| | - -### Return type - -[**\Yoast\MyYoastApiClient\Model\CourseEnrollment[]**](../Model/CourseEnrollment.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/CustomerApi.md b/docs/Api/CustomerApi.md deleted file mode 100644 index 229e409..0000000 --- a/docs/Api/CustomerApi.md +++ /dev/null @@ -1,2476 +0,0 @@ -# Yoast\MyYoastApiClient\CustomerApi - -All URIs are relative to *http://my.yoast.test:3000/* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**apiCustomersAcademyCourseAccessListSourceIdGet**](CustomerApi.md#apicustomersacademycourseaccesslistsourceidget) | **GET** /api/Customers/academyCourseAccessList/{sourceId} | Academy Course access -[**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. -[**apiCustomersCreateAccountPost**](CustomerApi.md#apicustomerscreateaccountpost) | **POST** /api/Customers/create-account | Creates an account for a customer on yoast.com without the signup flow. -[**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 -[**apiCustomersIdGdprDeleteDelete**](CustomerApi.md#apicustomersidgdprdeletedelete) | **DELETE** /api/Customers/{id}/gdpr-delete | Performs a \"GDPR forget me\" request. -[**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 -[**apiCustomersNewsletterTZhjyjwsYFUMPzNNhJaVADZZIrixRSbXOFgptZJyyKGet**](CustomerApi.md#apicustomersnewslettertzhjyjwsyfumpznnhjavadzzirixrsbxofgptzjyykget) | **GET** /api/Customers/newsletter/tZhjyjwsYFUMPzNNhJaVADZZIrixRSbXOFgptZJyyK | -[**apiCustomersNewsletterTZhjyjwsYFUMPzNNhJaVADZZIrixRSbXOFgptZJyyKPost**](CustomerApi.md#apicustomersnewslettertzhjyjwsyfumpznnhjavadzzirixrsbxofgptzjyykpost) | **POST** /api/Customers/newsletter/tZhjyjwsYFUMPzNNhJaVADZZIrixRSbXOFgptZJyyK | Entry point for the mailchimp webhooks -[**apiCustomersNewsletterWALazNYUBfqZIeUDiqyzETbLdbkODeTCjKokMKcbJVPost**](CustomerApi.md#apicustomersnewsletterwalaznyubfqzieudiqyzetbldbkodetcjkokmkcbjvpost) | **POST** /api/Customers/newsletter/wALazNYUBfqZIeUDiqyzETbLdbkODeTCjKokMKcbJV | Entry point for the mailblue webhooks -[**apiCustomersPagedGet**](CustomerApi.md#apicustomerspagedget) | **GET** /api/Customers/paged | Get customers -[**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 following the normal signup flow. - -# **apiCustomersAcademyCourseAccessListSourceIdGet** -> \Yoast\MyYoastApiClient\Model\AcademyCourseAccessListDto apiCustomersAcademyCourseAccessListSourceIdGet($sourceId) - -Academy Course access - -A list of Course IDs the customer has access to. - -### 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 -); -$sourceId = 56; // int | The WordPress User ID to retrieve the course IDs for. - -try { - $result = $apiInstance->apiCustomersAcademyCourseAccessListSourceIdGet($sourceId); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersAcademyCourseAccessListSourceIdGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **sourceId** | **int**| The WordPress User ID to retrieve the course IDs for. | - -### Return type - -[**\Yoast\MyYoastApiClient\Model\AcademyCourseAccessListDto**](../Model/AcademyCourseAccessListDto.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) - -# **apiCustomersActivatePost** -> object apiCustomersActivatePost($body) - -Activate the account of a user - -This route can be used to activate the account of a new user. - -### Example -```php -apiCustomersActivatePost($body); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersActivatePost: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**\Yoast\MyYoastApiClient\Model\ActivateAccountDto**](../Model/ActivateAccountDto.md)| | - -### Return type - -**object** - -### Authorization - -No authorization required - -### 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) - -# **apiCustomersAllrolesGet** -> object apiCustomersAllrolesGet() - -Get all existing roles with their ID. - -### 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 -); - -try { - $result = $apiInstance->apiCustomersAllrolesGet(); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersAllrolesGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -**object** - -### 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) - -# **apiCustomersCreateAccountPost** -> object apiCustomersCreateAccountPost($body) - -Creates an account for a customer on yoast.com without the signup flow. - -Using this route, a new account can be created on yoast.com. The customer will receive a set-password mail. - -### Example -```php -apiCustomersCreateAccountPost($body); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersCreateAccountPost: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**\Yoast\MyYoastApiClient\Model\CreateAccountDto**](../Model/CreateAccountDto.md)| | - -### Return type - -**object** - -### Authorization - -No authorization required - -### 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) - -# **apiCustomersCurrentGet** -> \Yoast\MyYoastApiClient\Model\Customer apiCustomersCurrentGet() - -Get the current customer - -### 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 -); - -try { - $result = $apiInstance->apiCustomersCurrentGet(); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersCurrentGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**\Yoast\MyYoastApiClient\Model\Customer**](../Model/Customer.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) - -# **apiCustomersCustomerIdBuyerCourseEnrollmentsGet** -> \Yoast\MyYoastApiClient\Model\CourseEnrollment[] apiCustomersCustomerIdBuyerCourseEnrollmentsGet($customerId) - -Find Course Enrollments that a customer is buyer of - -### 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 -); -$customerId = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | - -try { - $result = $apiInstance->apiCustomersCustomerIdBuyerCourseEnrollmentsGet($customerId); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersCustomerIdBuyerCourseEnrollmentsGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **customerId** | [**string**](../Model/.md)| | - -### Return type - -[**\Yoast\MyYoastApiClient\Model\CourseEnrollment[]**](../Model/CourseEnrollment.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) - -# **apiCustomersCustomerIdComposerTokensGet** -> \Yoast\MyYoastApiClient\Model\ComposerToken[] apiCustomersCustomerIdComposerTokensGet($customerId, $filter) - -Get composer tokens - -Get and filter composer tokens of a customer - -### 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 -); -$customerId = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | -$filter = new \stdClass; // object | Used for filtering/joining the results. - -try { - $result = $apiInstance->apiCustomersCustomerIdComposerTokensGet($customerId, $filter); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersCustomerIdComposerTokensGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **customerId** | [**string**](../Model/.md)| | - **filter** | [**object**](../Model/.md)| Used for filtering/joining the results. | [optional] - -### Return type - -[**\Yoast\MyYoastApiClient\Model\ComposerToken[]**](../Model/ComposerToken.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) - -# **apiCustomersCustomerIdComposerTokensIdGet** -> \Yoast\MyYoastApiClient\Model\ComposerToken apiCustomersCustomerIdComposerTokensIdGet($customerId, $id, $filter) - -Get a composer token - -Get a single composer token of a customer - -### 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 -); -$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->apiCustomersCustomerIdComposerTokensIdGet($customerId, $id, $filter); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersCustomerIdComposerTokensIdGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -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 - -[**\Yoast\MyYoastApiClient\Model\ComposerToken**](../Model/ComposerToken.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) - -# **apiCustomersCustomerIdCourseEnrollmentsGet** -> \Yoast\MyYoastApiClient\Model\CourseEnrollment[] apiCustomersCustomerIdCourseEnrollmentsGet($ownershipRelation, $customerId, $courseId) - -Find Course Enrollments - -Find Course Enrollments and filter by course or ownership relation. - -### 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 -); -$ownershipRelation = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | -$customerId = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | -$courseId = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | - -try { - $result = $apiInstance->apiCustomersCustomerIdCourseEnrollmentsGet($ownershipRelation, $customerId, $courseId); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersCustomerIdCourseEnrollmentsGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ownershipRelation** | [**string**](../Model/.md)| | - **customerId** | [**string**](../Model/.md)| | - **courseId** | [**string**](../Model/.md)| | [optional] - -### Return type - -[**\Yoast\MyYoastApiClient\Model\CourseEnrollment[]**](../Model/CourseEnrollment.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) - -# **apiCustomersCustomerIdIdentitiesGet** -> \Yoast\MyYoastApiClient\Model\UserIdentity[] apiCustomersCustomerIdIdentitiesGet($customerId, $filter) - -Get user identities - -Get and filter user identities of a customer - -### 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 -); -$customerId = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | -$filter = new \stdClass; // object | Used for filtering/joining the results. - -try { - $result = $apiInstance->apiCustomersCustomerIdIdentitiesGet($customerId, $filter); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersCustomerIdIdentitiesGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **customerId** | [**string**](../Model/.md)| | - **filter** | [**object**](../Model/.md)| Used for filtering/joining the results. | [optional] - -### Return type - -[**\Yoast\MyYoastApiClient\Model\UserIdentity[]**](../Model/UserIdentity.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) - -# **apiCustomersCustomerIdNewsletterDelete** -> object apiCustomersCustomerIdNewsletterDelete($customerId) - -Unsubscribe from the 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 -); -$customerId = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | - -try { - $result = $apiInstance->apiCustomersCustomerIdNewsletterDelete($customerId); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersCustomerIdNewsletterDelete: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **customerId** | [**string**](../Model/.md)| | - -### Return type - -**object** - -### 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) - -# **apiCustomersCustomerIdNewsletterGet** -> object apiCustomersCustomerIdNewsletterGet($customerId) - -Newsletter subscription status - -### 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 -); -$customerId = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | - -try { - $result = $apiInstance->apiCustomersCustomerIdNewsletterGet($customerId); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersCustomerIdNewsletterGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **customerId** | [**string**](../Model/.md)| | - -### Return type - -**object** - -### 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) - -# **apiCustomersCustomerIdNewsletterPost** -> object apiCustomersCustomerIdNewsletterPost($customerId) - -Subscribe to the 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 -); -$customerId = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | - -try { - $result = $apiInstance->apiCustomersCustomerIdNewsletterPost($customerId); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersCustomerIdNewsletterPost: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **customerId** | [**string**](../Model/.md)| | - -### Return type - -**object** - -### 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) - -# **apiCustomersCustomerIdOrdersGet** -> \Yoast\MyYoastApiClient\Model\Order[] apiCustomersCustomerIdOrdersGet($customerId, $filter) - -Get orders - -Get and filter orders of a customer - -### 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 -); -$customerId = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | -$filter = new \stdClass; // object | Used for filtering/joining the results. - -try { - $result = $apiInstance->apiCustomersCustomerIdOrdersGet($customerId, $filter); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersCustomerIdOrdersGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **customerId** | [**string**](../Model/.md)| | - **filter** | [**object**](../Model/.md)| Used for filtering/joining the results. | [optional] - -### Return type - -[**\Yoast\MyYoastApiClient\Model\Order[]**](../Model/Order.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) - -# **apiCustomersCustomerIdOrdersIdGet** -> \Yoast\MyYoastApiClient\Model\Order apiCustomersCustomerIdOrdersIdGet($customerId, $id, $filter) - -Get a order - -Get a single order of a customer - -### 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 -); -$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->apiCustomersCustomerIdOrdersIdGet($customerId, $id, $filter); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersCustomerIdOrdersIdGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -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 - -[**\Yoast\MyYoastApiClient\Model\Order**](../Model/Order.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) - -# **apiCustomersCustomerIdSitesGet** -> \Yoast\MyYoastApiClient\Model\Site[] apiCustomersCustomerIdSitesGet($customerId, $filter) - -Get sites - -Get and filter sites of a customer - -### 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 -); -$customerId = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | -$filter = new \stdClass; // object | Used for filtering/joining the results. - -try { - $result = $apiInstance->apiCustomersCustomerIdSitesGet($customerId, $filter); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersCustomerIdSitesGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **customerId** | [**string**](../Model/.md)| | - **filter** | [**object**](../Model/.md)| Used for filtering/joining the results. | [optional] - -### 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) - -# **apiCustomersCustomerIdSitesIdGet** -> \Yoast\MyYoastApiClient\Model\Site apiCustomersCustomerIdSitesIdGet($customerId, $id, $filter) - -Get a site - -Get a single site of a customer - -### 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 -); -$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->apiCustomersCustomerIdSitesIdGet($customerId, $id, $filter); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersCustomerIdSitesIdGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -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 - -[**\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) - -# **apiCustomersCustomerIdSitesPost** -> \Yoast\MyYoastApiClient\Model\Site apiCustomersCustomerIdSitesPost($body, $customerId) - -Create a site for a user - -Create a site record so we can link a subscription to a site which is linked to a customer - -### 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 -); -$body = new \Yoast\MyYoastApiClient\Model\CreateSiteBodyDto(); // \Yoast\MyYoastApiClient\Model\CreateSiteBodyDto | -$customerId = "customerId_example"; // string | - -try { - $result = $apiInstance->apiCustomersCustomerIdSitesPost($body, $customerId); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersCustomerIdSitesPost: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**\Yoast\MyYoastApiClient\Model\CreateSiteBodyDto**](../Model/CreateSiteBodyDto.md)| | - **customerId** | **string**| | - -### Return type - -[**\Yoast\MyYoastApiClient\Model\Site**](../Model/Site.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) - -# **apiCustomersCustomerIdStudentCourseEnrollmentsGet** -> \Yoast\MyYoastApiClient\Model\CourseEnrollment[] apiCustomersCustomerIdStudentCourseEnrollmentsGet($customerId) - -Find Course Enrollments that a customer is student in - -### 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 -); -$customerId = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | - -try { - $result = $apiInstance->apiCustomersCustomerIdStudentCourseEnrollmentsGet($customerId); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersCustomerIdStudentCourseEnrollmentsGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **customerId** | [**string**](../Model/.md)| | - -### Return type - -[**\Yoast\MyYoastApiClient\Model\CourseEnrollment[]**](../Model/CourseEnrollment.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) - -# **apiCustomersCustomerIdSubscriptionsGet** -> \Yoast\MyYoastApiClient\Model\Subscription[] apiCustomersCustomerIdSubscriptionsGet($customerId, $filter) - -Get subscriptions - -Get and filter subscriptions of a customer - -### 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 -); -$customerId = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | -$filter = new \stdClass; // object | Used for filtering/joining the results. - -try { - $result = $apiInstance->apiCustomersCustomerIdSubscriptionsGet($customerId, $filter); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersCustomerIdSubscriptionsGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **customerId** | [**string**](../Model/.md)| | - **filter** | [**object**](../Model/.md)| Used for filtering/joining the results. | [optional] - -### 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) - -# **apiCustomersCustomerIdSubscriptionsIdCancelPost** -> object apiCustomersCustomerIdSubscriptionsIdCancelPost($body, $customerId, $id) - -Cancel (part of) a subscription. - -Communicates a (partial) subscription 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 -); -$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->apiCustomersCustomerIdSubscriptionsIdCancelPost($body, $customerId, $id); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersCustomerIdSubscriptionsIdCancelPost: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**\Yoast\MyYoastApiClient\Model\CancelSubscriptionBodyDto**](../Model/CancelSubscriptionBodyDto.md)| | - **customerId** | [**string**](../Model/.md)| | - **id** | [**string**](../Model/.md)| | - -### Return type - -**object** - -### 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) - -# **apiCustomersCustomerIdSubscriptionsIdGet** -> \Yoast\MyYoastApiClient\Model\Subscription apiCustomersCustomerIdSubscriptionsIdGet($customerId, $id, $filter) - -Get a subscriptions - -Get a single subscriptions of a customer - -### 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 -); -$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->apiCustomersCustomerIdSubscriptionsIdGet($customerId, $id, $filter); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersCustomerIdSubscriptionsIdGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -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 - -[**\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) - -# **apiCustomersGet** -> \Yoast\MyYoastApiClient\Model\Customer[] apiCustomersGet($filter) - -Get customers - -Get and filter customers - -### 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 -); -$filter = new \stdClass; // object | Used for filtering/joining the results. - -try { - $result = $apiInstance->apiCustomersGet($filter); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersGet: ', $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\Customer[]**](../Model/Customer.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) - -# **apiCustomersIdAccessTokensPost** -> apiCustomersIdAccessTokensPost($id) - -Create an access token for a user - -### Example -```php -apiCustomersIdAccessTokensPost($id); -} catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersIdAccessTokensPost: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**string**](../Model/.md)| | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### 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) - -# **apiCustomersIdAvatarPost** -> \Yoast\MyYoastApiClient\Model\Customer apiCustomersIdAvatarPost($id) - -Upload a new UserAvatar to WordPress - -This route allows the user to upload a new UserAvatar to their WordPress account - -### 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 -); -$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | - -try { - $result = $apiInstance->apiCustomersIdAvatarPost($id); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersIdAvatarPost: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**string**](../Model/.md)| | - -### Return type - -[**\Yoast\MyYoastApiClient\Model\Customer**](../Model/Customer.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) - -# **apiCustomersIdDownloadGet** -> \Yoast\MyYoastApiClient\Model\JSZip apiCustomersIdDownloadGet($id) - -Download profile. - -Downloads the data of the given customer as CSV files inside a ZIP file. - -### 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 -); -$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | - -try { - $result = $apiInstance->apiCustomersIdDownloadGet($id); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersIdDownloadGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**string**](../Model/.md)| | - -### Return type - -[**\Yoast\MyYoastApiClient\Model\JSZip**](../Model/JSZip.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) - -# **apiCustomersIdEnablePost** -> object apiCustomersIdEnablePost($id) - -Enables the customer with the given ID - -Used when customers accidentally disable their own account - -### 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 -); -$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | - -try { - $result = $apiInstance->apiCustomersIdEnablePost($id); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersIdEnablePost: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**string**](../Model/.md)| | - -### Return type - -**object** - -### 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) - -# **apiCustomersIdFindRefundsGet** -> \Yoast\MyYoastApiClient\Model\Refund[] apiCustomersIdFindRefundsGet($id) - -Find refunds for user - -Find the refunds for provided user id. - -### 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 -); -$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | - -try { - $result = $apiInstance->apiCustomersIdFindRefundsGet($id); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersIdFindRefundsGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**string**](../Model/.md)| | - -### Return type - -[**\Yoast\MyYoastApiClient\Model\Refund[]**](../Model/Refund.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) - -# **apiCustomersIdGdprDeleteDelete** -> string apiCustomersIdGdprDeleteDelete($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 -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 -); -$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | - -try { - $result = $apiInstance->apiCustomersIdGdprDeleteDelete($id); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersIdGdprDeleteDelete: ', $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) - -# **apiCustomersIdGet** -> \Yoast\MyYoastApiClient\Model\Customer apiCustomersIdGet($id, $filter) - -Get a customer - -Get a single customer - -### 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 -); -$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | -$filter = new \stdClass; // object | Used for filtering/joining the results. - -try { - $result = $apiInstance->apiCustomersIdGet($id, $filter); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersIdGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**string**](../Model/.md)| | - **filter** | [**object**](../Model/.md)| Used for filtering/joining the results. | [optional] - -### Return type - -[**\Yoast\MyYoastApiClient\Model\Customer**](../Model/Customer.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) - -# **apiCustomersIdPasswordPatch** -> \Yoast\MyYoastApiClient\Model\Customer apiCustomersIdPasswordPatch($body, $id) - -Update a customer's password in WordPress - -This route allows a customer to updates their password on WordPress. - -### 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 -); -$body = new \Yoast\MyYoastApiClient\Model\ChangePasswordDto(); // \Yoast\MyYoastApiClient\Model\ChangePasswordDto | -$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | - -try { - $result = $apiInstance->apiCustomersIdPasswordPatch($body, $id); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersIdPasswordPatch: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**\Yoast\MyYoastApiClient\Model\ChangePasswordDto**](../Model/ChangePasswordDto.md)| | - **id** | [**string**](../Model/.md)| | - -### Return type - -[**\Yoast\MyYoastApiClient\Model\Customer**](../Model/Customer.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) - -# **apiCustomersIdPatch** -> apiCustomersIdPatch($body, $id) - - - -### 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 -); -$body = new \Yoast\MyYoastApiClient\Model\UpdateUserDto(); // \Yoast\MyYoastApiClient\Model\UpdateUserDto | -$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | - -try { - $apiInstance->apiCustomersIdPatch($body, $id); -} catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersIdPatch: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**\Yoast\MyYoastApiClient\Model\UpdateUserDto**](../Model/UpdateUserDto.md)| | - **id** | [**string**](../Model/.md)| | - -### Return type - -void (empty response body) - -### Authorization - -[bearer](../../README.md#bearer) - -### HTTP request headers - - - **Content-Type**: 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) - -# **apiCustomersIdProfileGet** -> object apiCustomersIdProfileGet($id) - - - -### 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 -); -$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | - -try { - $result = $apiInstance->apiCustomersIdProfileGet($id); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersIdProfileGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**string**](../Model/.md)| | - -### Return type - -**object** - -### 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) - -# **apiCustomersIdProfilePatch** -> \Yoast\MyYoastApiClient\Model\Customer apiCustomersIdProfilePatch($body, $id) - -Update a customer to WordPress - -This route allows a customer to updates their profile on WordPress. - -### 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 -); -$body = new \Yoast\MyYoastApiClient\Model\UpdateUserToWordpressDto(); // \Yoast\MyYoastApiClient\Model\UpdateUserToWordpressDto | -$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | - -try { - $result = $apiInstance->apiCustomersIdProfilePatch($body, $id); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersIdProfilePatch: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**\Yoast\MyYoastApiClient\Model\UpdateUserToWordpressDto**](../Model/UpdateUserToWordpressDto.md)| | - **id** | [**string**](../Model/.md)| | - -### Return type - -[**\Yoast\MyYoastApiClient\Model\Customer**](../Model/Customer.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) - -# **apiCustomersIdRoleMappingDelete** -> apiCustomersIdRoleMappingDelete($body, $id) - - - -### 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 -); -$body = new \Yoast\MyYoastApiClient\Model\RoleIDDto(); // \Yoast\MyYoastApiClient\Model\RoleIDDto | -$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | - -try { - $apiInstance->apiCustomersIdRoleMappingDelete($body, $id); -} catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersIdRoleMappingDelete: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**\Yoast\MyYoastApiClient\Model\RoleIDDto**](../Model/RoleIDDto.md)| | - **id** | [**string**](../Model/.md)| | - -### Return type - -void (empty response body) - -### Authorization - -[bearer](../../README.md#bearer) - -### HTTP request headers - - - **Content-Type**: 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) - -# **apiCustomersIdRoleMappingPost** -> apiCustomersIdRoleMappingPost($body, $id) - - - -### 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 -); -$body = new \Yoast\MyYoastApiClient\Model\RoleIDDto(); // \Yoast\MyYoastApiClient\Model\RoleIDDto | -$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | - -try { - $apiInstance->apiCustomersIdRoleMappingPost($body, $id); -} catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersIdRoleMappingPost: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**\Yoast\MyYoastApiClient\Model\RoleIDDto**](../Model/RoleIDDto.md)| | - **id** | [**string**](../Model/.md)| | - -### Return type - -void (empty response body) - -### Authorization - -[bearer](../../README.md#bearer) - -### HTTP request headers - - - **Content-Type**: 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) - -# **apiCustomersIdRolesGet** -> apiCustomersIdRolesGet($id) - - - -### 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 -); -$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | - -try { - $apiInstance->apiCustomersIdRolesGet($id); -} catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersIdRolesGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**string**](../Model/.md)| | - -### 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) - -# **apiCustomersNewsletterListSubscribePost** -> object apiCustomersNewsletterListSubscribePost($body, $list) - -Subscribes a user to a newsletter - -Subscribes a user to the given (url) newsletter. - -### Example -```php -apiCustomersNewsletterListSubscribePost($body, $list); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersNewsletterListSubscribePost: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**\Yoast\MyYoastApiClient\Model\SubscribeByEmailBodyDto**](../Model/SubscribeByEmailBodyDto.md)| | - **list** | **string**| | - -### Return type - -**object** - -### Authorization - -No authorization required - -### 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) - -# **apiCustomersNewsletterTZhjyjwsYFUMPzNNhJaVADZZIrixRSbXOFgptZJyyKGet** -> apiCustomersNewsletterTZhjyjwsYFUMPzNNhJaVADZZIrixRSbXOFgptZJyyKGet() - - - -### Example -```php -apiCustomersNewsletterTZhjyjwsYFUMPzNNhJaVADZZIrixRSbXOFgptZJyyKGet(); -} catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersNewsletterTZhjyjwsYFUMPzNNhJaVADZZIrixRSbXOFgptZJyyKGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### 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) - -# **apiCustomersNewsletterTZhjyjwsYFUMPzNNhJaVADZZIrixRSbXOFgptZJyyKPost** -> apiCustomersNewsletterTZhjyjwsYFUMPzNNhJaVADZZIrixRSbXOFgptZJyyKPost() - -Entry point for the mailchimp webhooks - -Digests the mailchimp subscribe webhook response to subscribe a customer(contact) to a mailblue list - -### Example -```php -apiCustomersNewsletterTZhjyjwsYFUMPzNNhJaVADZZIrixRSbXOFgptZJyyKPost(); -} catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersNewsletterTZhjyjwsYFUMPzNNhJaVADZZIrixRSbXOFgptZJyyKPost: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### 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) - -# **apiCustomersNewsletterWALazNYUBfqZIeUDiqyzETbLdbkODeTCjKokMKcbJVPost** -> apiCustomersNewsletterWALazNYUBfqZIeUDiqyzETbLdbkODeTCjKokMKcbJVPost() - -Entry point for the mailblue webhooks - -Digests the mailblue webhook - -### Example -```php -apiCustomersNewsletterWALazNYUBfqZIeUDiqyzETbLdbkODeTCjKokMKcbJVPost(); -} catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersNewsletterWALazNYUBfqZIeUDiqyzETbLdbkODeTCjKokMKcbJVPost: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### 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) - -# **apiCustomersPagedGet** -> apiCustomersPagedGet($filter) - -Get customers - -Get and filter customer - -### 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 -); -$filter = new \stdClass; // object | Used for filtering/joining the results. - -try { - $apiInstance->apiCustomersPagedGet($filter); -} catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersPagedGet: ', $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) - -# **apiCustomersResetPasswordPatch** -> object apiCustomersResetPasswordPatch($body) - -Reset the user's password. - -This route allows a user to reset its password. - -### Example -```php -apiCustomersResetPasswordPatch($body); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersResetPasswordPatch: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**\Yoast\MyYoastApiClient\Model\ResetPasswordDto**](../Model/ResetPasswordDto.md)| | - -### Return type - -**object** - -### Authorization - -No authorization required - -### 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) - -# **apiCustomersRolemappingIdsGet** -> string[] apiCustomersRolemappingIdsGet() - -Get the ids of all customers with at least one role. - -Requires the caller to have the admin role. - -### 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 -); - -try { - $result = $apiInstance->apiCustomersRolemappingIdsGet(); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersRolemappingIdsGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters -This endpoint does not need any parameter. - -### 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) - -# **apiCustomersSendResetPasswordEmailPost** -> object apiCustomersSendResetPasswordEmailPost($body) - -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 -apiCustomersSendResetPasswordEmailPost($body); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersSendResetPasswordEmailPost: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**\Yoast\MyYoastApiClient\Model\SendResetPasswordEmailDto**](../Model/SendResetPasswordEmailDto.md)| | - -### Return type - -**object** - -### Authorization - -No authorization required - -### 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) - -# **apiCustomersSignupPost** -> object apiCustomersSignupPost($body) - -Signup a customer on yoast.com following the normal signup flow. - -Using this route, a new account can be created on yoast.com - -### Example -```php -apiCustomersSignupPost($body); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling CustomerApi->apiCustomersSignupPost: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**\Yoast\MyYoastApiClient\Model\SignupAccountDto**](../Model/SignupAccountDto.md)| | - -### Return type - -**object** - -### Authorization - -No authorization required - -### 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/CustomerNoteApi.md b/docs/Api/CustomerNoteApi.md deleted file mode 100644 index ea8c51f..0000000 --- a/docs/Api/CustomerNoteApi.md +++ /dev/null @@ -1,223 +0,0 @@ -# Yoast\MyYoastApiClient\CustomerNoteApi - -All URIs are relative to *http://my.yoast.test:3000/* - -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 | - -# **apiCustomerNotesGet** -> \Yoast\MyYoastApiClient\Model\CustomerNote[] apiCustomerNotesGet($filter) - -Get customer notes - -Get and filter customer notes - -### 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\CustomerNoteApi( - // 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->apiCustomerNotesGet($filter); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling CustomerNoteApi->apiCustomerNotesGet: ', $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\CustomerNote[]**](../Model/CustomerNote.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) - -# **apiCustomerNotesIdDelete** -> apiCustomerNotesIdDelete($id) - - - -### 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\CustomerNoteApi( - // 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 { - $apiInstance->apiCustomerNotesIdDelete($id); -} catch (Exception $e) { - echo 'Exception when calling CustomerNoteApi->apiCustomerNotesIdDelete: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**string**](../Model/.md)| | - -### 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) - -# **apiCustomerNotesIdGet** -> \Yoast\MyYoastApiClient\Model\CustomerNote apiCustomerNotesIdGet($id, $filter) - -Get a customer note - -Get a single customer note - -### 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\CustomerNoteApi( - // 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 | -$filter = new \stdClass; // object | Used for filtering/joining the results. - -try { - $result = $apiInstance->apiCustomerNotesIdGet($id, $filter); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling CustomerNoteApi->apiCustomerNotesIdGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**string**](../Model/.md)| | - **filter** | [**object**](../Model/.md)| Used for filtering/joining the results. | [optional] - -### Return type - -[**\Yoast\MyYoastApiClient\Model\CustomerNote**](../Model/CustomerNote.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) - -# **apiCustomerNotesPost** -> apiCustomerNotesPost($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\CustomerNoteApi( - // 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\CreateCustomerNoteDto(); // \Yoast\MyYoastApiClient\Model\CreateCustomerNoteDto | - -try { - $apiInstance->apiCustomerNotesPost($body); -} catch (Exception $e) { - echo 'Exception when calling CustomerNoteApi->apiCustomerNotesPost: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**\Yoast\MyYoastApiClient\Model\CreateCustomerNoteDto**](../Model/CreateCustomerNoteDto.md)| | - -### Return type - -void (empty response body) - -### Authorization - -[bearer](../../README.md#bearer) - -### HTTP request headers - - - **Content-Type**: 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/DownloadApi.md b/docs/Api/DownloadApi.md deleted file mode 100644 index 3c67676..0000000 --- a/docs/Api/DownloadApi.md +++ /dev/null @@ -1,114 +0,0 @@ -# Yoast\MyYoastApiClient\DownloadApi - -All URIs are relative to *http://my.yoast.test:3000/* - -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. - -# **apiDownloadsFileNameGet** -> apiDownloadsFileNameGet($version, $pluginVersion, $site, $name) - -Route to download a file - -Download a file if the authenticated user has access to that file. - -### Example -```php -apiDownloadsFileNameGet($version, $pluginVersion, $site, $name); -} catch (Exception $e) { - echo 'Exception when calling DownloadApi->apiDownloadsFileNameGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **version** | **string**| | - **pluginVersion** | **string**| | - **site** | **string**| | - **name** | **string**| | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### 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) - -# **apiDownloadsFileNamePost** -> object apiDownloadsFileNamePost($body, $name) - -Route to update a file. - -Updates a file - -### Example -```php -apiDownloadsFileNamePost($body, $name); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling DownloadApi->apiDownloadsFileNamePost: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**\Yoast\MyYoastApiClient\Model\UpdateFileDto**](../Model/UpdateFileDto.md)| | - **name** | **string**| | - -### Return type - -**object** - -### Authorization - -No authorization required - -### 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/EDDApi.md b/docs/Api/EDDApi.md deleted file mode 100644 index 9fcbf42..0000000 --- a/docs/Api/EDDApi.md +++ /dev/null @@ -1,109 +0,0 @@ -# Yoast\MyYoastApiClient\EDDApi - -All URIs are relative to *http://my.yoast.test:3000/* - -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 | - -# **eddSlApiGet** -> eddSlApiGet($eddAction, $url, $itemName) - -Activate or deactivate a site license - -Used for legacy EDD license checks. - -### Example -```php -eddSlApiGet($eddAction, $url, $itemName); -} catch (Exception $e) { - echo 'Exception when calling EDDApi->eddSlApiGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **eddAction** | **string**| | - **url** | **string**| | - **itemName** | **string**| | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### 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) - -# **eddSlApiPost** -> eddSlApiPost($body, $eddAction) - - - -### Example -```php -eddSlApiPost($body, $eddAction); -} catch (Exception $e) { - echo 'Exception when calling EDDApi->eddSlApiPost: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**\Yoast\MyYoastApiClient\Model\EddDTO**](../Model/EddDTO.md)| | - **eddAction** | **string**| | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: 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 deleted file mode 100644 index e9e84e4..0000000 --- a/docs/Api/EmailApi.md +++ /dev/null @@ -1,60 +0,0 @@ -# Yoast\MyYoastApiClient\EmailApi - -All URIs are relative to *http://my.yoast.test:3000/* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**apiEmailsBulkSendPost**](EmailApi.md#apiemailsbulksendpost) | **POST** /api/Emails/bulk-send | - -# **apiEmailsBulkSendPost** -> int apiEmailsBulkSendPost($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\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->apiEmailsBulkSendPost($body); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling EmailApi->apiEmailsBulkSendPost: ', $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 deleted file mode 100644 index 71df9fb..0000000 --- a/docs/Api/ExportOrdersApi.md +++ /dev/null @@ -1,119 +0,0 @@ -# Yoast\MyYoastApiClient\ExportOrdersApi - -All URIs are relative to *http://my.yoast.test:3000/* - -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 - -# **exportOrdersV2FromToTypeGet** -> string exportOrdersV2FromToTypeGet($from, $to, $type, $password) - -Creates an export for orders - -Exports orders in a given time period. - -### Example -```php -exportOrdersV2FromToTypeGet($from, $to, $type, $password); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling ExportOrdersApi->exportOrdersV2FromToTypeGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **from** | **string**| | - **to** | **string**| | - **type** | **string**| | - **password** | **string**| | [optional] - -### Return type - -**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) - -# **exportOrdersYearMonthTypeGet** -> string exportOrdersYearMonthTypeGet($year, $month, $type, $password) - -Creates an export for orders - -Exports orders in a given time period. - -### Example -```php -exportOrdersYearMonthTypeGet($year, $month, $type, $password); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling ExportOrdersApi->exportOrdersYearMonthTypeGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **year** | **string**| | - **month** | **string**| | - **type** | **string**| | - **password** | **string**| | [optional] - -### Return type - -**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) - diff --git a/docs/Api/FromWooCommerceApi.md b/docs/Api/FromWooCommerceApi.md deleted file mode 100644 index f86e82d..0000000 --- a/docs/Api/FromWooCommerceApi.md +++ /dev/null @@ -1,227 +0,0 @@ -# Yoast\MyYoastApiClient\FromWooCommerceApi - -All URIs are relative to *http://my.yoast.test:3000/* - -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. - -# **apiCustomersFromWooCommercePut** -> \Yoast\MyYoastApiClient\Model\Customer apiCustomersFromWooCommercePut($body) - -Update or create a customer - -This endpoint can be used by WooCommerce to update or create a customer in the MyYoast database. - -### 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\FromWooCommerceApi( - // 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\CustomerFromWooDto(); // \Yoast\MyYoastApiClient\Model\CustomerFromWooDto | - -try { - $result = $apiInstance->apiCustomersFromWooCommercePut($body); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling FromWooCommerceApi->apiCustomersFromWooCommercePut: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**\Yoast\MyYoastApiClient\Model\CustomerFromWooDto**](../Model/CustomerFromWooDto.md)| | - -### Return type - -[**\Yoast\MyYoastApiClient\Model\Customer**](../Model/Customer.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) - -# **apiOrdersFromWooCommercePut** -> \Yoast\MyYoastApiClient\Model\Order apiOrdersFromWooCommercePut($body) - -Sync orders to MyYoast. - -This route allows WooCommerce to sync order data to MyYoast. - -### 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\FromWooCommerceApi( - // 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\OrderFromWooDto(); // \Yoast\MyYoastApiClient\Model\OrderFromWooDto | - -try { - $result = $apiInstance->apiOrdersFromWooCommercePut($body); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling FromWooCommerceApi->apiOrdersFromWooCommercePut: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**\Yoast\MyYoastApiClient\Model\OrderFromWooDto**](../Model/OrderFromWooDto.md)| | - -### Return type - -[**\Yoast\MyYoastApiClient\Model\Order**](../Model/Order.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) - -# **apiProductGroupsFromWooCommercePut** -> \Yoast\MyYoastApiClient\Model\ProductGroup apiProductGroupsFromWooCommercePut($body) - -Sync products to MyYoast. - -This route allows WooCommerce to sync product data to MyYoast. - -### 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\FromWooCommerceApi( - // 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\ProductGroupFromWooDto(); // \Yoast\MyYoastApiClient\Model\ProductGroupFromWooDto | - -try { - $result = $apiInstance->apiProductGroupsFromWooCommercePut($body); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling FromWooCommerceApi->apiProductGroupsFromWooCommercePut: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**\Yoast\MyYoastApiClient\Model\ProductGroupFromWooDto**](../Model/ProductGroupFromWooDto.md)| | - -### Return type - -[**\Yoast\MyYoastApiClient\Model\ProductGroup**](../Model/ProductGroup.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) - -# **apiProductsFromWooCommercePut** -> \Yoast\MyYoastApiClient\Model\Product apiProductsFromWooCommercePut($body) - -Sync products to MyYoast. - -This route allows WooCommerce to sync product data to MyYoast. - -### 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\FromWooCommerceApi( - // 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\ProductFromWooDto(); // \Yoast\MyYoastApiClient\Model\ProductFromWooDto | - -try { - $result = $apiInstance->apiProductsFromWooCommercePut($body); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling FromWooCommerceApi->apiProductsFromWooCommercePut: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**\Yoast\MyYoastApiClient\Model\ProductFromWooDto**](../Model/ProductFromWooDto.md)| | - -### Return type - -[**\Yoast\MyYoastApiClient\Model\Product**](../Model/Product.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/GDPRApi.md b/docs/Api/GDPRApi.md deleted file mode 100644 index bd05a9f..0000000 --- a/docs/Api/GDPRApi.md +++ /dev/null @@ -1,62 +0,0 @@ -# Yoast\MyYoastApiClient\GDPRApi - -All URIs are relative to *http://my.yoast.test:3000/* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**apiCustomersIdGdprDeleteDelete**](GDPRApi.md#apicustomersidgdprdeletedelete) | **DELETE** /api/Customers/{id}/gdpr-delete | Performs a \"GDPR forget me\" request. - -# **apiCustomersIdGdprDeleteDelete** -> string apiCustomersIdGdprDeleteDelete($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 -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\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->apiCustomersIdGdprDeleteDelete($id); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling GDPRApi->apiCustomersIdGdprDeleteDelete: ', $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 deleted file mode 100644 index 9faee38..0000000 --- a/docs/Api/HelpscoutApi.md +++ /dev/null @@ -1,59 +0,0 @@ -# Yoast\MyYoastApiClient\HelpscoutApi - -All URIs are relative to *http://my.yoast.test:3000/* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**helpscoutPost**](HelpscoutApi.md#helpscoutpost) | **POST** /helpscout | Get information about a customer - -# **helpscoutPost** -> object helpscoutPost($body, $xHelpScoutSignature) - -Get information about a customer - -Get order and contact information about a customer in html format - -### Example -```php -helpscoutPost($body, $xHelpScoutSignature); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling HelpscoutApi->helpscoutPost: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**\Yoast\MyYoastApiClient\Model\HelpScoutDto**](../Model/HelpScoutDto.md)| | - **xHelpScoutSignature** | **string**| The Helpscout signature | - -### Return type - -**object** - -### Authorization - -No authorization required - -### 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/MailingListApi.md b/docs/Api/MailingListApi.md deleted file mode 100644 index 54ecb32..0000000 --- a/docs/Api/MailingListApi.md +++ /dev/null @@ -1,299 +0,0 @@ -# Yoast\MyYoastApiClient\MailingListApi - -All URIs are relative to *http://my.yoast.test:3000/* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**apiMailingListGet**](MailingListApi.md#apimailinglistget) | **GET** /api/Mailing-list | Get mailingLists Names. -[**apiMailingListIsSubscribedToNewsletterGet**](MailingListApi.md#apimailinglistissubscribedtonewsletterget) | **GET** /api/Mailing-list/isSubscribedToNewsletter | Get the subscription status. -[**apiMailingListStatusGet**](MailingListApi.md#apimailingliststatusget) | **GET** /api/Mailing-list/status | Get the subscription status. -[**apiMailingListSubscribePost**](MailingListApi.md#apimailinglistsubscribepost) | **POST** /api/Mailing-list/subscribe | Subscribe contact to a mailing list. -[**apiMailingListUnsubscribeFromNewsletterPost**](MailingListApi.md#apimailinglistunsubscribefromnewsletterpost) | **POST** /api/Mailing-list/unsubscribeFromNewsletter | Unsubscribe to a mailing list. -[**apiMailingListUnsubscribePost**](MailingListApi.md#apimailinglistunsubscribepost) | **POST** /api/Mailing-list/unsubscribe | Unsubscribe to a mailing list. - -# **apiMailingListGet** -> apiMailingListGet() - -Get mailingLists Names. - -Gets the names of all the mailing lists. - -### Example -```php -apiMailingListGet(); -} catch (Exception $e) { - echo 'Exception when calling MailingListApi->apiMailingListGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### 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) - -# **apiMailingListIsSubscribedToNewsletterGet** -> apiMailingListIsSubscribedToNewsletterGet($email) - -Get the subscription status. - -Get the subscription status for a contact and list name. - -### Example -```php -apiMailingListIsSubscribedToNewsletterGet($email); -} catch (Exception $e) { - echo 'Exception when calling MailingListApi->apiMailingListIsSubscribedToNewsletterGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **email** | **string**| | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### 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) - -# **apiMailingListStatusGet** -> apiMailingListStatusGet($email, $list) - -Get the subscription status. - -Get the subscription status for a contact and list name. - -### Example -```php -apiMailingListStatusGet($email, $list); -} catch (Exception $e) { - echo 'Exception when calling MailingListApi->apiMailingListStatusGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **email** | **string**| | - **list** | **string**| | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### 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) - -# **apiMailingListSubscribePost** -> apiMailingListSubscribePost($body) - -Subscribe contact to a mailing list. - -subscribes a contact to a mailing list. - -### Example -```php -apiMailingListSubscribePost($body); -} catch (Exception $e) { - echo 'Exception when calling MailingListApi->apiMailingListSubscribePost: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**\Yoast\MyYoastApiClient\Model\SubscribeDto**](../Model/SubscribeDto.md)| | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: 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) - -# **apiMailingListUnsubscribeFromNewsletterPost** -> apiMailingListUnsubscribeFromNewsletterPost($body) - -Unsubscribe to a mailing list. - -Unsubscribes a contact to a mailing list. - -### Example -```php -apiMailingListUnsubscribeFromNewsletterPost($body); -} catch (Exception $e) { - echo 'Exception when calling MailingListApi->apiMailingListUnsubscribeFromNewsletterPost: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**\Yoast\MyYoastApiClient\Model\UnsubscribeFromNewsletterDto**](../Model/UnsubscribeFromNewsletterDto.md)| | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: 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) - -# **apiMailingListUnsubscribePost** -> apiMailingListUnsubscribePost($body) - -Unsubscribe to a mailing list. - -Unsubscribes a contact to a mailing list. - -### Example -```php -apiMailingListUnsubscribePost($body); -} catch (Exception $e) { - echo 'Exception when calling MailingListApi->apiMailingListUnsubscribePost: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**\Yoast\MyYoastApiClient\Model\UnsubscribeDto**](../Model/UnsubscribeDto.md)| | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: 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/OrderApi.md b/docs/Api/OrderApi.md deleted file mode 100644 index d8c192a..0000000 --- a/docs/Api/OrderApi.md +++ /dev/null @@ -1,507 +0,0 @@ -# Yoast\MyYoastApiClient\OrderApi - -All URIs are relative to *http://my.yoast.test:3000/* - -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 -[**apiOrdersInvoiceNumberInvoiceNumberGet**](OrderApi.md#apiordersinvoicenumberinvoicenumberget) | **GET** /api/Orders/InvoiceNumber/{invoiceNumber} | Get a order by invoiceNumber -[**apiOrdersPagedGet**](OrderApi.md#apiorderspagedget) | **GET** /api/Orders/paged | Get orders -[**apiOrdersProductGroupsInvoiceNumberGet**](OrderApi.md#apiordersproductgroupsinvoicenumberget) | **GET** /api/Orders/productGroups/{invoiceNumber} | Get productGroups by invoiceNumber - -# **apiOrdersAutoRenewalCountGet** -> \Yoast\MyYoastApiClient\Model\AutoRenewalCountResponseDto apiOrdersAutoRenewalCountGet($startDate, $endDate, $secret) - - - -### 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\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 -); -$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); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling OrderApi->apiOrdersAutoRenewalCountGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **startDate** | **\DateTime**| | - **endDate** | **\DateTime**| | - **secret** | **string**| | - -### Return type - -[**\Yoast\MyYoastApiClient\Model\AutoRenewalCountResponseDto**](../Model/AutoRenewalCountResponseDto.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) - -# **apiOrdersExportGet** -> \Yoast\MyYoastApiClient\Model\Order[] apiOrdersExportGet($startDate, $endDate) - -Get orders - -A large export of orders between dates - -### 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\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 -); -$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->apiOrdersExportGet($startDate, $endDate); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling OrderApi->apiOrdersExportGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **startDate** | **\DateTime**| | - **endDate** | **\DateTime**| | - -### Return type - -[**\Yoast\MyYoastApiClient\Model\Order[]**](../Model/Order.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) - -# **apiOrdersGet** -> \Yoast\MyYoastApiClient\Model\Order[] apiOrdersGet($filter) - -Get orders - -Get and filter orders - -### 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\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 { - $result = $apiInstance->apiOrdersGet($filter); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling OrderApi->apiOrdersGet: ', $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\Order[]**](../Model/Order.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) - -# **apiOrdersIdGet** -> \Yoast\MyYoastApiClient\Model\Order apiOrdersIdGet($id, $filter) - -Get a order - -Get a single order - -### 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\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 -); -$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | -$filter = new \stdClass; // object | Used for filtering/joining the results. - -try { - $result = $apiInstance->apiOrdersIdGet($id, $filter); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling OrderApi->apiOrdersIdGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**string**](../Model/.md)| | - **filter** | [**object**](../Model/.md)| Used for filtering/joining the results. | [optional] - -### Return type - -[**\Yoast\MyYoastApiClient\Model\Order**](../Model/Order.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) - -# **apiOrdersIdInvoiceGet** -> apiOrdersIdInvoiceGet($id) - -Create invoice - -Creates a PDF for an invoice - -### 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\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 -); -$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | - -try { - $apiInstance->apiOrdersIdInvoiceGet($id); -} catch (Exception $e) { - echo 'Exception when calling OrderApi->apiOrdersIdInvoiceGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**string**](../Model/.md)| | - -### 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) - -# **apiOrdersIdRefundsRefundIdInvoiceGet** -> apiOrdersIdRefundsRefundIdInvoiceGet($id, $refundId) - -Creates a credit note - -Creates a PDF for a credit note - -### 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\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 -); -$id = "id_example"; // string | -$refundId = "refundId_example"; // string | - -try { - $apiInstance->apiOrdersIdRefundsRefundIdInvoiceGet($id, $refundId); -} catch (Exception $e) { - echo 'Exception when calling OrderApi->apiOrdersIdRefundsRefundIdInvoiceGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| | - **refundId** | **string**| | - -### 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) - -# **apiOrdersInvoiceNumberInvoiceNumberGet** -> \Yoast\MyYoastApiClient\Model\Order apiOrdersInvoiceNumberInvoiceNumberGet($invoiceNumber) - -Get a order by invoiceNumber - -Get a single order by invoiceNumber - -### 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\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 -); -$invoiceNumber = "invoiceNumber_example"; // string | - -try { - $result = $apiInstance->apiOrdersInvoiceNumberInvoiceNumberGet($invoiceNumber); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling OrderApi->apiOrdersInvoiceNumberInvoiceNumberGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **invoiceNumber** | **string**| | - -### Return type - -[**\Yoast\MyYoastApiClient\Model\Order**](../Model/Order.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) - -# **apiOrdersPagedGet** -> apiOrdersPagedGet($filter) - -Get orders - -Get and filter orders - -### 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\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->apiOrdersPagedGet($filter); -} catch (Exception $e) { - echo 'Exception when calling OrderApi->apiOrdersPagedGet: ', $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) - -# **apiOrdersProductGroupsInvoiceNumberGet** -> \Yoast\MyYoastApiClient\Model\ProductGroup[] apiOrdersProductGroupsInvoiceNumberGet($invoiceNumber) - -Get productGroups by invoiceNumber - -Get productGroups by invoiceNumber - -### 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\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 -); -$invoiceNumber = "invoiceNumber_example"; // string | - -try { - $result = $apiInstance->apiOrdersProductGroupsInvoiceNumberGet($invoiceNumber); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling OrderApi->apiOrdersProductGroupsInvoiceNumberGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **invoiceNumber** | **string**| | - -### Return type - -[**\Yoast\MyYoastApiClient\Model\ProductGroup[]**](../Model/ProductGroup.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/PackagesApi.md b/docs/Api/PackagesApi.md deleted file mode 100644 index 9b6ecfa..0000000 --- a/docs/Api/PackagesApi.md +++ /dev/null @@ -1,211 +0,0 @@ -# Yoast\MyYoastApiClient\PackagesApi - -All URIs are relative to *http://my.yoast.test:3000/* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**packagesDistOrgNameArchiveZipGet**](PackagesApi.md#packagesdistorgnamearchivezipget) | **GET** /packages/dist/{org}/{name}/{archive}.zip | Serves an .zip of the plugin. -[**packagesP2OrgNameJsonGet**](PackagesApi.md#packagesp2orgnamejsonget) | **GET** /packages/p2/{org}/{name}.json | Serves the requested provider.json -[**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. - -# **packagesDistOrgNameArchiveZipGet** -> string packagesDistOrgNameArchiveZipGet($org, $archive, $name) - -Serves an .zip of the plugin. - -Serves an .zip of the plugin, described by the parameters passed in the request. - -### Example -```php -packagesDistOrgNameArchiveZipGet($org, $archive, $name); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling PackagesApi->packagesDistOrgNameArchiveZipGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **org** | **string**| | - **archive** | **string**| | - **name** | **string**| | - -### Return type - -**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) - -# **packagesP2OrgNameJsonGet** -> string packagesP2OrgNameJsonGet($org, $name) - -Serves the requested provider.json - -Serves the requested provider.json defined by the org, name and hash of the file. - -### Example -```php -packagesP2OrgNameJsonGet($org, $name); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling PackagesApi->packagesP2OrgNameJsonGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **org** | **string**| | - **name** | **string**| The package name, optionally suffixed with -dev | - -### Return type - -**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) - -# **packagesPOrgNameAndHashJsonGet** -> string packagesPOrgNameAndHashJsonGet($org, $nameAndHash) - -Serves the requested provider.json - -Serves the requested provider.json defined by the org, name and hash of the file. - -### Example -```php -packagesPOrgNameAndHashJsonGet($org, $nameAndHash); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling PackagesApi->packagesPOrgNameAndHashJsonGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **org** | **string**| | - **nameAndHash** | **string**| The package name and package hash separated by a $ character | - -### Return type - -**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) - -# **packagesPackagesJsonGet** -> string packagesPackagesJsonGet() - -Serves the general packages.json file. - -Serves the general packages.json file. - -### Example -```php -packagesPackagesJsonGet(); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling PackagesApi->packagesPackagesJsonGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -**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) - diff --git a/docs/Api/ProductApi.md b/docs/Api/ProductApi.md deleted file mode 100644 index 518b515..0000000 --- a/docs/Api/ProductApi.md +++ /dev/null @@ -1,203 +0,0 @@ -# Yoast\MyYoastApiClient\ProductApi - -All URIs are relative to *http://my.yoast.test:3000/* - -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 | - -# **apiProductsGet** -> \Yoast\MyYoastApiClient\Model\Product[] apiProductsGet($filter) - -Get products - -Get and filter products - -### Example -```php -apiProductsGet($filter); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling ProductApi->apiProductsGet: ', $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\Product[]**](../Model/Product.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) - -# **apiProductsIdGet** -> \Yoast\MyYoastApiClient\Model\Product apiProductsIdGet($id, $filter) - -Get a product - -Get a single product - -### Example -```php -apiProductsIdGet($id, $filter); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling ProductApi->apiProductsIdGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**string**](../Model/.md)| | - **filter** | [**object**](../Model/.md)| Used for filtering/joining the results. | [optional] - -### Return type - -[**\Yoast\MyYoastApiClient\Model\Product**](../Model/Product.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) - -# **apiProductsProductIdDelete** -> apiProductsProductIdDelete($id) - - - -### Example -```php -apiProductsProductIdDelete($id); -} catch (Exception $e) { - echo 'Exception when calling ProductApi->apiProductsProductIdDelete: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**string**](../Model/.md)| | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### 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) - -# **apiProductsWordpressPluginVersionDetailsGet** -> apiProductsWordpressPluginVersionDetailsGet($password) - - - -### Example -```php -apiProductsWordpressPluginVersionDetailsGet($password); -} catch (Exception $e) { - echo 'Exception when calling ProductApi->apiProductsWordpressPluginVersionDetailsGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **password** | **string**| | [optional] - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### 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) - diff --git a/docs/Api/ProductGroupApi.md b/docs/Api/ProductGroupApi.md deleted file mode 100644 index daee1ce..0000000 --- a/docs/Api/ProductGroupApi.md +++ /dev/null @@ -1,117 +0,0 @@ -# Yoast\MyYoastApiClient\ProductGroupApi - -All URIs are relative to *http://my.yoast.test:3000/* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**apiProductGroupsGet**](ProductGroupApi.md#apiproductgroupsget) | **GET** /api/ProductGroups | Get productgroups -[**apiProductGroupsUpdateDownloadPatch**](ProductGroupApi.md#apiproductgroupsupdatedownloadpatch) | **PATCH** /api/ProductGroups/updateDownload | Update the download - -# **apiProductGroupsGet** -> \Yoast\MyYoastApiClient\Model\ProductGroup[] apiProductGroupsGet($filter) - -Get productgroups - -Get and filter productgroups - -### 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\ProductGroupApi( - // 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->apiProductGroupsGet($filter); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling ProductGroupApi->apiProductGroupsGet: ', $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\ProductGroup[]**](../Model/ProductGroup.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) - -# **apiProductGroupsUpdateDownloadPatch** -> \Yoast\MyYoastApiClient\Model\ProductGroup apiProductGroupsUpdateDownloadPatch($body) - -Update the download - -Set the passed downloadUrl and version to the passed product group. - -### 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\ProductGroupApi( - // 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\UpdateDownloadDto(); // \Yoast\MyYoastApiClient\Model\UpdateDownloadDto | - -try { - $result = $apiInstance->apiProductGroupsUpdateDownloadPatch($body); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling ProductGroupApi->apiProductGroupsUpdateDownloadPatch: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**\Yoast\MyYoastApiClient\Model\UpdateDownloadDto**](../Model/UpdateDownloadDto.md)| | - -### Return type - -[**\Yoast\MyYoastApiClient\Model\ProductGroup**](../Model/ProductGroup.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/ProvisionerApi.md b/docs/Api/ProvisionerApi.md deleted file mode 100644 index 491ed3a..0000000 --- a/docs/Api/ProvisionerApi.md +++ /dev/null @@ -1,113 +0,0 @@ -# Yoast\MyYoastApiClient\ProvisionerApi - -All URIs are relative to *http://my.yoast.test:3000/* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**apiProvisionerDataGet**](ProvisionerApi.md#apiprovisionerdataget) | **GET** /api/ProvisionerData | Get provisioner data -[**apiProvisionerDataIdGet**](ProvisionerApi.md#apiprovisionerdataidget) | **GET** /api/ProvisionerData/{id} | Get provisioner data - -# **apiProvisionerDataGet** -> \Yoast\MyYoastApiClient\Model\ProvisionerData[] apiProvisionerDataGet() - -Get provisioner data - -Get and filter provisioner data - -### 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\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->apiProvisionerDataGet(); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling ProvisionerApi->apiProvisionerDataGet: ', $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) - -# **apiProvisionerDataIdGet** -> \Yoast\MyYoastApiClient\Model\Subscription apiProvisionerDataIdGet($id) - -Get provisioner data - -Get provisioner data - -### 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\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->apiProvisionerDataIdGet($id); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling ProvisionerApi->apiProvisionerDataIdGet: ', $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/ProvisioningAccountApi.md b/docs/Api/ProvisioningAccountApi.md deleted file mode 100644 index ee5e197..0000000 --- a/docs/Api/ProvisioningAccountApi.md +++ /dev/null @@ -1,53 +0,0 @@ -# Yoast\MyYoastApiClient\ProvisioningAccountApi - -All URIs are relative to *http://my.yoast.test:3000/* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**apiProvisioningAccountRegenerateTokenPost**](ProvisioningAccountApi.md#apiprovisioningaccountregeneratetokenpost) | **POST** /api/provisioning/account/regenerate-token | Generate a new auth token - -# **apiProvisioningAccountRegenerateTokenPost** -> \Yoast\MyYoastApiClient\Model\RegenerateTokenResponseDto apiProvisioningAccountRegenerateTokenPost() - -Generate a new auth token - -This route generate a new Basic Auth token that is used for provisioner accounts to authenticate with.After this route is called, the old token will NO LONGER be valid. Please store the response of this request somewhere safe! - -### Example -```php -apiProvisioningAccountRegenerateTokenPost(); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling ProvisioningAccountApi->apiProvisioningAccountRegenerateTokenPost: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**\Yoast\MyYoastApiClient\Model\RegenerateTokenResponseDto**](../Model/RegenerateTokenResponseDto.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) - diff --git a/docs/Api/ProvisioningDownloadsApi.md b/docs/Api/ProvisioningDownloadsApi.md deleted file mode 100644 index f29abed..0000000 --- a/docs/Api/ProvisioningDownloadsApi.md +++ /dev/null @@ -1,106 +0,0 @@ -# Yoast\MyYoastApiClient\ProvisioningDownloadsApi - -All URIs are relative to *http://my.yoast.test:3000/* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**apiProvisioningDownloadsCurrentVersionGet**](ProvisioningDownloadsApi.md#apiprovisioningdownloadscurrentversionget) | **GET** /api/provisioning/downloads/currentVersion | Retrieve the current version for the productCode for the provisioner. -[**apiProvisioningDownloadsCurrentZipGet**](ProvisioningDownloadsApi.md#apiprovisioningdownloadscurrentzipget) | **GET** /api/provisioning/downloads/currentZip | Redirect to the current zip for the productCode. - -# **apiProvisioningDownloadsCurrentVersionGet** -> string apiProvisioningDownloadsCurrentVersionGet($productCode) - -Retrieve the current version for the productCode for the provisioner. - -This route returns the latest version of the product that is offered to the customer when using the passed productCode. - -### Example -```php -apiProvisioningDownloadsCurrentVersionGet($productCode); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling ProvisioningDownloadsApi->apiProvisioningDownloadsCurrentVersionGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **productCode** | **string**| The code used to create the product. | - -### Return type - -**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) - -# **apiProvisioningDownloadsCurrentZipGet** -> apiProvisioningDownloadsCurrentZipGet($productCode) - -Redirect to the current zip for the productCode. - -If a new version is available, you can use this route to redirect to the zip of that new version of the product. - -### Example -```php -apiProvisioningDownloadsCurrentZipGet($productCode); -} catch (Exception $e) { - echo 'Exception when calling ProvisioningDownloadsApi->apiProvisioningDownloadsCurrentZipGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **productCode** | **string**| The code used to create the product. | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### 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) - diff --git a/docs/Api/ProvisioningUsersApi.md b/docs/Api/ProvisioningUsersApi.md deleted file mode 100644 index b8990f3..0000000 --- a/docs/Api/ProvisioningUsersApi.md +++ /dev/null @@ -1,57 +0,0 @@ -# Yoast\MyYoastApiClient\ProvisioningUsersApi - -All URIs are relative to *http://my.yoast.test:3000/* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**apiProvisioningUserScheduleDeletePost**](ProvisioningUsersApi.md#apiprovisioninguserscheduledeletepost) | **POST** /api/provisioning/user/schedule-delete | Schedule a delete for a subscription - -# **apiProvisioningUserScheduleDeletePost** -> \Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto apiProvisioningUserScheduleDeletePost($body) - -Schedule a delete for a subscription - -Schedules a customer for gdpr delete. - -### Example -```php -apiProvisioningUserScheduleDeletePost($body); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling ProvisioningUsersApi->apiProvisioningUserScheduleDeletePost: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**\Yoast\MyYoastApiClient\Model\ScheduleDeleteUserDto**](../Model/ScheduleDeleteUserDto.md)| | - -### Return type - -[**\Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto**](../Model/SubscriptionProvisioningResponseDto.md) - -### Authorization - -No authorization required - -### 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/RefundApi.md b/docs/Api/RefundApi.md deleted file mode 100644 index ea9f440..0000000 --- a/docs/Api/RefundApi.md +++ /dev/null @@ -1,176 +0,0 @@ -# Yoast\MyYoastApiClient\RefundApi - -All URIs are relative to *http://my.yoast.test:3000/* - -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 - -# **apiRefundsExportGet** -> \Yoast\MyYoastApiClient\Model\Refund[] apiRefundsExportGet($startDate, $endDate) - -Get refunds - -A large export of refunds between dates - -### 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\RefundApi( - // 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 -); -$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); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling RefundApi->apiRefundsExportGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **startDate** | **\DateTime**| | - **endDate** | **\DateTime**| | - -### Return type - -[**\Yoast\MyYoastApiClient\Model\Refund[]**](../Model/Refund.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) - -# **apiRefundsGet** -> \Yoast\MyYoastApiClient\Model\Refund[] apiRefundsGet($filter) - -Get refunds - -Get and filter refunds - -### 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\RefundApi( - // 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->apiRefundsGet($filter); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling RefundApi->apiRefundsGet: ', $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\Refund[]**](../Model/Refund.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) - -# **apiRefundsIdGet** -> \Yoast\MyYoastApiClient\Model\Refund apiRefundsIdGet($id, $filter) - -Get a refund - -Get a single refund - -### 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\RefundApi( - // 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 | -$filter = new \stdClass; // object | Used for filtering/joining the results. - -try { - $result = $apiInstance->apiRefundsIdGet($id, $filter); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling RefundApi->apiRefundsIdGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**string**](../Model/.md)| | - **filter** | [**object**](../Model/.md)| Used for filtering/joining the results. | [optional] - -### Return type - -[**\Yoast\MyYoastApiClient\Model\Refund**](../Model/Refund.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/RobotsApi.md b/docs/Api/RobotsApi.md deleted file mode 100644 index 2efb293..0000000 --- a/docs/Api/RobotsApi.md +++ /dev/null @@ -1,51 +0,0 @@ -# Yoast\MyYoastApiClient\RobotsApi - -All URIs are relative to *http://my.yoast.test:3000/* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**robotsTxtGet**](RobotsApi.md#robotstxtget) | **GET** /robots.txt | - -# **robotsTxtGet** -> string robotsTxtGet() - - - -### Example -```php -robotsTxtGet(); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling RobotsApi->robotsTxtGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -**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) - diff --git a/docs/Api/ServerCheckApi.md b/docs/Api/ServerCheckApi.md deleted file mode 100644 index 05e8bf8..0000000 --- a/docs/Api/ServerCheckApi.md +++ /dev/null @@ -1,53 +0,0 @@ -# Yoast\MyYoastApiClient\ServerCheckApi - -All URIs are relative to *http://my.yoast.test:3000/* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**serverCheckGet**](ServerCheckApi.md#servercheckget) | **GET** /server-check | Server health check - -# **serverCheckGet** -> string serverCheckGet() - -Server health check - -Checks if a simple user query can be performed. If so, we're up and running. If not, something's up - -### Example -```php -serverCheckGet(); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling ServerCheckApi->serverCheckGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -**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) - diff --git a/docs/Api/SiteApi.md b/docs/Api/SiteApi.md deleted file mode 100644 index 3a34cb4..0000000 --- a/docs/Api/SiteApi.md +++ /dev/null @@ -1,776 +0,0 @@ -# Yoast\MyYoastApiClient\SiteApi - -All URIs are relative to *http://my.yoast.test:3000/* - -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 -[**apiSitesGetSiteStatusGet**](SiteApi.md#apisitesgetsitestatusget) | **GET** /api/Sites/getSiteStatus | Get a url's HTTP status -[**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. -[**apiSitesPagedGet**](SiteApi.md#apisitespagedget) | **GET** /api/Sites/paged | Get sites -[**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) - -Get the current connected site for an access token. - -### 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\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 -); -$token = "token_example"; // string | -$url = "url_example"; // string | - -try { - $result = $apiInstance->apiSitesCurrentGet($token, $url); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SiteApi->apiSitesCurrentGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **token** | **string**| | [optional] - **url** | **string**| | [optional] - -### Return type - -**object** - -### 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) - -# **apiSitesGet** -> \Yoast\MyYoastApiClient\Model\Site[] apiSitesGet($filter) - -Get sites - -Get and filter sites - -### 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\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 -); -$filter = new \stdClass; // object | Used for filtering/joining the results. - -try { - $result = $apiInstance->apiSitesGet($filter); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SiteApi->apiSitesGet: ', $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\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) - -# **apiSitesGetSiteStatusGet** -> int apiSitesGetSiteStatusGet($url) - -Get a url's HTTP status - -Gets a http status code by a given URL - -### 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\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 -); -$url = "url_example"; // string | - -try { - $result = $apiInstance->apiSitesGetSiteStatusGet($url); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SiteApi->apiSitesGetSiteStatusGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **url** | **string**| | - -### Return type - -**int** - -### 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) - -# **apiSitesIdDelete** -> apiSitesIdDelete($id) - - - -### 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\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 | - -try { - $apiInstance->apiSitesIdDelete($id); -} catch (Exception $e) { - echo 'Exception when calling SiteApi->apiSitesIdDelete: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**string**](../Model/.md)| | - -### 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) - -# **apiSitesIdGet** -> \Yoast\MyYoastApiClient\Model\Site apiSitesIdGet($id, $filter) - -Get a site - -Get a single site - -### 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\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 | -$filter = new \stdClass; // object | Used for filtering/joining the results. - -try { - $result = $apiInstance->apiSitesIdGet($id, $filter); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SiteApi->apiSitesIdGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**string**](../Model/.md)| | - **filter** | [**object**](../Model/.md)| Used for filtering/joining the results. | [optional] - -### 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) - -# **apiSitesIdPatch** -> apiSitesIdPatch($body, $id) - - - -### 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\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 -); -$body = new \Yoast\MyYoastApiClient\Model\UpdateSiteDto(); // \Yoast\MyYoastApiClient\Model\UpdateSiteDto | -$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | - -try { - $apiInstance->apiSitesIdPatch($body, $id); -} catch (Exception $e) { - echo 'Exception when calling SiteApi->apiSitesIdPatch: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**\Yoast\MyYoastApiClient\Model\UpdateSiteDto**](../Model/UpdateSiteDto.md)| | - **id** | [**string**](../Model/.md)| | - -### Return type - -void (empty response body) - -### Authorization - -[bearer](../../README.md#bearer) - -### HTTP request headers - - - **Content-Type**: 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) - -# **apiSitesIdSubscriptionsPut** -> \Yoast\MyYoastApiClient\Model\Site apiSitesIdSubscriptionsPut($body, $id) - -Adds a subscription to a site - -### 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\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 -); -$body = new \Yoast\MyYoastApiClient\Model\AddSubscriptionDto(); // \Yoast\MyYoastApiClient\Model\AddSubscriptionDto | -$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | - -try { - $result = $apiInstance->apiSitesIdSubscriptionsPut($body, $id); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SiteApi->apiSitesIdSubscriptionsPut: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**\Yoast\MyYoastApiClient\Model\AddSubscriptionDto**](../Model/AddSubscriptionDto.md)| | - **id** | [**string**](../Model/.md)| | - -### Return type - -[**\Yoast\MyYoastApiClient\Model\Site**](../Model/Site.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) - -# **apiSitesIdSubscriptionsSubscriptionIdDelete** -> \Yoast\MyYoastApiClient\Model\Site apiSitesIdSubscriptionsSubscriptionIdDelete($id, $subscriptionId) - -Removes a subscription from a site - -### 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\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->apiSitesIdSubscriptionsSubscriptionIdDelete($id, $subscriptionId); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SiteApi->apiSitesIdSubscriptionsSubscriptionIdDelete: ', $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) - -# **apiSitesIndexPost** -> object apiSitesIndexPost($token, $url, $method) - - - -### 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\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 -); -$token = "token_example"; // string | -$url = "url_example"; // string | -$method = "method_example"; // string | - -try { - $result = $apiInstance->apiSitesIndexPost($token, $url, $method); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SiteApi->apiSitesIndexPost: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **token** | **string**| | - **url** | **string**| | - **method** | **string**| | - -### Return type - -**object** - -### 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) - -# **apiSitesInfoGet** -> object apiSitesInfoGet($token, $url) - -Get the current connected site for an access token. - -### 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\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 -); -$token = "token_example"; // string | -$url = "url_example"; // string | - -try { - $result = $apiInstance->apiSitesInfoGet($token, $url); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SiteApi->apiSitesInfoGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **token** | **string**| | [optional] - **url** | **string**| | [optional] - -### Return type - -**object** - -### 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) - -# **apiSitesPagedGet** -> apiSitesPagedGet($filter) - -Get sites - -Get and filter sites - -### 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\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 -); -$filter = new \stdClass; // object | Used for filtering/joining the results. - -try { - $apiInstance->apiSitesPagedGet($filter); -} catch (Exception $e) { - echo 'Exception when calling SiteApi->apiSitesPagedGet: ', $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) - -# **apiSitesSwitchSubscriptionNumberOfTimesPost** -> object apiSitesSwitchSubscriptionNumberOfTimesPost($body) - -Switches the subscription for a number of times. - -Switches the subscription for a number of times. - -### 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\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 -); -$body = new \Yoast\MyYoastApiClient\Model\SwitchSubscriptionNumberOfTimesDto(); // \Yoast\MyYoastApiClient\Model\SwitchSubscriptionNumberOfTimesDto | - -try { - $result = $apiInstance->apiSitesSwitchSubscriptionNumberOfTimesPost($body); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SiteApi->apiSitesSwitchSubscriptionNumberOfTimesPost: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**\Yoast\MyYoastApiClient\Model\SwitchSubscriptionNumberOfTimesDto**](../Model/SwitchSubscriptionNumberOfTimesDto.md)| | - -### Return type - -**object** - -### 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) - -# **apiSitesSwitchSubscriptionPost** -> int apiSitesSwitchSubscriptionPost($body) - -Switches the subscription for a number of times. - -Switches the subscription for a number of times. - -### 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\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 -); -$body = new \Yoast\MyYoastApiClient\Model\TransferSiteDto(); // \Yoast\MyYoastApiClient\Model\TransferSiteDto | - -try { - $result = $apiInstance->apiSitesSwitchSubscriptionPost($body); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SiteApi->apiSitesSwitchSubscriptionPost: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**\Yoast\MyYoastApiClient\Model\TransferSiteDto**](../Model/TransferSiteDto.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) - -# **apiSitesTransferPost** -> \Yoast\MyYoastApiClient\Model\Site[] apiSitesTransferPost($body) - -Transfer sites. - -Transfers the sites from one customer to another customer. - -### 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\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 -); -$body = new \Yoast\MyYoastApiClient\Model\TransferSiteDto(); // \Yoast\MyYoastApiClient\Model\TransferSiteDto | - -try { - $result = $apiInstance->apiSitesTransferPost($body); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SiteApi->apiSitesTransferPost: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**\Yoast\MyYoastApiClient\Model\TransferSiteDto**](../Model/TransferSiteDto.md)| | - -### Return type - -[**\Yoast\MyYoastApiClient\Model\Site[]**](../Model/Site.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/SubscriptionApi.md b/docs/Api/SubscriptionApi.md deleted file mode 100644 index f7b4aee..0000000 --- a/docs/Api/SubscriptionApi.md +++ /dev/null @@ -1,616 +0,0 @@ -# Yoast\MyYoastApiClient\SubscriptionApi - -All URIs are relative to *http://my.yoast.test:3000/* - -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 -[**apiSubscriptionsIdForceCancelPost**](SubscriptionApi.md#apisubscriptionsidforcecancelpost) | **POST** /api/Subscriptions/{id}/force-cancel | Forcefully cancel a subscription -[**apiSubscriptionsIdGet**](SubscriptionApi.md#apisubscriptionsidget) | **GET** /api/Subscriptions/{id} | Get a subscription -[**apiSubscriptionsIdRecalculateSubscriptionCountPost**](SubscriptionApi.md#apisubscriptionsidrecalculatesubscriptioncountpost) | **POST** /api/Subscriptions/{id}/recalculateSubscriptionCount | Recalculate SubscriptionCount. -[**apiSubscriptionsLinkSitePost**](SubscriptionApi.md#apisubscriptionslinksitepost) | **POST** /api/Subscriptions/link-site | Link a subscription to provided site URL -[**apiSubscriptionsPagedGet**](SubscriptionApi.md#apisubscriptionspagedget) | **GET** /api/Subscriptions/paged | Get subscriptions -[**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 - -# **apiSubscriptionsExpiringGet** -> \Yoast\MyYoastApiClient\Model\Subscription[] apiSubscriptionsExpiringGet($from, $until, $requiresManualRenewal) - - - -### 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\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 -); -$from = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | -$until = new \DateTime("2013-10-20T19:20:30+01:00"); // \DateTime | -$requiresManualRenewal = true; // bool | - -try { - $result = $apiInstance->apiSubscriptionsExpiringGet($from, $until, $requiresManualRenewal); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SubscriptionApi->apiSubscriptionsExpiringGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **from** | **\DateTime**| | - **until** | **\DateTime**| | - **requiresManualRenewal** | **bool**| | [optional] - -### 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) - -# **apiSubscriptionsGet** -> \Yoast\MyYoastApiClient\Model\Subscription[] apiSubscriptionsGet($filter) - -Get subscriptions - -Get and filter subscriptions - -### 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\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 -); -$filter = new \stdClass; // object | Used for filtering/joining the results. - -try { - $result = $apiInstance->apiSubscriptionsGet($filter); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SubscriptionApi->apiSubscriptionsGet: ', $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\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) - -# **apiSubscriptionsIdDelete** -> string apiSubscriptionsIdDelete($id) - -Delete a subscription - -Deletes a single subscription - -### 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\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->apiSubscriptionsIdDelete($id); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SubscriptionApi->apiSubscriptionsIdDelete: ', $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) - -# **apiSubscriptionsIdForceCancelPost** -> apiSubscriptionsIdForceCancelPost($id) - -Forcefully cancel a subscription - -This immediately cancels a subscription without notifying the customer. The customer will lose access instantly - -### 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\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 { - $apiInstance->apiSubscriptionsIdForceCancelPost($id); -} catch (Exception $e) { - echo 'Exception when calling SubscriptionApi->apiSubscriptionsIdForceCancelPost: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**string**](../Model/.md)| | - -### 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) - -# **apiSubscriptionsIdGet** -> \Yoast\MyYoastApiClient\Model\Subscription apiSubscriptionsIdGet($id, $filter) - -Get a subscription - -Get a single subscription - -### 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\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 | -$filter = new \stdClass; // object | Used for filtering/joining the results. - -try { - $result = $apiInstance->apiSubscriptionsIdGet($id, $filter); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SubscriptionApi->apiSubscriptionsIdGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**string**](../Model/.md)| | - **filter** | [**object**](../Model/.md)| Used for filtering/joining the results. | [optional] - -### 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) - -# **apiSubscriptionsIdRecalculateSubscriptionCountPost** -> \Yoast\MyYoastApiClient\Model\Subscription apiSubscriptionsIdRecalculateSubscriptionCountPost($id) - -Recalculate SubscriptionCount. - -Route to recalculate the Subscription Count for a given subscription. - -### 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\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 = "id_example"; // string | - -try { - $result = $apiInstance->apiSubscriptionsIdRecalculateSubscriptionCountPost($id); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SubscriptionApi->apiSubscriptionsIdRecalculateSubscriptionCountPost: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| | - -### 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) - -# **apiSubscriptionsLinkSitePost** -> \Yoast\MyYoastApiClient\Model\Site apiSubscriptionsLinkSitePost($body) - -Link a subscription to provided site URL - -Links the provided site URL to a subscription after successfully checking out. - -### 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\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 -); -$body = new \Yoast\MyYoastApiClient\Model\LinkSiteDto(); // \Yoast\MyYoastApiClient\Model\LinkSiteDto | - -try { - $result = $apiInstance->apiSubscriptionsLinkSitePost($body); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SubscriptionApi->apiSubscriptionsLinkSitePost: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**\Yoast\MyYoastApiClient\Model\LinkSiteDto**](../Model/LinkSiteDto.md)| | - -### Return type - -[**\Yoast\MyYoastApiClient\Model\Site**](../Model/Site.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) - -# **apiSubscriptionsPagedGet** -> apiSubscriptionsPagedGet($filter) - -Get subscriptions - -Get and filter subscriptions - -### 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\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 -); -$filter = new \stdClass; // object | Used for filtering/joining the results. - -try { - $apiInstance->apiSubscriptionsPagedGet($filter); -} catch (Exception $e) { - echo 'Exception when calling SubscriptionApi->apiSubscriptionsPagedGet: ', $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) - -# **apiSubscriptionsRenewSubscriptionNumberSecretKeyGet** -> \Yoast\MyYoastApiClient\Model\Subscription apiSubscriptionsRenewSubscriptionNumberSecretKeyGet($subscriptionNumber, $secretKey) - -Renew subscriptions - -Route for renewing subscriptions - -### 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\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 -); -$subscriptionNumber = "subscriptionNumber_example"; // string | -$secretKey = "secretKey_example"; // string | - -try { - $result = $apiInstance->apiSubscriptionsRenewSubscriptionNumberSecretKeyGet($subscriptionNumber, $secretKey); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SubscriptionApi->apiSubscriptionsRenewSubscriptionNumberSecretKeyGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **subscriptionNumber** | **string**| | - **secretKey** | **string**| | - -### 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) - -# **apiSubscriptionsSetExpiryDatePost** -> \Yoast\MyYoastApiClient\Model\Subscription apiSubscriptionsSetExpiryDatePost($body) - -Set Date. - -Sets either the end date or next payment date, based on which one the subscription already has. - -### 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\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 -); -$body = new \Yoast\MyYoastApiClient\Model\SetExpiryDateDto(); // \Yoast\MyYoastApiClient\Model\SetExpiryDateDto | - -try { - $result = $apiInstance->apiSubscriptionsSetExpiryDatePost($body); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SubscriptionApi->apiSubscriptionsSetExpiryDatePost: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**\Yoast\MyYoastApiClient\Model\SetExpiryDateDto**](../Model/SetExpiryDateDto.md)| | - -### Return type - -[**\Yoast\MyYoastApiClient\Model\Subscription**](../Model/Subscription.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) - -# **apiSubscriptionsTransferPost** -> \Yoast\MyYoastApiClient\Model\Subscription[] apiSubscriptionsTransferPost($body) - -Transfer subscription ownership - -Change the subscription owner from one customer to another - -### 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\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 -); -$body = new \Yoast\MyYoastApiClient\Model\TransferOwnershipDto(); // \Yoast\MyYoastApiClient\Model\TransferOwnershipDto | - -try { - $result = $apiInstance->apiSubscriptionsTransferPost($body); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SubscriptionApi->apiSubscriptionsTransferPost: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**\Yoast\MyYoastApiClient\Model\TransferOwnershipDto**](../Model/TransferOwnershipDto.md)| | - -### Return type - -[**\Yoast\MyYoastApiClient\Model\Subscription[]**](../Model/Subscription.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/SubscriptionProvisioningApi.md b/docs/Api/SubscriptionProvisioningApi.md deleted file mode 100644 index 819256f..0000000 --- a/docs/Api/SubscriptionProvisioningApi.md +++ /dev/null @@ -1,261 +0,0 @@ -# Yoast\MyYoastApiClient\SubscriptionProvisioningApi - -All URIs are relative to *http://my.yoast.test:3000/* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**apiProvisioningSubscriptionsCreatePost**](SubscriptionProvisioningApi.md#apiprovisioningsubscriptionscreatepost) | **POST** /api/provisioning/subscriptions/create | Create a subscription -[**apiProvisioningSubscriptionsIdCancelPost**](SubscriptionProvisioningApi.md#apiprovisioningsubscriptionsidcancelpost) | **POST** /api/provisioning/subscriptions/{id}/cancel | Cancel a single subscription -[**apiProvisioningSubscriptionsIdGet**](SubscriptionProvisioningApi.md#apiprovisioningsubscriptionsidget) | **GET** /api/provisioning/subscriptions/{id} | Get a subscription -[**apiProvisioningSubscriptionsIdRenewPost**](SubscriptionProvisioningApi.md#apiprovisioningsubscriptionsidrenewpost) | **POST** /api/provisioning/subscriptions/{id}/renew | Renew a subscription -[**apiProvisioningSubscriptionsIdSetSitePost**](SubscriptionProvisioningApi.md#apiprovisioningsubscriptionsidsetsitepost) | **POST** /api/provisioning/subscriptions/{id}/set-site | Link a subscription to a site - -# **apiProvisioningSubscriptionsCreatePost** -> \Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto apiProvisioningSubscriptionsCreatePost($body) - -Create a subscription - -Creates a subscription for a customer. - -### Example -```php -apiProvisioningSubscriptionsCreatePost($body); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SubscriptionProvisioningApi->apiProvisioningSubscriptionsCreatePost: ', $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 - -No authorization required - -### 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) - -# **apiProvisioningSubscriptionsIdCancelPost** -> \Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto apiProvisioningSubscriptionsIdCancelPost($body, $id) - -Cancel a single subscription - -Cancel the subscription when the period ends or immediately. - -### Example -```php -apiProvisioningSubscriptionsIdCancelPost($body, $id); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SubscriptionProvisioningApi->apiProvisioningSubscriptionsIdCancelPost: ', $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 - -No authorization required - -### 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) - -# **apiProvisioningSubscriptionsIdGet** -> \Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto apiProvisioningSubscriptionsIdGet($id) - -Get a subscription - -Get a single subscription that was provisioned for a third party - -### Example -```php -apiProvisioningSubscriptionsIdGet($id); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SubscriptionProvisioningApi->apiProvisioningSubscriptionsIdGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**string**](../Model/.md)| | - -### Return type - -[**\Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto**](../Model/SubscriptionProvisioningResponseDto.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) - -# **apiProvisioningSubscriptionsIdRenewPost** -> \Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto apiProvisioningSubscriptionsIdRenewPost($id) - -Renew a subscription - -Renew the subscription for a new period. - -### Example -```php -apiProvisioningSubscriptionsIdRenewPost($id); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SubscriptionProvisioningApi->apiProvisioningSubscriptionsIdRenewPost: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | [**string**](../Model/.md)| | - -### Return type - -[**\Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto**](../Model/SubscriptionProvisioningResponseDto.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) - -# **apiProvisioningSubscriptionsIdSetSitePost** -> \Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto apiProvisioningSubscriptionsIdSetSitePost($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 -apiProvisioningSubscriptionsIdSetSitePost($body, $id); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling SubscriptionProvisioningApi->apiProvisioningSubscriptionsIdSetSitePost: ', $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 - -No authorization required - -### 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 deleted file mode 100644 index 1a39403..0000000 --- a/docs/Api/WorkerApi.md +++ /dev/null @@ -1,315 +0,0 @@ -# Yoast\MyYoastApiClient\WorkerApi - -All URIs are relative to *http://my.yoast.test:3000/* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**apiWorkerGetRecurringJobsGet**](WorkerApi.md#apiworkergetrecurringjobsget) | **GET** /api/Worker/getRecurringJobs | -[**apiWorkerGetRecurringJobsNameGet**](WorkerApi.md#apiworkergetrecurringjobsnameget) | **GET** /api/Worker/getRecurringJobs/{name} | -[**apiWorkerGetScheduledJobsNameGet**](WorkerApi.md#apiworkergetscheduledjobsnameget) | **GET** /api/Worker/getScheduledJobs/{name} | -[**apiWorkerJobIdDelete**](WorkerApi.md#apiworkerjobiddelete) | **DELETE** /api/Worker/job/{id} | -[**apiWorkerJobIdGet**](WorkerApi.md#apiworkerjobidget) | **GET** /api/Worker/job/{id} | -[**apiWorkerJobPost**](WorkerApi.md#apiworkerjobpost) | **POST** /api/Worker/job | - -# **apiWorkerGetRecurringJobsGet** -> apiWorkerGetRecurringJobsGet() - - - -### 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\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 -); - -try { - $apiInstance->apiWorkerGetRecurringJobsGet(); -} catch (Exception $e) { - echo 'Exception when calling WorkerApi->apiWorkerGetRecurringJobsGet: ', $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) - -# **apiWorkerGetRecurringJobsNameGet** -> apiWorkerGetRecurringJobsNameGet($name) - - - -### 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\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->apiWorkerGetRecurringJobsNameGet($name); -} catch (Exception $e) { - echo 'Exception when calling WorkerApi->apiWorkerGetRecurringJobsNameGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **name** | **string**| | - -### 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) - -# **apiWorkerGetScheduledJobsNameGet** -> apiWorkerGetScheduledJobsNameGet($name) - - - -### 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\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->apiWorkerGetScheduledJobsNameGet($name); -} catch (Exception $e) { - echo 'Exception when calling WorkerApi->apiWorkerGetScheduledJobsNameGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **name** | **string**| | - -### 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) - -# **apiWorkerJobIdDelete** -> apiWorkerJobIdDelete($id) - - - -### 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\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 -); -$id = "id_example"; // string | - -try { - $apiInstance->apiWorkerJobIdDelete($id); -} catch (Exception $e) { - echo 'Exception when calling WorkerApi->apiWorkerJobIdDelete: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| | - -### 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) - -# **apiWorkerJobIdGet** -> apiWorkerJobIdGet($id) - - - -### 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\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 -); -$id = "id_example"; // string | - -try { - $apiInstance->apiWorkerJobIdGet($id); -} catch (Exception $e) { - echo 'Exception when calling WorkerApi->apiWorkerJobIdGet: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| | - -### 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) - -# **apiWorkerJobPost** -> apiWorkerJobPost($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\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 -); -$body = new \Yoast\MyYoastApiClient\Model\AddJobDto(); // \Yoast\MyYoastApiClient\Model\AddJobDto | - -try { - $apiInstance->apiWorkerJobPost($body); -} catch (Exception $e) { - echo 'Exception when calling WorkerApi->apiWorkerJobPost: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**\Yoast\MyYoastApiClient\Model\AddJobDto**](../Model/AddJobDto.md)| | - -### Return type - -void (empty response body) - -### Authorization - -[bearer](../../README.md#bearer) - -### HTTP request headers - - - **Content-Type**: 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/Model/AcademyCourseAccessListDto.md b/docs/Model/AcademyCourseAccessListDto.md deleted file mode 100644 index e3f122d..0000000 --- a/docs/Model/AcademyCourseAccessListDto.md +++ /dev/null @@ -1,9 +0,0 @@ -# AcademyCourseAccessListDto - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**courseIds** | **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/AccessToken.md b/docs/Model/AccessToken.md deleted file mode 100644 index 257158b..0000000 --- a/docs/Model/AccessToken.md +++ /dev/null @@ -1,14 +0,0 @@ -# AccessToken - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **string** | | -**ttl** | **int** | | -**created** | [**\DateTime**](\DateTime.md) | | -**createdAt** | [**\DateTime**](\DateTime.md) | | -**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) - diff --git a/docs/Model/ActivateAccountDto.md b/docs/Model/ActivateAccountDto.md deleted file mode 100644 index 778781d..0000000 --- a/docs/Model/ActivateAccountDto.md +++ /dev/null @@ -1,9 +0,0 @@ -# ActivateAccountDto - -## Properties -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) - diff --git a/docs/Model/AddJobDto.md b/docs/Model/AddJobDto.md deleted file mode 100644 index becbcc4..0000000 --- a/docs/Model/AddJobDto.md +++ /dev/null @@ -1,11 +0,0 @@ -# AddJobDto - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **string** | | -**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) - diff --git a/docs/Model/AddSubscriptionDto.md b/docs/Model/AddSubscriptionDto.md deleted file mode 100644 index 7533bac..0000000 --- a/docs/Model/AddSubscriptionDto.md +++ /dev/null @@ -1,9 +0,0 @@ -# AddSubscriptionDto - -## Properties -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) - diff --git a/docs/Model/Admission.md b/docs/Model/Admission.md deleted file mode 100644 index 95d9d77..0000000 --- a/docs/Model/Admission.md +++ /dev/null @@ -1,14 +0,0 @@ -# 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 deleted file mode 100644 index 88cf008..0000000 --- a/docs/Model/AutoRenewalCountResponseDto.md +++ /dev/null @@ -1,9 +0,0 @@ -# AutoRenewalCountResponseDto - -## Properties -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) - diff --git a/docs/Model/BillingDto.md b/docs/Model/BillingDto.md deleted file mode 100644 index 050ccb7..0000000 --- a/docs/Model/BillingDto.md +++ /dev/null @@ -1,19 +0,0 @@ -# BillingDto - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**firstName** | **string** | | -**lastName** | **string** | | -**company** | **string** | | -**address1** | **string** | | -**address2** | **string** | | -**city** | **string** | | -**state** | **string** | | -**postcode** | **string** | | -**country** | **string** | | -**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) - diff --git a/docs/Model/Blacklist.md b/docs/Model/Blacklist.md deleted file mode 100644 index df668fb..0000000 --- a/docs/Model/Blacklist.md +++ /dev/null @@ -1,11 +0,0 @@ -# Blacklist - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **string** | | -**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) - diff --git a/docs/Model/BulkInviteDto.md b/docs/Model/BulkInviteDto.md deleted file mode 100644 index 929d757..0000000 --- a/docs/Model/BulkInviteDto.md +++ /dev/null @@ -1,11 +0,0 @@ -# BulkInviteDto - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**lineItemId** | **string** | | -**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) - diff --git a/docs/Model/BulkSendEmailDto.md b/docs/Model/BulkSendEmailDto.md deleted file mode 100644 index e854e00..0000000 --- a/docs/Model/BulkSendEmailDto.md +++ /dev/null @@ -1,10 +0,0 @@ -# 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 deleted file mode 100644 index fe852c5..0000000 --- a/docs/Model/CancelProvisionedSubscriptionDto.md +++ /dev/null @@ -1,9 +0,0 @@ -# CancelProvisionedSubscriptionDto - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**immediately** | **bool** | Immediately will cancel the subscription directly,otherwise it will end when the period has expired. | [optional] [default to false] - -[[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 deleted file mode 100644 index 02aa480..0000000 --- a/docs/Model/CancelSubscriptionBodyDto.md +++ /dev/null @@ -1,9 +0,0 @@ -# CancelSubscriptionBodyDto - -## Properties -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) - diff --git a/docs/Model/ChangePasswordDto.md b/docs/Model/ChangePasswordDto.md deleted file mode 100644 index e67ba64..0000000 --- a/docs/Model/ChangePasswordDto.md +++ /dev/null @@ -1,11 +0,0 @@ -# ChangePasswordDto - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**password** | **string** | | -**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) - diff --git a/docs/Model/Changelog.md b/docs/Model/Changelog.md deleted file mode 100644 index 7c46d47..0000000 --- a/docs/Model/Changelog.md +++ /dev/null @@ -1,13 +0,0 @@ -# Changelog - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **string** | | -**sourceId** | **int** | | -**content** | **string** | | -**createdAt** | [**\DateTime**](\DateTime.md) | | -**modifiedAt** | [**\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/ComposerToken.md b/docs/Model/ComposerToken.md deleted file mode 100644 index 2a46236..0000000 --- a/docs/Model/ComposerToken.md +++ /dev/null @@ -1,14 +0,0 @@ -# ComposerToken - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **string** | | -**name** | **string** | | -**enabled** | **bool** | | -**createdAt** | [**\DateTime**](\DateTime.md) | | -**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) - diff --git a/docs/Model/CouponLineDto.md b/docs/Model/CouponLineDto.md deleted file mode 100644 index 5d1da30..0000000 --- a/docs/Model/CouponLineDto.md +++ /dev/null @@ -1,13 +0,0 @@ -# CouponLineDto - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | -**code** | **string** | | -**discount** | **string** | | -**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) - diff --git a/docs/Model/Course.md b/docs/Model/Course.md deleted file mode 100644 index 98f60f5..0000000 --- a/docs/Model/Course.md +++ /dev/null @@ -1,23 +0,0 @@ -# Course - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **string** | | -**name** | **string** | | -**description** | **string** | | -**courseUrl** | **string** | | -**certificateUrl** | **string** | | -**sourceId** | **int** | | -**createdAt** | [**\DateTime**](\DateTime.md) | | -**modifiedAt** | [**\DateTime**](\DateTime.md) | | -**iconUrl** | **string** | | -**complimentary** | **bool** | | -**open** | **bool** | | -**hasTrial** | **bool** | | -**deprecated** | **bool** | | -**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) - diff --git a/docs/Model/CourseDataDto.md b/docs/Model/CourseDataDto.md deleted file mode 100644 index bd8286f..0000000 --- a/docs/Model/CourseDataDto.md +++ /dev/null @@ -1,10 +0,0 @@ -# CourseDataDto - -## Properties -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) - diff --git a/docs/Model/CourseEnrollment.md b/docs/Model/CourseEnrollment.md deleted file mode 100644 index b152e33..0000000 --- a/docs/Model/CourseEnrollment.md +++ /dev/null @@ -1,25 +0,0 @@ -# CourseEnrollment - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **string** | | -**status** | **string** | | -**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) | | -**studentId** | **string** | | -**buyerId** | **string** | | -**orderId** | **string** | | -**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) - diff --git a/docs/Model/CourseEnrollmentFromAcademyDto.md b/docs/Model/CourseEnrollmentFromAcademyDto.md deleted file mode 100644 index 01bbec9..0000000 --- a/docs/Model/CourseEnrollmentFromAcademyDto.md +++ /dev/null @@ -1,9 +0,0 @@ -# CourseEnrollmentFromAcademyDto - -## Properties -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) - diff --git a/docs/Model/CreateAccountDto.md b/docs/Model/CreateAccountDto.md deleted file mode 100644 index f773226..0000000 --- a/docs/Model/CreateAccountDto.md +++ /dev/null @@ -1,11 +0,0 @@ -# CreateAccountDto - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**userEmail** | **string** | | -**firstName** | **string** | | [optional] -**lastName** | **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/CreateBlacklistSiteDto.md b/docs/Model/CreateBlacklistSiteDto.md deleted file mode 100644 index 2945a90..0000000 --- a/docs/Model/CreateBlacklistSiteDto.md +++ /dev/null @@ -1,8 +0,0 @@ -# CreateBlacklistSiteDto - -## 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/CreateCustomerNoteDto.md b/docs/Model/CreateCustomerNoteDto.md deleted file mode 100644 index 195ec92..0000000 --- a/docs/Model/CreateCustomerNoteDto.md +++ /dev/null @@ -1,12 +0,0 @@ -# CreateCustomerNoteDto - -## Properties -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) - diff --git a/docs/Model/CreateDto.md b/docs/Model/CreateDto.md deleted file mode 100644 index efe816e..0000000 --- a/docs/Model/CreateDto.md +++ /dev/null @@ -1,10 +0,0 @@ -# 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 deleted file mode 100644 index a0495d1..0000000 --- a/docs/Model/CreateProvisionedSubscriptionDto.md +++ /dev/null @@ -1,13 +0,0 @@ -# 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 connected to. | [optional] -**firstName** | **string** | The first name of the customer. | [optional] -**lastName** | **string** | The last name of the customers. | [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/CreateSiteBodyDto.md b/docs/Model/CreateSiteBodyDto.md deleted file mode 100644 index 5de04c6..0000000 --- a/docs/Model/CreateSiteBodyDto.md +++ /dev/null @@ -1,10 +0,0 @@ -# CreateSiteBodyDto - -## Properties -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) - diff --git a/docs/Model/Customer.md b/docs/Model/Customer.md deleted file mode 100644 index 7f976f9..0000000 --- a/docs/Model/Customer.md +++ /dev/null @@ -1,30 +0,0 @@ -# Customer - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **string** | | -**sourceId** | **int** | | -**enabled** | **bool** | | -**realm** | **string** | | -**username** | **string** | | -**email** | **string** | | -**emailVerified** | **bool** | | -**verificationToken** | **string** | | -**createdAt** | [**\DateTime**](\DateTime.md) | | -**modifiedAt** | [**\DateTime**](\DateTime.md) | | -**userEmail** | **string** | | -**userFirstName** | **string** | | -**userLastName** | **string** | | -**userCompany** | **string** | | -**userAddress1** | **string** | | -**userAddress2** | **string** | | -**userCity** | **string** | | -**userState** | **string** | | -**userPostCode** | **string** | | -**userCountry** | **string** | | -**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) - diff --git a/docs/Model/CustomerData.md b/docs/Model/CustomerData.md deleted file mode 100644 index 761bdc8..0000000 --- a/docs/Model/CustomerData.md +++ /dev/null @@ -1,23 +0,0 @@ -# CustomerData - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | -**avatarUrl** | **string** | | [optional] -**billing** | [**\Yoast\MyYoastApiClient\Model\BillingDto**](BillingDto.md) | | -**dateCreated** | [**\DateTime**](\DateTime.md) | | -**dateCreatedGmt** | [**\DateTime**](\DateTime.md) | | -**dateModified** | [**\DateTime**](\DateTime.md) | | [optional] -**dateModifiedGmt** | [**\DateTime**](\DateTime.md) | | [optional] -**email** | **string** | | -**firstName** | **string** | | -**lastName** | **string** | | -**isPayingCustomer** | **bool** | | -**metaData** | [**\Yoast\MyYoastApiClient\Model\MetaDataDto[]**](MetaDataDto.md) | | -**role** | **string** | | -**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) - diff --git a/docs/Model/CustomerDetails.md b/docs/Model/CustomerDetails.md deleted file mode 100644 index 3d57249..0000000 --- a/docs/Model/CustomerDetails.md +++ /dev/null @@ -1,12 +0,0 @@ -# CustomerDetails - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**email** | **string** | | -**firstName** | **string** | | [optional] -**lastName** | **string** | | [optional] -**phone** | **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/CustomerFromWooDto.md b/docs/Model/CustomerFromWooDto.md deleted file mode 100644 index 9541703..0000000 --- a/docs/Model/CustomerFromWooDto.md +++ /dev/null @@ -1,9 +0,0 @@ -# CustomerFromWooDto - -## Properties -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) - diff --git a/docs/Model/CustomerNote.md b/docs/Model/CustomerNote.md deleted file mode 100644 index 9f9dc1a..0000000 --- a/docs/Model/CustomerNote.md +++ /dev/null @@ -1,15 +0,0 @@ -# CustomerNote - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **string** | | -**updatedAt** | [**\DateTime**](\DateTime.md) | | -**createdAt** | [**\DateTime**](\DateTime.md) | | -**content** | **string** | | -**nextContactDate** | [**\DateTime**](\DateTime.md) | | -**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) - diff --git a/docs/Model/EddDTO.md b/docs/Model/EddDTO.md deleted file mode 100644 index aeabdbc..0000000 --- a/docs/Model/EddDTO.md +++ /dev/null @@ -1,11 +0,0 @@ -# EddDTO - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**eddAction** | **string** | | -**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) - diff --git a/docs/Model/ExtraCourseDataDto.md b/docs/Model/ExtraCourseDataDto.md deleted file mode 100644 index fbc0b40..0000000 --- a/docs/Model/ExtraCourseDataDto.md +++ /dev/null @@ -1,18 +0,0 @@ -# ExtraCourseDataDto - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**overviewSnippet** | **string** | | -**permalink** | **string** | | -**certificateUrl** | **string** | | -**iconUrl** | **string** | | -**complimentary** | **bool** | | -**open** | **bool** | | -**hasTrial** | **bool** | | -**deprecated** | **bool** | | -**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) - diff --git a/docs/Model/ExtraOrderData.md b/docs/Model/ExtraOrderData.md deleted file mode 100644 index 3e9a43d..0000000 --- a/docs/Model/ExtraOrderData.md +++ /dev/null @@ -1,17 +0,0 @@ -# ExtraOrderData - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**customer** | [**\Yoast\MyYoastApiClient\Model\CustomerData**](CustomerData.md) | | -**shopId** | **int** | | -**paymentReference** | **string** | | -**automatic** | **bool** | | -**billingType** | **string** | | -**vatNumber** | **string** | | [optional] -**renewalKey** | **string** | | [optional] -**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) - diff --git a/docs/Model/ExtraProductData.md b/docs/Model/ExtraProductData.md deleted file mode 100644 index 8d8af90..0000000 --- a/docs/Model/ExtraProductData.md +++ /dev/null @@ -1,14 +0,0 @@ -# ExtraProductData - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**shopId** | **int** | | -**changelog** | **string** | | -**productGroupSlugs** | **string[]** | | -**billingType** | **string** | | -**billingTerm** | **string** | | [optional] -**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 deleted file mode 100644 index ea90d0c..0000000 --- a/docs/Model/FeeLineDto.md +++ /dev/null @@ -1,17 +0,0 @@ -# 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 deleted file mode 100644 index 217aede..0000000 --- a/docs/Model/FromAcademyDto.md +++ /dev/null @@ -1,10 +0,0 @@ -# FromAcademyDto - -## Properties -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) - diff --git a/docs/Model/GenerateDto.md b/docs/Model/GenerateDto.md deleted file mode 100644 index ad3a5ae..0000000 --- a/docs/Model/GenerateDto.md +++ /dev/null @@ -1,9 +0,0 @@ -# GenerateDto - -## Properties -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) - diff --git a/docs/Model/HelpScoutDto.md b/docs/Model/HelpScoutDto.md deleted file mode 100644 index 7ff45d1..0000000 --- a/docs/Model/HelpScoutDto.md +++ /dev/null @@ -1,12 +0,0 @@ -# HelpScoutDto - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ticket** | **object** | | [optional] -**customer** | **object** | | [optional] -**user** | **object** | | [optional] -**mailbox** | **object** | | [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 deleted file mode 100644 index d778ff3..0000000 --- a/docs/Model/InviteDto.md +++ /dev/null @@ -1,9 +0,0 @@ -# InviteDto - -## 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/JSZip.md b/docs/Model/JSZip.md deleted file mode 100644 index 6d34fa5..0000000 --- a/docs/Model/JSZip.md +++ /dev/null @@ -1,8 +0,0 @@ -# JSZip - -## 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/JobOptionsDto.md b/docs/Model/JobOptionsDto.md deleted file mode 100644 index 9d4b2bb..0000000 --- a/docs/Model/JobOptionsDto.md +++ /dev/null @@ -1,19 +0,0 @@ -# JobOptionsDto - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**priority** | **int** | | [optional] -**delay** | **int** | | [optional] -**attempts** | **int** | | [optional] -**repeat** | **object** | | [optional] -**backoff** | **object** | | [optional] -**lifo** | **bool** | | [optional] -**timeout** | **int** | | [optional] -**jobId** | **object** | | [optional] -**removeOnComplete** | **object** | | [optional] -**removeOnFail** | **object** | | [optional] -**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 deleted file mode 100644 index ed6e376..0000000 --- a/docs/Model/LineItemDto.md +++ /dev/null @@ -1,26 +0,0 @@ -# LineItemDto - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bundledItemTitle** | **string** | | [optional] -**id** | **int** | | -**name** | **string** | | -**price** | **int** | | -**productId** | **int** | | -**quantity** | **int** | | -**sku** | **string** | | -**subtotal** | **string** | | -**subtotalTax** | **string** | | -**taxes** | [**\Yoast\MyYoastApiClient\Model\LineItemTax[]**](LineItemTax.md) | | -**taxClass** | **string** | | -**total** | **string** | | -**totalTax** | **string** | | -**variationId** | **int** | | -**bundledBy** | **int** | | [optional] -**bundledItems** | **string[]** | | [optional] -**metaData** | [**\Yoast\MyYoastApiClient\Model\MetaDataDto[]**](MetaDataDto.md) | | [optional] -**parentName** | **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/LineItemTax.md b/docs/Model/LineItemTax.md deleted file mode 100644 index 1c1c04b..0000000 --- a/docs/Model/LineItemTax.md +++ /dev/null @@ -1,11 +0,0 @@ -# LineItemTax - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | -**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) - diff --git a/docs/Model/LinkSiteDto.md b/docs/Model/LinkSiteDto.md deleted file mode 100644 index 582031c..0000000 --- a/docs/Model/LinkSiteDto.md +++ /dev/null @@ -1,10 +0,0 @@ -# LinkSiteDto - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**url** | **string** | | -**invoiceNumber** | **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/LoginDto.md b/docs/Model/LoginDto.md deleted file mode 100644 index e625f20..0000000 --- a/docs/Model/LoginDto.md +++ /dev/null @@ -1,10 +0,0 @@ -# LoginDto - -## Properties -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) - diff --git a/docs/Model/LoginUserDto.md b/docs/Model/LoginUserDto.md deleted file mode 100644 index a2aca49..0000000 --- a/docs/Model/LoginUserDto.md +++ /dev/null @@ -1,12 +0,0 @@ -# LoginUserDto - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**email** | **string** | The username of the user to login. | -**password** | **string** | The password of the user to login. | -**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) - diff --git a/docs/Model/MetaDataDto.md b/docs/Model/MetaDataDto.md deleted file mode 100644 index 2d02ff9..0000000 --- a/docs/Model/MetaDataDto.md +++ /dev/null @@ -1,13 +0,0 @@ -# MetaDataDto - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | -**key** | **string** | | -**value** | **object** | | -**displayKey** | **string** | | [optional] -**displayValue** | **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/Order.md b/docs/Model/Order.md deleted file mode 100644 index b0645e0..0000000 --- a/docs/Model/Order.md +++ /dev/null @@ -1,47 +0,0 @@ -# Order - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**countryOfOrigin** | **string** | | -**id** | **string** | | -**totalAmount** | **int** | | -**subtotalAmount** | **int** | | -**date** | [**\DateTime**](\DateTime.md) | | -**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**](\DateTime.md) | | -**modifiedAt** | [**\DateTime**](\DateTime.md) | | -**renewal** | **bool** | | -**automatic** | **bool** | | -**billingType** | **string** | | -**ipAddress** | **string** | | -**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) - diff --git a/docs/Model/OrderData.md b/docs/Model/OrderData.md deleted file mode 100644 index 0171215..0000000 --- a/docs/Model/OrderData.md +++ /dev/null @@ -1,49 +0,0 @@ -# OrderData - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | -**billing** | [**\Yoast\MyYoastApiClient\Model\BillingDto**](BillingDto.md) | | -**cartHash** | **string** | | -**cartTax** | **string** | | -**createdVia** | **string** | | -**currency** | **string** | | -**customerId** | **int** | | -**customerIpAddress** | **string** | | -**customerNote** | **string** | | -**customerUserAgent** | **string** | | -**dateCompleted** | [**\DateTime**](\DateTime.md) | | [optional] -**dateCompletedGmt** | [**\DateTime**](\DateTime.md) | | [optional] -**dateCreated** | [**\DateTime**](\DateTime.md) | | -**dateCreatedGmt** | [**\DateTime**](\DateTime.md) | | -**dateModified** | [**\DateTime**](\DateTime.md) | | [optional] -**dateModifiedGmt** | [**\DateTime**](\DateTime.md) | | [optional] -**datePaid** | [**\DateTime**](\DateTime.md) | | [optional] -**datePaidGmt** | [**\DateTime**](\DateTime.md) | | [optional] -**discountTax** | **string** | | -**discountTotal** | **string** | | -**couponLines** | [**\Yoast\MyYoastApiClient\Model\CouponLineDto[]**](CouponLineDto.md) | | -**feeLines** | [**\Yoast\MyYoastApiClient\Model\FeeLineDto[]**](FeeLineDto.md) | | -**lineItems** | [**\Yoast\MyYoastApiClient\Model\LineItemDto[]**](LineItemDto.md) | | -**metaData** | [**\Yoast\MyYoastApiClient\Model\MetaDataDto[]**](MetaDataDto.md) | | -**number** | **string** | | -**orderKey** | **string** | | -**parentId** | **int** | | [optional] -**paymentMethod** | **string** | | -**paymentMethodTitle** | **string** | | -**pricesIncludeTax** | **bool** | | -**refunds** | [**\Yoast\MyYoastApiClient\Model\OrderRefundDto[]**](OrderRefundDto.md) | | -**shipping** | [**\Yoast\MyYoastApiClient\Model\ShippingDto**](ShippingDto.md) | | -**shippingLines** | **string[]** | | -**shippingTax** | **string** | | -**shippingTotal** | **string** | | -**status** | **string** | | -**taxLines** | [**\Yoast\MyYoastApiClient\Model\TaxLineItem[]**](TaxLineItem.md) | | -**total** | **string** | | -**totalTax** | **string** | | -**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) - diff --git a/docs/Model/OrderFromWooDto.md b/docs/Model/OrderFromWooDto.md deleted file mode 100644 index 0c5fa13..0000000 --- a/docs/Model/OrderFromWooDto.md +++ /dev/null @@ -1,10 +0,0 @@ -# OrderFromWooDto - -## Properties -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) - diff --git a/docs/Model/OrderRefundDto.md b/docs/Model/OrderRefundDto.md deleted file mode 100644 index 9a4416b..0000000 --- a/docs/Model/OrderRefundDto.md +++ /dev/null @@ -1,11 +0,0 @@ -# OrderRefundDto - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | -**reason** | **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) - diff --git a/docs/Model/Product.md b/docs/Model/Product.md deleted file mode 100644 index 6b6830a..0000000 --- a/docs/Model/Product.md +++ /dev/null @@ -1,33 +0,0 @@ -# Product - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **string** | | -**name** | **string** | | -**storeUrl** | **string** | | -**downloads** | [**\Yoast\MyYoastApiClient\Model\ProductDownload[]**](ProductDownload.md) | | [optional] -**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**](\DateTime.md) | | -**modifiedAt** | [**\DateTime**](\DateTime.md) | | -**billingTerm** | **string** | | -**billingType** | **string** | | -**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) - diff --git a/docs/Model/ProductCategory.md b/docs/Model/ProductCategory.md deleted file mode 100644 index 018e2de..0000000 --- a/docs/Model/ProductCategory.md +++ /dev/null @@ -1,11 +0,0 @@ -# ProductCategory - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | -**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) - diff --git a/docs/Model/ProductData.md b/docs/Model/ProductData.md deleted file mode 100644 index 7e7a8fe..0000000 --- a/docs/Model/ProductData.md +++ /dev/null @@ -1,24 +0,0 @@ -# ProductData - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**metaData** | [**\Yoast\MyYoastApiClient\Model\MetaDataDto[]**](MetaDataDto.md) | | -**images** | [**\Yoast\MyYoastApiClient\Model\ProductImage[]**](ProductImage.md) | | -**id** | **int** | | -**name** | **string** | | -**description** | **string** | | -**permalink** | **string** | | -**downloads** | [**\Yoast\MyYoastApiClient\Model\ProductDownload[]**](ProductDownload.md) | | -**sku** | **string** | | -**type** | **string** | | -**status** | **string** | | -**regularPrice** | **string** | | -**price** | **string** | | -**purchasable** | **bool** | | -**taxStatus** | **string** | | -**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) - diff --git a/docs/Model/ProductDownload.md b/docs/Model/ProductDownload.md deleted file mode 100644 index c83a733..0000000 --- a/docs/Model/ProductDownload.md +++ /dev/null @@ -1,11 +0,0 @@ -# ProductDownload - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **string** | | -**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) - diff --git a/docs/Model/ProductFromWooDto.md b/docs/Model/ProductFromWooDto.md deleted file mode 100644 index a1660f6..0000000 --- a/docs/Model/ProductFromWooDto.md +++ /dev/null @@ -1,10 +0,0 @@ -# ProductFromWooDto - -## Properties -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) - diff --git a/docs/Model/ProductGroup.md b/docs/Model/ProductGroup.md deleted file mode 100644 index 836c046..0000000 --- a/docs/Model/ProductGroup.md +++ /dev/null @@ -1,21 +0,0 @@ -# ProductGroup - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **string** | | -**updatedAt** | [**\DateTime**](\DateTime.md) | | -**createdAt** | [**\DateTime**](\DateTime.md) | | -**name** | **string** | | -**slug** | **string** | | -**description** | **string** | | -**icon** | **string** | | -**svgIcon** | **string** | | -**changelog** | **string** | | -**version** | **string** | | -**downloadUrl** | **string** | | -**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) - diff --git a/docs/Model/ProductGroupExtraData.md b/docs/Model/ProductGroupExtraData.md deleted file mode 100644 index a094910..0000000 --- a/docs/Model/ProductGroupExtraData.md +++ /dev/null @@ -1,11 +0,0 @@ -# ProductGroupExtraData - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**parentSlug** | **string** | | -**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) - diff --git a/docs/Model/ProductGroupFromWooDto.md b/docs/Model/ProductGroupFromWooDto.md deleted file mode 100644 index f280b3a..0000000 --- a/docs/Model/ProductGroupFromWooDto.md +++ /dev/null @@ -1,11 +0,0 @@ -# ProductGroupFromWooDto - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**productGroupTerm** | [**\Yoast\MyYoastApiClient\Model\ProductGroupTerm**](ProductGroupTerm.md) | | -**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) - diff --git a/docs/Model/ProductGroupMeta.md b/docs/Model/ProductGroupMeta.md deleted file mode 100644 index 321014a..0000000 --- a/docs/Model/ProductGroupMeta.md +++ /dev/null @@ -1,11 +0,0 @@ -# ProductGroupMeta - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**courseId** | **string** | | -**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) - diff --git a/docs/Model/ProductGroupTerm.md b/docs/Model/ProductGroupTerm.md deleted file mode 100644 index 06d4ddc..0000000 --- a/docs/Model/ProductGroupTerm.md +++ /dev/null @@ -1,11 +0,0 @@ -# ProductGroupTerm - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **string** | | -**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) - diff --git a/docs/Model/ProductImage.md b/docs/Model/ProductImage.md deleted file mode 100644 index e85f550..0000000 --- a/docs/Model/ProductImage.md +++ /dev/null @@ -1,17 +0,0 @@ -# ProductImage - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | -**dateCreated** | [**\DateTime**](\DateTime.md) | | -**dateCreatedGmt** | [**\DateTime**](\DateTime.md) | | -**dateModified** | [**\DateTime**](\DateTime.md) | | -**dateModifiedGmt** | [**\DateTime**](\DateTime.md) | | -**src** | **string** | | -**name** | **string** | | -**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) - diff --git a/docs/Model/ProgressData.md b/docs/Model/ProgressData.md deleted file mode 100644 index 680f2ea..0000000 --- a/docs/Model/ProgressData.md +++ /dev/null @@ -1,15 +0,0 @@ -# ProgressData - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | **string** | | -**progress** | **int** | | -**outsideTrialProgress** | **bool** | | -**studentId** | **int** | | -**courseId** | **int** | | -**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) - diff --git a/docs/Model/ProvisionerData.md b/docs/Model/ProvisionerData.md deleted file mode 100644 index f26176a..0000000 --- a/docs/Model/ProvisionerData.md +++ /dev/null @@ -1,12 +0,0 @@ -# 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 deleted file mode 100644 index 87320f8..0000000 --- a/docs/Model/PurgeKVRequestDto.md +++ /dev/null @@ -1,9 +0,0 @@ -# PurgeKVRequestDto - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**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 deleted file mode 100644 index 612b67b..0000000 --- a/docs/Model/Refund.md +++ /dev/null @@ -1,17 +0,0 @@ -# Refund - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **string** | | -**amount** | **int** | | -**date** | [**\DateTime**](\DateTime.md) | | -**modifiedAt** | [**\DateTime**](\DateTime.md) | | -**reason** | **string** | | -**sourceId** | **int** | | -**sourceShopId** | **int** | | -**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) - diff --git a/docs/Model/RefundDataDto.md b/docs/Model/RefundDataDto.md deleted file mode 100644 index f9fc702..0000000 --- a/docs/Model/RefundDataDto.md +++ /dev/null @@ -1,20 +0,0 @@ -# RefundDataDto - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | -**dateCreated** | [**\DateTime**](\DateTime.md) | | -**dateCreatedGmt** | [**\DateTime**](\DateTime.md) | | -**amount** | **string** | | -**reason** | **string** | | -**refundedBy** | **int** | | -**refundedPayment** | **bool** | | -**metaData** | [**\Yoast\MyYoastApiClient\Model\MetaDataDto[]**](MetaDataDto.md) | | -**lineItems** | [**\Yoast\MyYoastApiClient\Model\LineItemDto[]**](LineItemDto.md) | | -**shippingLines** | **string[]** | | -**taxLines** | [**array[]**](array.md) | | -**feeLines** | **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/RegenerateTokenResponseDto.md b/docs/Model/RegenerateTokenResponseDto.md deleted file mode 100644 index 9376adf..0000000 --- a/docs/Model/RegenerateTokenResponseDto.md +++ /dev/null @@ -1,9 +0,0 @@ -# RegenerateTokenResponseDto - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**token** | **string** | The newly generated token to authenticate with. Store this value somewhere safe! | - -[[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 deleted file mode 100644 index f09ead9..0000000 --- a/docs/Model/RenameBodyDto.md +++ /dev/null @@ -1,9 +0,0 @@ -# RenameBodyDto - -## Properties -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) - diff --git a/docs/Model/ResetPasswordDto.md b/docs/Model/ResetPasswordDto.md deleted file mode 100644 index 74bf685..0000000 --- a/docs/Model/ResetPasswordDto.md +++ /dev/null @@ -1,12 +0,0 @@ -# ResetPasswordDto - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**userLogin** | **string** | | -**password1** | **string** | | -**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) - diff --git a/docs/Model/RoleIDDto.md b/docs/Model/RoleIDDto.md deleted file mode 100644 index bfa8d8d..0000000 --- a/docs/Model/RoleIDDto.md +++ /dev/null @@ -1,9 +0,0 @@ -# RoleIDDto - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**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/ScheduleDeleteUserDto.md b/docs/Model/ScheduleDeleteUserDto.md deleted file mode 100644 index 3382072..0000000 --- a/docs/Model/ScheduleDeleteUserDto.md +++ /dev/null @@ -1,12 +0,0 @@ -# ScheduleDeleteUserDto - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**provisioner** | **string** | The name of the provisioner. | -**identifier** | **string** | An identifier of the resource to gdpr delete. | -**customerEmail** | **string** | The email address of the customer. | -**deleteAt** | **int** | UNIX Timestamp of the date when it should be deleted. | - -[[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 deleted file mode 100644 index 7c14172..0000000 --- a/docs/Model/SendResetPasswordEmailDto.md +++ /dev/null @@ -1,9 +0,0 @@ -# SendResetPasswordEmailDto - -## 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/SetExpiryDateDto.md b/docs/Model/SetExpiryDateDto.md deleted file mode 100644 index c94a5a6..0000000 --- a/docs/Model/SetExpiryDateDto.md +++ /dev/null @@ -1,10 +0,0 @@ -# SetExpiryDateDto - -## Properties -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) - diff --git a/docs/Model/SetProvisionedSiteDto.md b/docs/Model/SetProvisionedSiteDto.md deleted file mode 100644 index bb3c4f9..0000000 --- a/docs/Model/SetProvisionedSiteDto.md +++ /dev/null @@ -1,9 +0,0 @@ -# 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 deleted file mode 100644 index 692ad22..0000000 --- a/docs/Model/ShippingDto.md +++ /dev/null @@ -1,17 +0,0 @@ -# ShippingDto - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**address1** | **string** | | -**address2** | **string** | | -**city** | **string** | | -**company** | **string** | | -**country** | **string** | | -**firstName** | **string** | | -**lastName** | **string** | | -**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) - diff --git a/docs/Model/SignupAccountDto.md b/docs/Model/SignupAccountDto.md deleted file mode 100644 index 87a487d..0000000 --- a/docs/Model/SignupAccountDto.md +++ /dev/null @@ -1,11 +0,0 @@ -# SignupAccountDto - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**password** | **string** | | -**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) - diff --git a/docs/Model/Site.md b/docs/Model/Site.md deleted file mode 100644 index 1448075..0000000 --- a/docs/Model/Site.md +++ /dev/null @@ -1,25 +0,0 @@ -# Site - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **string** | | -**url** | **string** | | -**header** | **string** | | -**icon** | **string** | | -**creationDate** | [**\DateTime**](\DateTime.md) | | -**hostname** | **string** | | -**protocol** | **string** | | -**port** | **int** | | -**path** | **string** | | -**createdAt** | [**\DateTime**](\DateTime.md) | | -**modifiedAt** | [**\DateTime**](\DateTime.md) | | -**type** | **string** | | -**status** | **string** | | -**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) - diff --git a/docs/Model/SubscribeByEmailBodyDto.md b/docs/Model/SubscribeByEmailBodyDto.md deleted file mode 100644 index 3f62279..0000000 --- a/docs/Model/SubscribeByEmailBodyDto.md +++ /dev/null @@ -1,11 +0,0 @@ -# SubscribeByEmailBodyDto - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**email** | **string** | | -**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) - diff --git a/docs/Model/SubscribeDto.md b/docs/Model/SubscribeDto.md deleted file mode 100644 index a40e6c7..0000000 --- a/docs/Model/SubscribeDto.md +++ /dev/null @@ -1,10 +0,0 @@ -# SubscribeDto - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**customerDetails** | [**\Yoast\MyYoastApiClient\Model\CustomerDetails**](CustomerDetails.md) | | -**list** | **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/Subscription.md b/docs/Model/Subscription.md deleted file mode 100644 index c8b4184..0000000 --- a/docs/Model/Subscription.md +++ /dev/null @@ -1,29 +0,0 @@ -# Subscription - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **string** | | -**startDate** | [**\DateTime**](\DateTime.md) | | -**endDate** | [**\DateTime**](\DateTime.md) | | -**sourceId** | **int** | | -**sourceLineItemId** | **int** | | -**sourceShopId** | **int** | | -**status** | **string** | | -**currency** | **string** | | -**date** | [**\DateTime**](\DateTime.md) | | -**price** | **int** | | -**name** | **string** | | -**nextPayment** | [**\DateTime**](\DateTime.md) | | -**limit** | **int** | | -**used** | **int** | | -**createdAt** | [**\DateTime**](\DateTime.md) | | -**modifiedAt** | [**\DateTime**](\DateTime.md) | | -**requiresManualRenewal** | **bool** | | -**renewalSecret** | **string** | | -**subscriptionNumber** | **string** | | -**lastBillingTerm** | **string** | | -**subscriberId** | **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/SubscriptionProvisioningResponseDto.md b/docs/Model/SubscriptionProvisioningResponseDto.md deleted file mode 100644 index 75134f0..0000000 --- a/docs/Model/SubscriptionProvisioningResponseDto.md +++ /dev/null @@ -1,15 +0,0 @@ -# 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 deleted file mode 100644 index 18fce82..0000000 --- a/docs/Model/SwitchSubscriptionNumberOfTimesDto.md +++ /dev/null @@ -1,11 +0,0 @@ -# SwitchSubscriptionNumberOfTimesDto - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**fromSourceId** | **int** | | -**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) - diff --git a/docs/Model/TaxLineItem.md b/docs/Model/TaxLineItem.md deleted file mode 100644 index 71b0dba..0000000 --- a/docs/Model/TaxLineItem.md +++ /dev/null @@ -1,17 +0,0 @@ -# TaxLineItem - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | -**compound** | **bool** | | -**label** | **string** | | -**metaData** | [**\Yoast\MyYoastApiClient\Model\MetaDataDto[]**](MetaDataDto.md) | | -**rateCode** | **string** | | -**rateId** | **int** | | -**shippingTaxTotal** | **string** | | -**taxTotal** | **string** | | -**ratePercent** | **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/Transaction.md b/docs/Model/Transaction.md deleted file mode 100644 index 044e9dd..0000000 --- a/docs/Model/Transaction.md +++ /dev/null @@ -1,11 +0,0 @@ -# Transaction - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**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) - diff --git a/docs/Model/TransactionDataDto.md b/docs/Model/TransactionDataDto.md deleted file mode 100644 index c1ff848..0000000 --- a/docs/Model/TransactionDataDto.md +++ /dev/null @@ -1,14 +0,0 @@ -# TransactionDataDto - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**transactionId** | **string** | | -**paymentId** | **string** | | -**createdOn** | **string** | | -**updatedOn** | **string** | | -**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) - diff --git a/docs/Model/TransferAdmissionDto.md b/docs/Model/TransferAdmissionDto.md deleted file mode 100644 index ab7c82e..0000000 --- a/docs/Model/TransferAdmissionDto.md +++ /dev/null @@ -1,10 +0,0 @@ -# TransferAdmissionDto - -## Properties -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) - diff --git a/docs/Model/TransferDto.md b/docs/Model/TransferDto.md deleted file mode 100644 index 18b42b4..0000000 --- a/docs/Model/TransferDto.md +++ /dev/null @@ -1,10 +0,0 @@ -# TransferDto - -## Properties -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) - diff --git a/docs/Model/TransferOwnershipDto.md b/docs/Model/TransferOwnershipDto.md deleted file mode 100644 index 311e637..0000000 --- a/docs/Model/TransferOwnershipDto.md +++ /dev/null @@ -1,10 +0,0 @@ -# TransferOwnershipDto - -## Properties -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) - diff --git a/docs/Model/TransferSiteDto.md b/docs/Model/TransferSiteDto.md deleted file mode 100644 index e2d6e3a..0000000 --- a/docs/Model/TransferSiteDto.md +++ /dev/null @@ -1,10 +0,0 @@ -# TransferSiteDto - -## Properties -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) - diff --git a/docs/Model/UnsubscribeDto.md b/docs/Model/UnsubscribeDto.md deleted file mode 100644 index ba297f0..0000000 --- a/docs/Model/UnsubscribeDto.md +++ /dev/null @@ -1,10 +0,0 @@ -# UnsubscribeDto - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**email** | **string** | | -**list** | **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/UnsubscribeFromNewsletterDto.md b/docs/Model/UnsubscribeFromNewsletterDto.md deleted file mode 100644 index 42993ed..0000000 --- a/docs/Model/UnsubscribeFromNewsletterDto.md +++ /dev/null @@ -1,9 +0,0 @@ -# UnsubscribeFromNewsletterDto - -## 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/UpdateAllKVRequestDto.md b/docs/Model/UpdateAllKVRequestDto.md deleted file mode 100644 index 334242f..0000000 --- a/docs/Model/UpdateAllKVRequestDto.md +++ /dev/null @@ -1,11 +0,0 @@ -# UpdateAllKVRequestDto - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**urls** | **string[]** | | [optional] -**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/UpdateDownloadDto.md b/docs/Model/UpdateDownloadDto.md deleted file mode 100644 index 80f55e2..0000000 --- a/docs/Model/UpdateDownloadDto.md +++ /dev/null @@ -1,11 +0,0 @@ -# UpdateDownloadDto - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**slug** | **string** | The slug of the product group to update the download for. | -**downloadUrl** | **string** | The download url to set for the product group. | -**versionNumber** | **string** | The version number to set for the product group. | - -[[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 deleted file mode 100644 index 745b152..0000000 --- a/docs/Model/UpdateDto.md +++ /dev/null @@ -1,9 +0,0 @@ -# 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 deleted file mode 100644 index 4f76e88..0000000 --- a/docs/Model/UpdateFileDto.md +++ /dev/null @@ -1,10 +0,0 @@ -# UpdateFileDto - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**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) - diff --git a/docs/Model/UpdateSiteDto.md b/docs/Model/UpdateSiteDto.md deleted file mode 100644 index 4c89723..0000000 --- a/docs/Model/UpdateSiteDto.md +++ /dev/null @@ -1,9 +0,0 @@ -# UpdateSiteDto - -## Properties -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) - diff --git a/docs/Model/UpdateUserDto.md b/docs/Model/UpdateUserDto.md deleted file mode 100644 index 1dd241f..0000000 --- a/docs/Model/UpdateUserDto.md +++ /dev/null @@ -1,13 +0,0 @@ -# UpdateUserDto - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**userEmail** | **string** | | -**userFirstName** | **string** | | -**userLastName** | **string** | | -**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) - diff --git a/docs/Model/UpdateUserToWordpressDto.md b/docs/Model/UpdateUserToWordpressDto.md deleted file mode 100644 index f9ba775..0000000 --- a/docs/Model/UpdateUserToWordpressDto.md +++ /dev/null @@ -1,11 +0,0 @@ -# UpdateUserToWordpressDto - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**email** | **string** | | -**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) - diff --git a/docs/Model/UpsertChangelogDto.md b/docs/Model/UpsertChangelogDto.md deleted file mode 100644 index a9200a9..0000000 --- a/docs/Model/UpsertChangelogDto.md +++ /dev/null @@ -1,11 +0,0 @@ -# UpsertChangelogDto - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**content** | **string** | | -**id** | **string** | | [optional] -**sourceId** | **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/UserIdentity.md b/docs/Model/UserIdentity.md deleted file mode 100644 index 7f3ded8..0000000 --- a/docs/Model/UserIdentity.md +++ /dev/null @@ -1,19 +0,0 @@ -# UserIdentity - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | -**provider** | **string** | | -**authScheme** | **string** | | -**externalId** | **string** | | -**profile** | **object** | | -**credentials** | **object** | | -**created** | [**\DateTime**](\DateTime.md) | | -**modified** | [**\DateTime**](\DateTime.md) | | -**createdAt** | [**\DateTime**](\DateTime.md) | | -**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) - diff --git a/git_push.sh b/git_push.sh deleted file mode 100644 index de04ecd..0000000 --- a/git_push.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 - -if [ "$git_user_id" = "" ]; then - git_user_id="yoast" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="my-yoast-php-client" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_repo_base_url}.com/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_repo_base_url}.com/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_repo_base_url}.com/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/phpunit.xml.dist b/phpunit.xml.dist deleted file mode 100644 index 9477d7e..0000000 --- a/phpunit.xml.dist +++ /dev/null @@ -1,21 +0,0 @@ - - - - - ./test/Api - ./test/Model - - - - - - ./src/Api - ./src/Model - - - diff --git a/src/Api/AdmissionApi.php b/src/Api/AdmissionApi.php deleted file mode 100644 index 6396d1b..0000000 --- a/src/Api/AdmissionApi.php +++ /dev/null @@ -1,1656 +0,0 @@ -client = $client ?: new Client(); - $this->config = $config ?: new Configuration(); - $this->headerSelector = $selector ?: new HeaderSelector(); - } - - /** - * @return Configuration - */ - public function getConfig() - { - return $this->config; - } - - /** - * Operation apiAdmissionsGet - * - * 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 apiAdmissionsGet($filter = null) - { - list($response) = $this->apiAdmissionsGetWithHttpInfo($filter); - return $response; - } - - /** - * Operation apiAdmissionsGetWithHttpInfo - * - * 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 apiAdmissionsGetWithHttpInfo($filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Admission[]'; - $request = $this->apiAdmissionsGetRequest($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 apiAdmissionsGetAsync - * - * Get admissions - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiAdmissionsGetAsync($filter = null) - { - return $this->apiAdmissionsGetAsyncWithHttpInfo($filter) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiAdmissionsGetAsyncWithHttpInfo - * - * Get admissions - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiAdmissionsGetAsyncWithHttpInfo($filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Admission[]'; - $request = $this->apiAdmissionsGetRequest($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 'apiAdmissionsGet' - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiAdmissionsGetRequest($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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiAdmissionsIdGet - * - * 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 apiAdmissionsIdGet($id) - { - list($response) = $this->apiAdmissionsIdGetWithHttpInfo($id); - return $response; - } - - /** - * Operation apiAdmissionsIdGetWithHttpInfo - * - * 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 apiAdmissionsIdGetWithHttpInfo($id) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Admission'; - $request = $this->apiAdmissionsIdGetRequest($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 apiAdmissionsIdGetAsync - * - * Get an admission - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiAdmissionsIdGetAsync($id) - { - return $this->apiAdmissionsIdGetAsyncWithHttpInfo($id) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiAdmissionsIdGetAsyncWithHttpInfo - * - * Get an admission - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiAdmissionsIdGetAsyncWithHttpInfo($id) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Admission'; - $request = $this->apiAdmissionsIdGetRequest($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 'apiAdmissionsIdGet' - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiAdmissionsIdGetRequest($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 apiAdmissionsIdGet' - ); - } - - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiAdmissionsIdPut - * - * 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 apiAdmissionsIdPut($body, $id) - { - list($response) = $this->apiAdmissionsIdPutWithHttpInfo($body, $id); - return $response; - } - - /** - * Operation apiAdmissionsIdPutWithHttpInfo - * - * 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 apiAdmissionsIdPutWithHttpInfo($body, $id) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Admission'; - $request = $this->apiAdmissionsIdPutRequest($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 apiAdmissionsIdPutAsync - * - * Update an admission - * - * @param \Yoast\MyYoastApiClient\Model\UpdateDto $body (required) - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiAdmissionsIdPutAsync($body, $id) - { - return $this->apiAdmissionsIdPutAsyncWithHttpInfo($body, $id) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiAdmissionsIdPutAsyncWithHttpInfo - * - * Update an admission - * - * @param \Yoast\MyYoastApiClient\Model\UpdateDto $body (required) - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiAdmissionsIdPutAsyncWithHttpInfo($body, $id) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Admission'; - $request = $this->apiAdmissionsIdPutRequest($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 'apiAdmissionsIdPut' - * - * @param \Yoast\MyYoastApiClient\Model\UpdateDto $body (required) - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiAdmissionsIdPutRequest($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 apiAdmissionsIdPut' - ); - } - // 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 apiAdmissionsIdPut' - ); - } - - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiAdmissionsPagedGet - * - * 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 apiAdmissionsPagedGet($filter = null) - { - $this->apiAdmissionsPagedGetWithHttpInfo($filter); - } - - /** - * Operation apiAdmissionsPagedGetWithHttpInfo - * - * 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 apiAdmissionsPagedGetWithHttpInfo($filter = null) - { - $returnType = ''; - $request = $this->apiAdmissionsPagedGetRequest($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 apiAdmissionsPagedGetAsync - * - * Get admissions - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiAdmissionsPagedGetAsync($filter = null) - { - return $this->apiAdmissionsPagedGetAsyncWithHttpInfo($filter) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiAdmissionsPagedGetAsyncWithHttpInfo - * - * Get admissions - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiAdmissionsPagedGetAsyncWithHttpInfo($filter = null) - { - $returnType = ''; - $request = $this->apiAdmissionsPagedGetRequest($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 'apiAdmissionsPagedGet' - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiAdmissionsPagedGetRequest($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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiAdmissionsPost - * - * 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 apiAdmissionsPost($body) - { - list($response) = $this->apiAdmissionsPostWithHttpInfo($body); - return $response; - } - - /** - * Operation apiAdmissionsPostWithHttpInfo - * - * 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 apiAdmissionsPostWithHttpInfo($body) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Admission'; - $request = $this->apiAdmissionsPostRequest($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 apiAdmissionsPostAsync - * - * Invite a customer - * - * @param \Yoast\MyYoastApiClient\Model\CreateDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiAdmissionsPostAsync($body) - { - return $this->apiAdmissionsPostAsyncWithHttpInfo($body) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiAdmissionsPostAsyncWithHttpInfo - * - * Invite a customer - * - * @param \Yoast\MyYoastApiClient\Model\CreateDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiAdmissionsPostAsyncWithHttpInfo($body) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Admission'; - $request = $this->apiAdmissionsPostRequest($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 'apiAdmissionsPost' - * - * @param \Yoast\MyYoastApiClient\Model\CreateDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiAdmissionsPostRequest($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 apiAdmissionsPost' - ); - } - - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiAdmissionsTransferPost - * - * Transfer admissions between customers - * - * @param \Yoast\MyYoastApiClient\Model\TransferAdmissionDto $body body (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\Admission[] - */ - public function apiAdmissionsTransferPost($body) - { - list($response) = $this->apiAdmissionsTransferPostWithHttpInfo($body); - return $response; - } - - /** - * Operation apiAdmissionsTransferPostWithHttpInfo - * - * Transfer admissions between customers - * - * @param \Yoast\MyYoastApiClient\Model\TransferAdmissionDto $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 apiAdmissionsTransferPostWithHttpInfo($body) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Admission[]'; - $request = $this->apiAdmissionsTransferPostRequest($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 apiAdmissionsTransferPostAsync - * - * Transfer admissions between customers - * - * @param \Yoast\MyYoastApiClient\Model\TransferAdmissionDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiAdmissionsTransferPostAsync($body) - { - return $this->apiAdmissionsTransferPostAsyncWithHttpInfo($body) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiAdmissionsTransferPostAsyncWithHttpInfo - * - * Transfer admissions between customers - * - * @param \Yoast\MyYoastApiClient\Model\TransferAdmissionDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiAdmissionsTransferPostAsyncWithHttpInfo($body) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Admission[]'; - $request = $this->apiAdmissionsTransferPostRequest($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 'apiAdmissionsTransferPost' - * - * @param \Yoast\MyYoastApiClient\Model\TransferAdmissionDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiAdmissionsTransferPostRequest($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 apiAdmissionsTransferPost' - ); - } - - $resourcePath = '/api/Admissions/transfer'; - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 deleted file mode 100644 index ea7df3f..0000000 --- a/src/Api/AuthApi.php +++ /dev/null @@ -1,1471 +0,0 @@ -client = $client ?: new Client(); - $this->config = $config ?: new Configuration(); - $this->headerSelector = $selector ?: new HeaderSelector(); - } - - /** - * @return Configuration - */ - public function getConfig() - { - return $this->config; - } - - /** - * Operation apiCustomersLoginPost - * - * Log in a user on MyYoast. - * - * @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($body) - { - list($response) = $this->apiCustomersLoginPostWithHttpInfo($body); - return $response; - } - - /** - * Operation apiCustomersLoginPostWithHttpInfo - * - * Log in a user on MyYoast. - * - * @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($body) - { - $returnType = '\Yoast\MyYoastApiClient\Model\AccessToken'; - $request = $this->apiCustomersLoginPostRequest($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 201: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Yoast\MyYoastApiClient\Model\AccessToken', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiCustomersLoginPostAsync - * - * Log in a user on MyYoast. - * - * @param \Yoast\MyYoastApiClient\Model\LoginDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersLoginPostAsync($body) - { - return $this->apiCustomersLoginPostAsyncWithHttpInfo($body) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomersLoginPostAsyncWithHttpInfo - * - * Log in a user on MyYoast. - * - * @param \Yoast\MyYoastApiClient\Model\LoginDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersLoginPostAsyncWithHttpInfo($body) - { - $returnType = '\Yoast\MyYoastApiClient\Model\AccessToken'; - $request = $this->apiCustomersLoginPostRequest($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 'apiCustomersLoginPost' - * - * @param \Yoast\MyYoastApiClient\Model\LoginDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCustomersLoginPostRequest($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 apiCustomersLoginPost' - ); - } - - $resourcePath = '/api/Customers/login'; - $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); - } - } - - - $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 apiCustomersLoginUserPost - * - * @param \Yoast\MyYoastApiClient\Model\LoginUserDto $body body (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return object - */ - public function apiCustomersLoginUserPost($body) - { - list($response) = $this->apiCustomersLoginUserPostWithHttpInfo($body); - return $response; - } - - /** - * Operation apiCustomersLoginUserPostWithHttpInfo - * - * @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($body) - { - $returnType = 'object'; - $request = $this->apiCustomersLoginUserPostRequest($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(), - 'object', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiCustomersLoginUserPostAsync - * - * - * - * @param \Yoast\MyYoastApiClient\Model\LoginUserDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersLoginUserPostAsync($body) - { - return $this->apiCustomersLoginUserPostAsyncWithHttpInfo($body) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomersLoginUserPostAsyncWithHttpInfo - * - * - * - * @param \Yoast\MyYoastApiClient\Model\LoginUserDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersLoginUserPostAsyncWithHttpInfo($body) - { - $returnType = 'object'; - $request = $this->apiCustomersLoginUserPostRequest($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 'apiCustomersLoginUserPost' - * - * @param \Yoast\MyYoastApiClient\Model\LoginUserDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCustomersLoginUserPostRequest($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 apiCustomersLoginUserPost' - ); - } - - $resourcePath = '/api/Customers/login-user'; - $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); - } - } - - - $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 apiCustomersLogoutUserPost - * - * Logout the user on Yoast.com. - * - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return object - */ - public function apiCustomersLogoutUserPost() - { - list($response) = $this->apiCustomersLogoutUserPostWithHttpInfo(); - return $response; - } - - /** - * Operation apiCustomersLogoutUserPostWithHttpInfo - * - * Logout the user on Yoast.com. - * - * - * @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() - { - $returnType = 'object'; - $request = $this->apiCustomersLogoutUserPostRequest(); - - 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(), - 'object', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiCustomersLogoutUserPostAsync - * - * Logout the user on Yoast.com. - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersLogoutUserPostAsync() - { - return $this->apiCustomersLogoutUserPostAsyncWithHttpInfo() - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomersLogoutUserPostAsyncWithHttpInfo - * - * Logout the user on Yoast.com. - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersLogoutUserPostAsyncWithHttpInfo() - { - $returnType = 'object'; - $request = $this->apiCustomersLogoutUserPostRequest(); - - 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 'apiCustomersLogoutUserPost' - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCustomersLogoutUserPostRequest() - { - - $resourcePath = '/api/Customers/logout-user'; - $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); - } - } - - - $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 authYoastCallbackGet - * - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function authYoastCallbackGet() - { - $this->authYoastCallbackGetWithHttpInfo(); - } - - /** - * Operation authYoastCallbackGetWithHttpInfo - * - * - * @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 authYoastCallbackGetWithHttpInfo() - { - $returnType = ''; - $request = $this->authYoastCallbackGetRequest(); - - 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 authYoastCallbackGetAsync - * - * - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function authYoastCallbackGetAsync() - { - return $this->authYoastCallbackGetAsyncWithHttpInfo() - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation authYoastCallbackGetAsyncWithHttpInfo - * - * - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function authYoastCallbackGetAsyncWithHttpInfo() - { - $returnType = ''; - $request = $this->authYoastCallbackGetRequest(); - - 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 'authYoastCallbackGet' - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function authYoastCallbackGetRequest() - { - - $resourcePath = '/auth/yoast/callback'; - $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) { - $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); - } - } - - - $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 authYoastGet - * - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function authYoastGet() - { - $this->authYoastGetWithHttpInfo(); - } - - /** - * Operation authYoastGetWithHttpInfo - * - * - * @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() - { - $returnType = ''; - $request = $this->authYoastGetRequest(); - - 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 authYoastGetAsync - * - * - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function authYoastGetAsync() - { - return $this->authYoastGetAsyncWithHttpInfo() - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation authYoastGetAsyncWithHttpInfo - * - * - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function authYoastGetAsyncWithHttpInfo() - { - $returnType = ''; - $request = $this->authYoastGetRequest(); - - 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 'authYoastGet' - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function authYoastGetRequest() - { - - $resourcePath = '/auth/yoast'; - $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) { - $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); - } - } - - - $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 logoutGet - * - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function logoutGet() - { - $this->logoutGetWithHttpInfo(); - } - - /** - * Operation logoutGetWithHttpInfo - * - * - * @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() - { - $returnType = ''; - $request = $this->logoutGetRequest(); - - 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 logoutGetAsync - * - * - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function logoutGetAsync() - { - return $this->logoutGetAsyncWithHttpInfo() - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation logoutGetAsyncWithHttpInfo - * - * - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function logoutGetAsyncWithHttpInfo() - { - $returnType = ''; - $request = $this->logoutGetRequest(); - - 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 'logoutGet' - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function logoutGetRequest() - { - - $resourcePath = '/logout'; - $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) { - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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/BlacklistApi.php b/src/Api/BlacklistApi.php deleted file mode 100644 index 07a49a3..0000000 --- a/src/Api/BlacklistApi.php +++ /dev/null @@ -1,1150 +0,0 @@ -client = $client ?: new Client(); - $this->config = $config ?: new Configuration(); - $this->headerSelector = $selector ?: new HeaderSelector(); - } - - /** - * @return Configuration - */ - public function getConfig() - { - return $this->config; - } - - /** - * Operation apiBlacklistGet - * - * 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 apiBlacklistGet($filter = null) - { - list($response) = $this->apiBlacklistGetWithHttpInfo($filter); - return $response; - } - - /** - * Operation apiBlacklistGetWithHttpInfo - * - * 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 apiBlacklistGetWithHttpInfo($filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Blacklist[]'; - $request = $this->apiBlacklistGetRequest($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\Blacklist[]', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiBlacklistGetAsync - * - * Gets blacklisted sites - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiBlacklistGetAsync($filter = null) - { - return $this->apiBlacklistGetAsyncWithHttpInfo($filter) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiBlacklistGetAsyncWithHttpInfo - * - * Gets blacklisted sites - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiBlacklistGetAsyncWithHttpInfo($filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Blacklist[]'; - $request = $this->apiBlacklistGetRequest($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 'apiBlacklistGet' - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiBlacklistGetRequest($filter = null) - { - - $resourcePath = '/api/Blacklist'; - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiBlacklistIdDelete - * - * Remove a site from the blacklist - * - * @param string $id id (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return string - */ - public function apiBlacklistIdDelete($id) - { - list($response) = $this->apiBlacklistIdDeleteWithHttpInfo($id); - return $response; - } - - /** - * Operation apiBlacklistIdDeleteWithHttpInfo - * - * Remove a site from the blacklist - * - * @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 apiBlacklistIdDeleteWithHttpInfo($id) - { - $returnType = 'string'; - $request = $this->apiBlacklistIdDeleteRequest($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 apiBlacklistIdDeleteAsync - * - * Remove a site from the blacklist - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiBlacklistIdDeleteAsync($id) - { - return $this->apiBlacklistIdDeleteAsyncWithHttpInfo($id) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiBlacklistIdDeleteAsyncWithHttpInfo - * - * Remove a site from the blacklist - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiBlacklistIdDeleteAsyncWithHttpInfo($id) - { - $returnType = 'string'; - $request = $this->apiBlacklistIdDeleteRequest($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 'apiBlacklistIdDelete' - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiBlacklistIdDeleteRequest($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' - ); - } - - $resourcePath = '/api/Blacklist/{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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiBlacklistPagedGet - * - * 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 apiBlacklistPagedGet($filter = null) - { - list($response) = $this->apiBlacklistPagedGetWithHttpInfo($filter); - return $response; - } - - /** - * Operation apiBlacklistPagedGetWithHttpInfo - * - * 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 apiBlacklistPagedGetWithHttpInfo($filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Blacklist[]'; - $request = $this->apiBlacklistPagedGetRequest($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\Blacklist[]', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiBlacklistPagedGetAsync - * - * Gets blacklisted sites - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiBlacklistPagedGetAsync($filter = null) - { - return $this->apiBlacklistPagedGetAsyncWithHttpInfo($filter) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiBlacklistPagedGetAsyncWithHttpInfo - * - * Gets blacklisted sites - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiBlacklistPagedGetAsyncWithHttpInfo($filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Blacklist[]'; - $request = $this->apiBlacklistPagedGetRequest($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 'apiBlacklistPagedGet' - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiBlacklistPagedGetRequest($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) { - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiBlacklistPost - * - * Creates a blacklisted site - * - * @param \Yoast\MyYoastApiClient\Model\CreateBlacklistSiteDto $body body (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return string - */ - public function apiBlacklistPost($body) - { - list($response) = $this->apiBlacklistPostWithHttpInfo($body); - return $response; - } - - /** - * Operation apiBlacklistPostWithHttpInfo - * - * Creates a blacklisted site - * - * @param \Yoast\MyYoastApiClient\Model\CreateBlacklistSiteDto $body (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 apiBlacklistPostWithHttpInfo($body) - { - $returnType = 'string'; - $request = $this->apiBlacklistPostRequest($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(), - 'string', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiBlacklistPostAsync - * - * Creates a blacklisted site - * - * @param \Yoast\MyYoastApiClient\Model\CreateBlacklistSiteDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiBlacklistPostAsync($body) - { - return $this->apiBlacklistPostAsyncWithHttpInfo($body) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiBlacklistPostAsyncWithHttpInfo - * - * Creates a blacklisted site - * - * @param \Yoast\MyYoastApiClient\Model\CreateBlacklistSiteDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiBlacklistPostAsyncWithHttpInfo($body) - { - $returnType = 'string'; - $request = $this->apiBlacklistPostRequest($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 'apiBlacklistPost' - * - * @param \Yoast\MyYoastApiClient\Model\CreateBlacklistSiteDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiBlacklistPostRequest($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 apiBlacklistPost' - ); - } - - $resourcePath = '/api/Blacklist'; - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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/ChangelogApi.php b/src/Api/ChangelogApi.php deleted file mode 100644 index b121674..0000000 --- a/src/Api/ChangelogApi.php +++ /dev/null @@ -1,369 +0,0 @@ -client = $client ?: new Client(); - $this->config = $config ?: new Configuration(); - $this->headerSelector = $selector ?: new HeaderSelector(); - } - - /** - * @return Configuration - */ - public function getConfig() - { - return $this->config; - } - - /** - * Operation apiChangelogsPut - * - * Upsert a changelog - * - * @param \Yoast\MyYoastApiClient\Model\UpsertChangelogDto $body body (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\Changelog - */ - public function apiChangelogsPut($body) - { - list($response) = $this->apiChangelogsPutWithHttpInfo($body); - return $response; - } - - /** - * Operation apiChangelogsPutWithHttpInfo - * - * Upsert a changelog - * - * @param \Yoast\MyYoastApiClient\Model\UpsertChangelogDto $body (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of \Yoast\MyYoastApiClient\Model\Changelog, HTTP status code, HTTP response headers (array of strings) - */ - public function apiChangelogsPutWithHttpInfo($body) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Changelog'; - $request = $this->apiChangelogsPutRequest($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\Changelog', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiChangelogsPutAsync - * - * Upsert a changelog - * - * @param \Yoast\MyYoastApiClient\Model\UpsertChangelogDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiChangelogsPutAsync($body) - { - return $this->apiChangelogsPutAsyncWithHttpInfo($body) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiChangelogsPutAsyncWithHttpInfo - * - * Upsert a changelog - * - * @param \Yoast\MyYoastApiClient\Model\UpsertChangelogDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiChangelogsPutAsyncWithHttpInfo($body) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Changelog'; - $request = $this->apiChangelogsPutRequest($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 'apiChangelogsPut' - * - * @param \Yoast\MyYoastApiClient\Model\UpsertChangelogDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiChangelogsPutRequest($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 apiChangelogsPut' - ); - } - - $resourcePath = '/api/Changelogs'; - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 - ); - } - - /** - * 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/CloudflareApi.php b/src/Api/CloudflareApi.php deleted file mode 100644 index 586af26..0000000 --- a/src/Api/CloudflareApi.php +++ /dev/null @@ -1,631 +0,0 @@ -client = $client ?: new Client(); - $this->config = $config ?: new Configuration(); - $this->headerSelector = $selector ?: new HeaderSelector(); - } - - /** - * @return Configuration - */ - public function getConfig() - { - return $this->config; - } - - /** - * Operation apiCloudflareKvRegisteredDomainsPurgePost - * - * Purge kv pairs from the registered domains key value store in Cloudflare - * - * @param \Yoast\MyYoastApiClient\Model\PurgeKVRequestDto $body body (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return object[] - */ - public function apiCloudflareKvRegisteredDomainsPurgePost($body) - { - list($response) = $this->apiCloudflareKvRegisteredDomainsPurgePostWithHttpInfo($body); - return $response; - } - - /** - * Operation apiCloudflareKvRegisteredDomainsPurgePostWithHttpInfo - * - * Purge kv pairs from the registered domains key value store in Cloudflare - * - * @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($body) - { - $returnType = 'object[]'; - $request = $this->apiCloudflareKvRegisteredDomainsPurgePostRequest($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(), - 'object[]', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiCloudflareKvRegisteredDomainsPurgePostAsync - * - * Purge kv pairs from the registered domains key value store in Cloudflare - * - * @param \Yoast\MyYoastApiClient\Model\PurgeKVRequestDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCloudflareKvRegisteredDomainsPurgePostAsync($body) - { - return $this->apiCloudflareKvRegisteredDomainsPurgePostAsyncWithHttpInfo($body) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCloudflareKvRegisteredDomainsPurgePostAsyncWithHttpInfo - * - * Purge kv pairs from the registered domains key value store in Cloudflare - * - * @param \Yoast\MyYoastApiClient\Model\PurgeKVRequestDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCloudflareKvRegisteredDomainsPurgePostAsyncWithHttpInfo($body) - { - $returnType = 'object[]'; - $request = $this->apiCloudflareKvRegisteredDomainsPurgePostRequest($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 'apiCloudflareKvRegisteredDomainsPurgePost' - * - * @param \Yoast\MyYoastApiClient\Model\PurgeKVRequestDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCloudflareKvRegisteredDomainsPurgePostRequest($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 apiCloudflareKvRegisteredDomainsPurgePost' - ); - } - - $resourcePath = '/api/cloudflare/kv/registered-domains/purge'; - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiCloudflareKvRegisteredDomainsUpdateAllPost - * - * Update sites in the registered domains key value store in Cloudflare - * - * @param \Yoast\MyYoastApiClient\Model\UpdateAllKVRequestDto $body body (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return object - */ - public function apiCloudflareKvRegisteredDomainsUpdateAllPost($body) - { - list($response) = $this->apiCloudflareKvRegisteredDomainsUpdateAllPostWithHttpInfo($body); - return $response; - } - - /** - * Operation apiCloudflareKvRegisteredDomainsUpdateAllPostWithHttpInfo - * - * Update sites in the registered domains key value store in Cloudflare - * - * @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($body) - { - $returnType = 'object'; - $request = $this->apiCloudflareKvRegisteredDomainsUpdateAllPostRequest($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(), - 'object', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiCloudflareKvRegisteredDomainsUpdateAllPostAsync - * - * Update sites in the registered domains key value store in Cloudflare - * - * @param \Yoast\MyYoastApiClient\Model\UpdateAllKVRequestDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCloudflareKvRegisteredDomainsUpdateAllPostAsync($body) - { - return $this->apiCloudflareKvRegisteredDomainsUpdateAllPostAsyncWithHttpInfo($body) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCloudflareKvRegisteredDomainsUpdateAllPostAsyncWithHttpInfo - * - * Update sites in the registered domains key value store in Cloudflare - * - * @param \Yoast\MyYoastApiClient\Model\UpdateAllKVRequestDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCloudflareKvRegisteredDomainsUpdateAllPostAsyncWithHttpInfo($body) - { - $returnType = 'object'; - $request = $this->apiCloudflareKvRegisteredDomainsUpdateAllPostRequest($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 'apiCloudflareKvRegisteredDomainsUpdateAllPost' - * - * @param \Yoast\MyYoastApiClient\Model\UpdateAllKVRequestDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCloudflareKvRegisteredDomainsUpdateAllPostRequest($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 apiCloudflareKvRegisteredDomainsUpdateAllPost' - ); - } - - $resourcePath = '/api/cloudflare/kv/registered-domains/update-all'; - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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/ComposerTokenApi.php b/src/Api/ComposerTokenApi.php deleted file mode 100644 index 0be028f..0000000 --- a/src/Api/ComposerTokenApi.php +++ /dev/null @@ -1,917 +0,0 @@ -client = $client ?: new Client(); - $this->config = $config ?: new Configuration(); - $this->headerSelector = $selector ?: new HeaderSelector(); - } - - /** - * @return Configuration - */ - public function getConfig() - { - return $this->config; - } - - /** - * Operation apiComposerTokensGeneratePost - * - * Generates a Composer token - * - * @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 apiComposerTokensGeneratePost($body) - { - list($response) = $this->apiComposerTokensGeneratePostWithHttpInfo($body); - return $response; - } - - /** - * Operation apiComposerTokensGeneratePostWithHttpInfo - * - * Generates a Composer token - * - * @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 apiComposerTokensGeneratePostWithHttpInfo($body) - { - $returnType = '\Yoast\MyYoastApiClient\Model\ComposerToken'; - $request = $this->apiComposerTokensGeneratePostRequest($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 201: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\Yoast\MyYoastApiClient\Model\ComposerToken', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiComposerTokensGeneratePostAsync - * - * Generates a Composer token - * - * @param \Yoast\MyYoastApiClient\Model\GenerateDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiComposerTokensGeneratePostAsync($body) - { - return $this->apiComposerTokensGeneratePostAsyncWithHttpInfo($body) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiComposerTokensGeneratePostAsyncWithHttpInfo - * - * Generates a Composer token - * - * @param \Yoast\MyYoastApiClient\Model\GenerateDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiComposerTokensGeneratePostAsyncWithHttpInfo($body) - { - $returnType = '\Yoast\MyYoastApiClient\Model\ComposerToken'; - $request = $this->apiComposerTokensGeneratePostRequest($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 'apiComposerTokensGeneratePost' - * - * @param \Yoast\MyYoastApiClient\Model\GenerateDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiComposerTokensGeneratePostRequest($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 apiComposerTokensGeneratePost' - ); - } - - $resourcePath = '/api/ComposerTokens/generate'; - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiComposerTokensIdDeletePost - * - * Disable a composer token - * - * @param string $id id (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\ComposerToken - */ - public function apiComposerTokensIdDeletePost($id) - { - list($response) = $this->apiComposerTokensIdDeletePostWithHttpInfo($id); - return $response; - } - - /** - * Operation apiComposerTokensIdDeletePostWithHttpInfo - * - * Disable a composer token - * - * @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 apiComposerTokensIdDeletePostWithHttpInfo($id) - { - $returnType = '\Yoast\MyYoastApiClient\Model\ComposerToken'; - $request = $this->apiComposerTokensIdDeletePostRequest($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\ComposerToken', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiComposerTokensIdDeletePostAsync - * - * Disable a composer token - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiComposerTokensIdDeletePostAsync($id) - { - return $this->apiComposerTokensIdDeletePostAsyncWithHttpInfo($id) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiComposerTokensIdDeletePostAsyncWithHttpInfo - * - * Disable a composer token - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiComposerTokensIdDeletePostAsyncWithHttpInfo($id) - { - $returnType = '\Yoast\MyYoastApiClient\Model\ComposerToken'; - $request = $this->apiComposerTokensIdDeletePostRequest($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 'apiComposerTokensIdDeletePost' - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiComposerTokensIdDeletePostRequest($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 apiComposerTokensIdDeletePost' - ); - } - - $resourcePath = '/api/ComposerTokens/{id}/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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiComposerTokensIdRenamePost - * - * Renames a Composer token - * - * @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($body, $id) - { - list($response) = $this->apiComposerTokensIdRenamePostWithHttpInfo($body, $id); - return $response; - } - - /** - * Operation apiComposerTokensIdRenamePostWithHttpInfo - * - * Renames a Composer token - * - * @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($body, $id) - { - $returnType = '\Yoast\MyYoastApiClient\Model\ComposerToken'; - $request = $this->apiComposerTokensIdRenamePostRequest($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\ComposerToken', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiComposerTokensIdRenamePostAsync - * - * Renames a Composer token - * - * @param \Yoast\MyYoastApiClient\Model\RenameBodyDto $body (required) - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiComposerTokensIdRenamePostAsync($body, $id) - { - return $this->apiComposerTokensIdRenamePostAsyncWithHttpInfo($body, $id) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiComposerTokensIdRenamePostAsyncWithHttpInfo - * - * Renames a Composer token - * - * @param \Yoast\MyYoastApiClient\Model\RenameBodyDto $body (required) - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiComposerTokensIdRenamePostAsyncWithHttpInfo($body, $id) - { - $returnType = '\Yoast\MyYoastApiClient\Model\ComposerToken'; - $request = $this->apiComposerTokensIdRenamePostRequest($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 'apiComposerTokensIdRenamePost' - * - * @param \Yoast\MyYoastApiClient\Model\RenameBodyDto $body (required) - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiComposerTokensIdRenamePostRequest($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 apiComposerTokensIdRenamePost' - ); - } - // 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' - ); - } - - $resourcePath = '/api/ComposerTokens/{id}/rename'; - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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/CourseApi.php b/src/Api/CourseApi.php deleted file mode 100644 index 79a9524..0000000 --- a/src/Api/CourseApi.php +++ /dev/null @@ -1,852 +0,0 @@ -client = $client ?: new Client(); - $this->config = $config ?: new Configuration(); - $this->headerSelector = $selector ?: new HeaderSelector(); - } - - /** - * @return Configuration - */ - public function getConfig() - { - return $this->config; - } - - /** - * Operation apiCoursesFromAcademyPut - * - * Upserts a course - * - * @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($body) - { - list($response) = $this->apiCoursesFromAcademyPutWithHttpInfo($body); - return $response; - } - - /** - * Operation apiCoursesFromAcademyPutWithHttpInfo - * - * Upserts a course - * - * @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($body) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Course'; - $request = $this->apiCoursesFromAcademyPutRequest($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\Course', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiCoursesFromAcademyPutAsync - * - * Upserts a course - * - * @param \Yoast\MyYoastApiClient\Model\FromAcademyDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCoursesFromAcademyPutAsync($body) - { - return $this->apiCoursesFromAcademyPutAsyncWithHttpInfo($body) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCoursesFromAcademyPutAsyncWithHttpInfo - * - * Upserts a course - * - * @param \Yoast\MyYoastApiClient\Model\FromAcademyDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCoursesFromAcademyPutAsyncWithHttpInfo($body) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Course'; - $request = $this->apiCoursesFromAcademyPutRequest($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 'apiCoursesFromAcademyPut' - * - * @param \Yoast\MyYoastApiClient\Model\FromAcademyDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCoursesFromAcademyPutRequest($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 apiCoursesFromAcademyPut' - ); - } - - $resourcePath = '/api/Courses/fromAcademy'; - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiCoursesGet - * - * Get courses - * - * @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) - { - list($response) = $this->apiCoursesGetWithHttpInfo($filter); - return $response; - } - - /** - * Operation apiCoursesGetWithHttpInfo - * - * Get courses - * - * @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) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Course[]'; - $request = $this->apiCoursesGetRequest($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\Course[]', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiCoursesGetAsync - * - * Get courses - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCoursesGetAsync($filter = null) - { - return $this->apiCoursesGetAsyncWithHttpInfo($filter) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCoursesGetAsyncWithHttpInfo - * - * Get courses - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCoursesGetAsyncWithHttpInfo($filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Course[]'; - $request = $this->apiCoursesGetRequest($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 'apiCoursesGet' - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCoursesGetRequest($filter = null) - { - - $resourcePath = '/api/Courses'; - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiCoursesIdGet - * - * @param string $id id (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function apiCoursesIdGet($id) - { - $this->apiCoursesIdGetWithHttpInfo($id); - } - - /** - * Operation apiCoursesIdGetWithHttpInfo - * - * @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 apiCoursesIdGetWithHttpInfo($id) - { - $returnType = ''; - $request = $this->apiCoursesIdGetRequest($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() - ); - } - - return [null, $statusCode, $response->getHeaders()]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - } - throw $e; - } - } - - /** - * Operation apiCoursesIdGetAsync - * - * - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCoursesIdGetAsync($id) - { - return $this->apiCoursesIdGetAsyncWithHttpInfo($id) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCoursesIdGetAsyncWithHttpInfo - * - * - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCoursesIdGetAsyncWithHttpInfo($id) - { - $returnType = ''; - $request = $this->apiCoursesIdGetRequest($id); - - 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 'apiCoursesIdGet' - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCoursesIdGetRequest($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' - ); - } - - $resourcePath = '/api/Courses/{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( - [] - ); - } 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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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/CourseEnrollmentApi.php b/src/Api/CourseEnrollmentApi.php deleted file mode 100644 index a11db48..0000000 --- a/src/Api/CourseEnrollmentApi.php +++ /dev/null @@ -1,2168 +0,0 @@ -client = $client ?: new Client(); - $this->config = $config ?: new Configuration(); - $this->headerSelector = $selector ?: new HeaderSelector(); - } - - /** - * @return Configuration - */ - public function getConfig() - { - return $this->config; - } - - /** - * Operation apiCourseEnrollmentsBulkInvitePost - * - * Bulk invite for Course Enrollment. - * - * @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($body) - { - list($response) = $this->apiCourseEnrollmentsBulkInvitePostWithHttpInfo($body); - return $response; - } - - /** - * Operation apiCourseEnrollmentsBulkInvitePostWithHttpInfo - * - * Bulk invite for Course Enrollment. - * - * @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($body) - { - $returnType = '\Yoast\MyYoastApiClient\Model\CourseEnrollment[]'; - $request = $this->apiCourseEnrollmentsBulkInvitePostRequest($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\CourseEnrollment[]', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiCourseEnrollmentsBulkInvitePostAsync - * - * Bulk invite for Course Enrollment. - * - * @param \Yoast\MyYoastApiClient\Model\BulkInviteDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCourseEnrollmentsBulkInvitePostAsync($body) - { - return $this->apiCourseEnrollmentsBulkInvitePostAsyncWithHttpInfo($body) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCourseEnrollmentsBulkInvitePostAsyncWithHttpInfo - * - * Bulk invite for Course Enrollment. - * - * @param \Yoast\MyYoastApiClient\Model\BulkInviteDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCourseEnrollmentsBulkInvitePostAsyncWithHttpInfo($body) - { - $returnType = '\Yoast\MyYoastApiClient\Model\CourseEnrollment[]'; - $request = $this->apiCourseEnrollmentsBulkInvitePostRequest($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 'apiCourseEnrollmentsBulkInvitePost' - * - * @param \Yoast\MyYoastApiClient\Model\BulkInviteDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCourseEnrollmentsBulkInvitePostRequest($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 apiCourseEnrollmentsBulkInvitePost' - ); - } - - $resourcePath = '/api/CourseEnrollments/bulkInvite'; - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiCourseEnrollmentsFromAcademyPut - * - * Update a CourseEnrollment - * - * @param \Yoast\MyYoastApiClient\Model\CourseEnrollmentFromAcademyDto $body body (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function apiCourseEnrollmentsFromAcademyPut($body) - { - $this->apiCourseEnrollmentsFromAcademyPutWithHttpInfo($body); - } - - /** - * Operation apiCourseEnrollmentsFromAcademyPutWithHttpInfo - * - * Update a CourseEnrollment - * - * @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($body) - { - $returnType = ''; - $request = $this->apiCourseEnrollmentsFromAcademyPutRequest($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() - ); - } - - return [null, $statusCode, $response->getHeaders()]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - } - throw $e; - } - } - - /** - * Operation apiCourseEnrollmentsFromAcademyPutAsync - * - * Update a CourseEnrollment - * - * @param \Yoast\MyYoastApiClient\Model\CourseEnrollmentFromAcademyDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCourseEnrollmentsFromAcademyPutAsync($body) - { - return $this->apiCourseEnrollmentsFromAcademyPutAsyncWithHttpInfo($body) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCourseEnrollmentsFromAcademyPutAsyncWithHttpInfo - * - * Update a CourseEnrollment - * - * @param \Yoast\MyYoastApiClient\Model\CourseEnrollmentFromAcademyDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCourseEnrollmentsFromAcademyPutAsyncWithHttpInfo($body) - { - $returnType = ''; - $request = $this->apiCourseEnrollmentsFromAcademyPutRequest($body); - - 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 'apiCourseEnrollmentsFromAcademyPut' - * - * @param \Yoast\MyYoastApiClient\Model\CourseEnrollmentFromAcademyDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCourseEnrollmentsFromAcademyPutRequest($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 apiCourseEnrollmentsFromAcademyPut' - ); - } - - $resourcePath = '/api/CourseEnrollments/fromAcademy'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - - // body params - $_tempBody = null; - if (isset($body)) { - $_tempBody = $body; - } - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); - } 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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiCourseEnrollmentsGet - * - * Get course enrollments - * - * @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 apiCourseEnrollmentsGet($filter = null) - { - list($response) = $this->apiCourseEnrollmentsGetWithHttpInfo($filter); - return $response; - } - - /** - * Operation apiCourseEnrollmentsGetWithHttpInfo - * - * Get course enrollments - * - * @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 apiCourseEnrollmentsGetWithHttpInfo($filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\CourseEnrollment[]'; - $request = $this->apiCourseEnrollmentsGetRequest($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\CourseEnrollment[]', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiCourseEnrollmentsGetAsync - * - * Get course enrollments - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCourseEnrollmentsGetAsync($filter = null) - { - return $this->apiCourseEnrollmentsGetAsyncWithHttpInfo($filter) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCourseEnrollmentsGetAsyncWithHttpInfo - * - * Get course enrollments - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCourseEnrollmentsGetAsyncWithHttpInfo($filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\CourseEnrollment[]'; - $request = $this->apiCourseEnrollmentsGetRequest($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 'apiCourseEnrollmentsGet' - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCourseEnrollmentsGetRequest($filter = null) - { - - $resourcePath = '/api/CourseEnrollments'; - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiCourseEnrollmentsGetLegacyExpiringGet - * - * Get legacy course enrollments that expire between two given dates - * - * @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 apiCourseEnrollmentsGetLegacyExpiringGet($from, $until) - { - list($response) = $this->apiCourseEnrollmentsGetLegacyExpiringGetWithHttpInfo($from, $until); - return $response; - } - - /** - * Operation apiCourseEnrollmentsGetLegacyExpiringGetWithHttpInfo - * - * Get legacy course enrollments that expire between two given dates - * - * @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 apiCourseEnrollmentsGetLegacyExpiringGetWithHttpInfo($from, $until) - { - $returnType = '\Yoast\MyYoastApiClient\Model\CourseEnrollment[]'; - $request = $this->apiCourseEnrollmentsGetLegacyExpiringGetRequest($from, $until); - - 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\CourseEnrollment[]', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiCourseEnrollmentsGetLegacyExpiringGetAsync - * - * Get legacy course enrollments that expire between two given dates - * - * @param \DateTime $from (required) - * @param \DateTime $until (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCourseEnrollmentsGetLegacyExpiringGetAsync($from, $until) - { - return $this->apiCourseEnrollmentsGetLegacyExpiringGetAsyncWithHttpInfo($from, $until) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCourseEnrollmentsGetLegacyExpiringGetAsyncWithHttpInfo - * - * Get legacy course enrollments that expire between two given dates - * - * @param \DateTime $from (required) - * @param \DateTime $until (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCourseEnrollmentsGetLegacyExpiringGetAsyncWithHttpInfo($from, $until) - { - $returnType = '\Yoast\MyYoastApiClient\Model\CourseEnrollment[]'; - $request = $this->apiCourseEnrollmentsGetLegacyExpiringGetRequest($from, $until); - - 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 'apiCourseEnrollmentsGetLegacyExpiringGet' - * - * @param \DateTime $from (required) - * @param \DateTime $until (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCourseEnrollmentsGetLegacyExpiringGetRequest($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 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'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - // query params - if ($from !== null) { - $queryParams['from'] = ObjectSerializer::toQueryValue($from, 'date-time'); - } - // query params - if ($until !== null) { - $queryParams['until'] = ObjectSerializer::toQueryValue($until, 'date-time'); - } - - - // 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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiCourseEnrollmentsIdGet - * - * Get a course enrollment - * - * @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 - */ - public function apiCourseEnrollmentsIdGet($id, $filter = null) - { - list($response) = $this->apiCourseEnrollmentsIdGetWithHttpInfo($id, $filter); - return $response; - } - - /** - * Operation apiCourseEnrollmentsIdGetWithHttpInfo - * - * Get a course enrollment - * - * @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) - */ - public function apiCourseEnrollmentsIdGetWithHttpInfo($id, $filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\CourseEnrollment'; - $request = $this->apiCourseEnrollmentsIdGetRequest($id, $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\CourseEnrollment', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiCourseEnrollmentsIdGetAsync - * - * Get a course enrollment - * - * @param string $id (required) - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCourseEnrollmentsIdGetAsync($id, $filter = null) - { - return $this->apiCourseEnrollmentsIdGetAsyncWithHttpInfo($id, $filter) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCourseEnrollmentsIdGetAsyncWithHttpInfo - * - * Get a course enrollment - * - * @param string $id (required) - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCourseEnrollmentsIdGetAsyncWithHttpInfo($id, $filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\CourseEnrollment'; - $request = $this->apiCourseEnrollmentsIdGetRequest($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 'apiCourseEnrollmentsIdGet' - * - * @param string $id (required) - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCourseEnrollmentsIdGetRequest($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' - ); - } - - $resourcePath = '/api/CourseEnrollments/{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 ($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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiCourseEnrollmentsIdInvitePost - * - * Invite a customer - * - * @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($body, $id) - { - list($response) = $this->apiCourseEnrollmentsIdInvitePostWithHttpInfo($body, $id); - return $response; - } - - /** - * Operation apiCourseEnrollmentsIdInvitePostWithHttpInfo - * - * Invite a customer - * - * @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($body, $id) - { - $returnType = '\Yoast\MyYoastApiClient\Model\CourseEnrollment'; - $request = $this->apiCourseEnrollmentsIdInvitePostRequest($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\CourseEnrollment', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiCourseEnrollmentsIdInvitePostAsync - * - * Invite a customer - * - * @param \Yoast\MyYoastApiClient\Model\InviteDto $body (required) - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCourseEnrollmentsIdInvitePostAsync($body, $id) - { - return $this->apiCourseEnrollmentsIdInvitePostAsyncWithHttpInfo($body, $id) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCourseEnrollmentsIdInvitePostAsyncWithHttpInfo - * - * Invite a customer - * - * @param \Yoast\MyYoastApiClient\Model\InviteDto $body (required) - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCourseEnrollmentsIdInvitePostAsyncWithHttpInfo($body, $id) - { - $returnType = '\Yoast\MyYoastApiClient\Model\CourseEnrollment'; - $request = $this->apiCourseEnrollmentsIdInvitePostRequest($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 'apiCourseEnrollmentsIdInvitePost' - * - * @param \Yoast\MyYoastApiClient\Model\InviteDto $body (required) - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCourseEnrollmentsIdInvitePostRequest($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 apiCourseEnrollmentsIdInvitePost' - ); - } - // 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' - ); - } - - $resourcePath = '/api/CourseEnrollments/{id}/invite'; - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiCourseEnrollmentsPagedGet - * - * 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 apiCourseEnrollmentsPagedGet($filter = null) - { - $this->apiCourseEnrollmentsPagedGetWithHttpInfo($filter); - } - - /** - * Operation apiCourseEnrollmentsPagedGetWithHttpInfo - * - * 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 apiCourseEnrollmentsPagedGetWithHttpInfo($filter = null) - { - $returnType = ''; - $request = $this->apiCourseEnrollmentsPagedGetRequest($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 apiCourseEnrollmentsPagedGetAsync - * - * Get customers - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCourseEnrollmentsPagedGetAsync($filter = null) - { - return $this->apiCourseEnrollmentsPagedGetAsyncWithHttpInfo($filter) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCourseEnrollmentsPagedGetAsyncWithHttpInfo - * - * Get customers - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCourseEnrollmentsPagedGetAsyncWithHttpInfo($filter = null) - { - $returnType = ''; - $request = $this->apiCourseEnrollmentsPagedGetRequest($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 'apiCourseEnrollmentsPagedGet' - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCourseEnrollmentsPagedGetRequest($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) { - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiCourseEnrollmentsTransferPost - * - * Transfer course enrollments - * - * @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($body) - { - list($response) = $this->apiCourseEnrollmentsTransferPostWithHttpInfo($body); - return $response; - } - - /** - * Operation apiCourseEnrollmentsTransferPostWithHttpInfo - * - * Transfer course enrollments - * - * @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($body) - { - $returnType = '\Yoast\MyYoastApiClient\Model\CourseEnrollment[]'; - $request = $this->apiCourseEnrollmentsTransferPostRequest($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\CourseEnrollment[]', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiCourseEnrollmentsTransferPostAsync - * - * Transfer course enrollments - * - * @param \Yoast\MyYoastApiClient\Model\TransferDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCourseEnrollmentsTransferPostAsync($body) - { - return $this->apiCourseEnrollmentsTransferPostAsyncWithHttpInfo($body) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCourseEnrollmentsTransferPostAsyncWithHttpInfo - * - * Transfer course enrollments - * - * @param \Yoast\MyYoastApiClient\Model\TransferDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCourseEnrollmentsTransferPostAsyncWithHttpInfo($body) - { - $returnType = '\Yoast\MyYoastApiClient\Model\CourseEnrollment[]'; - $request = $this->apiCourseEnrollmentsTransferPostRequest($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 'apiCourseEnrollmentsTransferPost' - * - * @param \Yoast\MyYoastApiClient\Model\TransferDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCourseEnrollmentsTransferPostRequest($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 apiCourseEnrollmentsTransferPost' - ); - } - - $resourcePath = '/api/CourseEnrollments/transfer'; - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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/CustomerApi.php b/src/Api/CustomerApi.php deleted file mode 100644 index 2076be8..0000000 --- a/src/Api/CustomerApi.php +++ /dev/null @@ -1,12144 +0,0 @@ -client = $client ?: new Client(); - $this->config = $config ?: new Configuration(); - $this->headerSelector = $selector ?: new HeaderSelector(); - } - - /** - * @return Configuration - */ - public function getConfig() - { - return $this->config; - } - - /** - * Operation apiCustomersAcademyCourseAccessListSourceIdGet - * - * Academy Course access - * - * @param int $sourceId The WordPress User ID to retrieve the course IDs for. (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\AcademyCourseAccessListDto - */ - public function apiCustomersAcademyCourseAccessListSourceIdGet($sourceId) - { - list($response) = $this->apiCustomersAcademyCourseAccessListSourceIdGetWithHttpInfo($sourceId); - return $response; - } - - /** - * Operation apiCustomersAcademyCourseAccessListSourceIdGetWithHttpInfo - * - * Academy Course access - * - * @param int $sourceId The WordPress User ID to retrieve the course IDs for. (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of \Yoast\MyYoastApiClient\Model\AcademyCourseAccessListDto, HTTP status code, HTTP response headers (array of strings) - */ - public function apiCustomersAcademyCourseAccessListSourceIdGetWithHttpInfo($sourceId) - { - $returnType = '\Yoast\MyYoastApiClient\Model\AcademyCourseAccessListDto'; - $request = $this->apiCustomersAcademyCourseAccessListSourceIdGetRequest($sourceId); - - 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\AcademyCourseAccessListDto', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiCustomersAcademyCourseAccessListSourceIdGetAsync - * - * Academy Course access - * - * @param int $sourceId The WordPress User ID to retrieve the course IDs for. (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersAcademyCourseAccessListSourceIdGetAsync($sourceId) - { - return $this->apiCustomersAcademyCourseAccessListSourceIdGetAsyncWithHttpInfo($sourceId) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomersAcademyCourseAccessListSourceIdGetAsyncWithHttpInfo - * - * Academy Course access - * - * @param int $sourceId The WordPress User ID to retrieve the course IDs for. (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersAcademyCourseAccessListSourceIdGetAsyncWithHttpInfo($sourceId) - { - $returnType = '\Yoast\MyYoastApiClient\Model\AcademyCourseAccessListDto'; - $request = $this->apiCustomersAcademyCourseAccessListSourceIdGetRequest($sourceId); - - 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 'apiCustomersAcademyCourseAccessListSourceIdGet' - * - * @param int $sourceId The WordPress User ID to retrieve the course IDs for. (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCustomersAcademyCourseAccessListSourceIdGetRequest($sourceId) - { - // verify the required parameter 'sourceId' is set - if ($sourceId === null || (is_array($sourceId) && count($sourceId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $sourceId when calling apiCustomersAcademyCourseAccessListSourceIdGet' - ); - } - - $resourcePath = '/api/Customers/academyCourseAccessList/{sourceId}'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - // path params - if ($sourceId !== null) { - $resourcePath = str_replace( - '{' . 'sourceId' . '}', - ObjectSerializer::toPathValue($sourceId), - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiCustomersActivatePost - * - * 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 apiCustomersActivatePost($body) - { - list($response) = $this->apiCustomersActivatePostWithHttpInfo($body); - return $response; - } - - /** - * Operation apiCustomersActivatePostWithHttpInfo - * - * 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 apiCustomersActivatePostWithHttpInfo($body) - { - $returnType = 'object'; - $request = $this->apiCustomersActivatePostRequest($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(), - 'object', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiCustomersActivatePostAsync - * - * Activate the account of a user - * - * @param \Yoast\MyYoastApiClient\Model\ActivateAccountDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersActivatePostAsync($body) - { - return $this->apiCustomersActivatePostAsyncWithHttpInfo($body) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomersActivatePostAsyncWithHttpInfo - * - * Activate the account of a user - * - * @param \Yoast\MyYoastApiClient\Model\ActivateAccountDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersActivatePostAsyncWithHttpInfo($body) - { - $returnType = 'object'; - $request = $this->apiCustomersActivatePostRequest($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 'apiCustomersActivatePost' - * - * @param \Yoast\MyYoastApiClient\Model\ActivateAccountDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCustomersActivatePostRequest($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 apiCustomersActivatePost' - ); - } - - $resourcePath = '/api/Customers/activate'; - $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); - } - } - - - $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 apiCustomersAllrolesGet - * - * Get all existing roles with their ID. - * - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return object - */ - public function apiCustomersAllrolesGet() - { - list($response) = $this->apiCustomersAllrolesGetWithHttpInfo(); - return $response; - } - - /** - * Operation apiCustomersAllrolesGetWithHttpInfo - * - * Get all existing roles with their ID. - * - * - * @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() - { - $returnType = 'object'; - $request = $this->apiCustomersAllrolesGetRequest(); - - 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(), - 'object', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiCustomersAllrolesGetAsync - * - * Get all existing roles with their ID. - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersAllrolesGetAsync() - { - return $this->apiCustomersAllrolesGetAsyncWithHttpInfo() - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomersAllrolesGetAsyncWithHttpInfo - * - * Get all existing roles with their ID. - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersAllrolesGetAsyncWithHttpInfo() - { - $returnType = 'object'; - $request = $this->apiCustomersAllrolesGetRequest(); - - 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 'apiCustomersAllrolesGet' - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCustomersAllrolesGetRequest() - { - - $resourcePath = '/api/Customers/allroles'; - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiCustomersCreateAccountPost - * - * Creates an account for a customer on yoast.com without the signup flow. - * - * @param \Yoast\MyYoastApiClient\Model\CreateAccountDto $body body (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return object - */ - public function apiCustomersCreateAccountPost($body) - { - list($response) = $this->apiCustomersCreateAccountPostWithHttpInfo($body); - return $response; - } - - /** - * Operation apiCustomersCreateAccountPostWithHttpInfo - * - * Creates an account for a customer on yoast.com without the signup flow. - * - * @param \Yoast\MyYoastApiClient\Model\CreateAccountDto $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 apiCustomersCreateAccountPostWithHttpInfo($body) - { - $returnType = 'object'; - $request = $this->apiCustomersCreateAccountPostRequest($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(), - 'object', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiCustomersCreateAccountPostAsync - * - * Creates an account for a customer on yoast.com without the signup flow. - * - * @param \Yoast\MyYoastApiClient\Model\CreateAccountDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersCreateAccountPostAsync($body) - { - return $this->apiCustomersCreateAccountPostAsyncWithHttpInfo($body) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomersCreateAccountPostAsyncWithHttpInfo - * - * Creates an account for a customer on yoast.com without the signup flow. - * - * @param \Yoast\MyYoastApiClient\Model\CreateAccountDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersCreateAccountPostAsyncWithHttpInfo($body) - { - $returnType = 'object'; - $request = $this->apiCustomersCreateAccountPostRequest($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 'apiCustomersCreateAccountPost' - * - * @param \Yoast\MyYoastApiClient\Model\CreateAccountDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCustomersCreateAccountPostRequest($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 apiCustomersCreateAccountPost' - ); - } - - $resourcePath = '/api/Customers/create-account'; - $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); - } - } - - - $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 apiCustomersCurrentGet - * - * Get the current customer - * - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\Customer - */ - public function apiCustomersCurrentGet() - { - list($response) = $this->apiCustomersCurrentGetWithHttpInfo(); - return $response; - } - - /** - * Operation apiCustomersCurrentGetWithHttpInfo - * - * Get the current customer - * - * - * @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() - { - $returnType = '\Yoast\MyYoastApiClient\Model\Customer'; - $request = $this->apiCustomersCurrentGetRequest(); - - 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 apiCustomersCurrentGetAsync - * - * Get the current customer - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersCurrentGetAsync() - { - return $this->apiCustomersCurrentGetAsyncWithHttpInfo() - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomersCurrentGetAsyncWithHttpInfo - * - * Get the current customer - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersCurrentGetAsyncWithHttpInfo() - { - $returnType = '\Yoast\MyYoastApiClient\Model\Customer'; - $request = $this->apiCustomersCurrentGetRequest(); - - 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 'apiCustomersCurrentGet' - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCustomersCurrentGetRequest() - { - - $resourcePath = '/api/Customers/current'; - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiCustomersCustomerIdBuyerCourseEnrollmentsGet - * - * Find Course Enrollments that a customer is buyer of - * - * @param string $customerId customerId (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\CourseEnrollment[] - */ - public function apiCustomersCustomerIdBuyerCourseEnrollmentsGet($customerId) - { - list($response) = $this->apiCustomersCustomerIdBuyerCourseEnrollmentsGetWithHttpInfo($customerId); - return $response; - } - - /** - * Operation apiCustomersCustomerIdBuyerCourseEnrollmentsGetWithHttpInfo - * - * Find Course Enrollments that a customer is buyer of - * - * @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) - */ - public function apiCustomersCustomerIdBuyerCourseEnrollmentsGetWithHttpInfo($customerId) - { - $returnType = '\Yoast\MyYoastApiClient\Model\CourseEnrollment[]'; - $request = $this->apiCustomersCustomerIdBuyerCourseEnrollmentsGetRequest($customerId); - - 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\CourseEnrollment[]', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiCustomersCustomerIdBuyerCourseEnrollmentsGetAsync - * - * Find Course Enrollments that a customer is buyer of - * - * @param string $customerId (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersCustomerIdBuyerCourseEnrollmentsGetAsync($customerId) - { - return $this->apiCustomersCustomerIdBuyerCourseEnrollmentsGetAsyncWithHttpInfo($customerId) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomersCustomerIdBuyerCourseEnrollmentsGetAsyncWithHttpInfo - * - * Find Course Enrollments that a customer is buyer of - * - * @param string $customerId (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersCustomerIdBuyerCourseEnrollmentsGetAsyncWithHttpInfo($customerId) - { - $returnType = '\Yoast\MyYoastApiClient\Model\CourseEnrollment[]'; - $request = $this->apiCustomersCustomerIdBuyerCourseEnrollmentsGetRequest($customerId); - - 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 'apiCustomersCustomerIdBuyerCourseEnrollmentsGet' - * - * @param string $customerId (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCustomersCustomerIdBuyerCourseEnrollmentsGetRequest($customerId) - { - // 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'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - // path params - if ($customerId !== null) { - $resourcePath = str_replace( - '{' . 'customerId' . '}', - ObjectSerializer::toPathValue($customerId), - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiCustomersCustomerIdComposerTokensGet - * - * Get composer tokens - * - * @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\ComposerToken[] - */ - public function apiCustomersCustomerIdComposerTokensGet($customerId, $filter = null) - { - list($response) = $this->apiCustomersCustomerIdComposerTokensGetWithHttpInfo($customerId, $filter); - return $response; - } - - /** - * Operation apiCustomersCustomerIdComposerTokensGetWithHttpInfo - * - * Get composer tokens - * - * @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\ComposerToken[], HTTP status code, HTTP response headers (array of strings) - */ - public function apiCustomersCustomerIdComposerTokensGetWithHttpInfo($customerId, $filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\ComposerToken[]'; - $request = $this->apiCustomersCustomerIdComposerTokensGetRequest($customerId, $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\ComposerToken[]', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiCustomersCustomerIdComposerTokensGetAsync - * - * Get composer tokens - * - * @param string $customerId (required) - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersCustomerIdComposerTokensGetAsync($customerId, $filter = null) - { - return $this->apiCustomersCustomerIdComposerTokensGetAsyncWithHttpInfo($customerId, $filter) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomersCustomerIdComposerTokensGetAsyncWithHttpInfo - * - * Get composer tokens - * - * @param string $customerId (required) - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersCustomerIdComposerTokensGetAsyncWithHttpInfo($customerId, $filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\ComposerToken[]'; - $request = $this->apiCustomersCustomerIdComposerTokensGetRequest($customerId, $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 'apiCustomersCustomerIdComposerTokensGet' - * - * @param string $customerId (required) - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCustomersCustomerIdComposerTokensGetRequest($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 apiCustomersCustomerIdComposerTokensGet' - ); - } - - $resourcePath = '/api/Customers/{customerId}/composerTokens'; - $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 ($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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiCustomersCustomerIdComposerTokensIdGet - * - * 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 \Yoast\MyYoastApiClient\Model\ComposerToken - */ - public function apiCustomersCustomerIdComposerTokensIdGet($customerId, $id, $filter = null) - { - list($response) = $this->apiCustomersCustomerIdComposerTokensIdGetWithHttpInfo($customerId, $id, $filter); - return $response; - } - - /** - * Operation apiCustomersCustomerIdComposerTokensIdGetWithHttpInfo - * - * 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 \Yoast\MyYoastApiClient\Model\ComposerToken, HTTP status code, HTTP response headers (array of strings) - */ - public function apiCustomersCustomerIdComposerTokensIdGetWithHttpInfo($customerId, $id, $filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\ComposerToken'; - $request = $this->apiCustomersCustomerIdComposerTokensIdGetRequest($customerId, $id, $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\ComposerToken', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiCustomersCustomerIdComposerTokensIdGetAsync - * - * 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 apiCustomersCustomerIdComposerTokensIdGetAsync($customerId, $id, $filter = null) - { - return $this->apiCustomersCustomerIdComposerTokensIdGetAsyncWithHttpInfo($customerId, $id, $filter) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomersCustomerIdComposerTokensIdGetAsyncWithHttpInfo - * - * 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 apiCustomersCustomerIdComposerTokensIdGetAsyncWithHttpInfo($customerId, $id, $filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\ComposerToken'; - $request = $this->apiCustomersCustomerIdComposerTokensIdGetRequest($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 'apiCustomersCustomerIdComposerTokensIdGet' - * - * @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 apiCustomersCustomerIdComposerTokensIdGetRequest($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 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' - ); - } - - $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) { - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiCustomersCustomerIdCourseEnrollmentsGet - * - * Find Course Enrollments - * - * @param string $ownershipRelation ownershipRelation (required) - * @param string $customerId customerId (required) - * @param string $courseId courseId (optional) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\CourseEnrollment[] - */ - public function apiCustomersCustomerIdCourseEnrollmentsGet($ownershipRelation, $customerId, $courseId = null) - { - list($response) = $this->apiCustomersCustomerIdCourseEnrollmentsGetWithHttpInfo($ownershipRelation, $customerId, $courseId); - return $response; - } - - /** - * Operation apiCustomersCustomerIdCourseEnrollmentsGetWithHttpInfo - * - * Find Course Enrollments - * - * @param string $ownershipRelation (required) - * @param string $customerId (required) - * @param string $courseId (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 apiCustomersCustomerIdCourseEnrollmentsGetWithHttpInfo($ownershipRelation, $customerId, $courseId = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\CourseEnrollment[]'; - $request = $this->apiCustomersCustomerIdCourseEnrollmentsGetRequest($ownershipRelation, $customerId, $courseId); - - 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\CourseEnrollment[]', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiCustomersCustomerIdCourseEnrollmentsGetAsync - * - * Find Course Enrollments - * - * @param string $ownershipRelation (required) - * @param string $customerId (required) - * @param string $courseId (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersCustomerIdCourseEnrollmentsGetAsync($ownershipRelation, $customerId, $courseId = null) - { - return $this->apiCustomersCustomerIdCourseEnrollmentsGetAsyncWithHttpInfo($ownershipRelation, $customerId, $courseId) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomersCustomerIdCourseEnrollmentsGetAsyncWithHttpInfo - * - * Find Course Enrollments - * - * @param string $ownershipRelation (required) - * @param string $customerId (required) - * @param string $courseId (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersCustomerIdCourseEnrollmentsGetAsyncWithHttpInfo($ownershipRelation, $customerId, $courseId = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\CourseEnrollment[]'; - $request = $this->apiCustomersCustomerIdCourseEnrollmentsGetRequest($ownershipRelation, $customerId, $courseId); - - 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 'apiCustomersCustomerIdCourseEnrollmentsGet' - * - * @param string $ownershipRelation (required) - * @param string $customerId (required) - * @param string $courseId (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCustomersCustomerIdCourseEnrollmentsGetRequest($ownershipRelation, $customerId, $courseId = null) - { - // 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)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $customerId when calling apiCustomersCustomerIdCourseEnrollmentsGet' - ); - } - - $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 ($customerId !== null) { - $resourcePath = str_replace( - '{' . 'customerId' . '}', - ObjectSerializer::toPathValue($customerId), - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiCustomersCustomerIdIdentitiesGet - * - * Get user identities - * - * @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\UserIdentity[] - */ - public function apiCustomersCustomerIdIdentitiesGet($customerId, $filter = null) - { - list($response) = $this->apiCustomersCustomerIdIdentitiesGetWithHttpInfo($customerId, $filter); - return $response; - } - - /** - * Operation apiCustomersCustomerIdIdentitiesGetWithHttpInfo - * - * Get user identities - * - * @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\UserIdentity[], HTTP status code, HTTP response headers (array of strings) - */ - public function apiCustomersCustomerIdIdentitiesGetWithHttpInfo($customerId, $filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\UserIdentity[]'; - $request = $this->apiCustomersCustomerIdIdentitiesGetRequest($customerId, $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\UserIdentity[]', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiCustomersCustomerIdIdentitiesGetAsync - * - * Get user identities - * - * @param string $customerId (required) - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersCustomerIdIdentitiesGetAsync($customerId, $filter = null) - { - return $this->apiCustomersCustomerIdIdentitiesGetAsyncWithHttpInfo($customerId, $filter) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomersCustomerIdIdentitiesGetAsyncWithHttpInfo - * - * Get user identities - * - * @param string $customerId (required) - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersCustomerIdIdentitiesGetAsyncWithHttpInfo($customerId, $filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\UserIdentity[]'; - $request = $this->apiCustomersCustomerIdIdentitiesGetRequest($customerId, $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 'apiCustomersCustomerIdIdentitiesGet' - * - * @param string $customerId (required) - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCustomersCustomerIdIdentitiesGetRequest($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' - ); - } - - $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 ($customerId !== null) { - $resourcePath = str_replace( - '{' . 'customerId' . '}', - ObjectSerializer::toPathValue($customerId), - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiCustomersCustomerIdNewsletterDelete - * - * Unsubscribe from the newsletter - * - * @param string $customerId customerId (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return object - */ - public function apiCustomersCustomerIdNewsletterDelete($customerId) - { - list($response) = $this->apiCustomersCustomerIdNewsletterDeleteWithHttpInfo($customerId); - return $response; - } - - /** - * Operation apiCustomersCustomerIdNewsletterDeleteWithHttpInfo - * - * 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 apiCustomersCustomerIdNewsletterDeleteWithHttpInfo($customerId) - { - $returnType = 'object'; - $request = $this->apiCustomersCustomerIdNewsletterDeleteRequest($customerId); - - 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(), - 'object', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiCustomersCustomerIdNewsletterDeleteAsync - * - * Unsubscribe from the newsletter - * - * @param string $customerId (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersCustomerIdNewsletterDeleteAsync($customerId) - { - return $this->apiCustomersCustomerIdNewsletterDeleteAsyncWithHttpInfo($customerId) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomersCustomerIdNewsletterDeleteAsyncWithHttpInfo - * - * Unsubscribe from the newsletter - * - * @param string $customerId (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersCustomerIdNewsletterDeleteAsyncWithHttpInfo($customerId) - { - $returnType = 'object'; - $request = $this->apiCustomersCustomerIdNewsletterDeleteRequest($customerId); - - 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 'apiCustomersCustomerIdNewsletterDelete' - * - * @param string $customerId (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCustomersCustomerIdNewsletterDeleteRequest($customerId) - { - // 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' - ); - } - - $resourcePath = '/api/Customers/{customerId}/newsletter'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - // path params - if ($customerId !== null) { - $resourcePath = str_replace( - '{' . 'customerId' . '}', - ObjectSerializer::toPathValue($customerId), - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiCustomersCustomerIdNewsletterGet - * - * Newsletter subscription status - * - * @param string $customerId customerId (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return object - */ - public function apiCustomersCustomerIdNewsletterGet($customerId) - { - list($response) = $this->apiCustomersCustomerIdNewsletterGetWithHttpInfo($customerId); - return $response; - } - - /** - * Operation apiCustomersCustomerIdNewsletterGetWithHttpInfo - * - * Newsletter subscription status - * - * @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 apiCustomersCustomerIdNewsletterGetWithHttpInfo($customerId) - { - $returnType = 'object'; - $request = $this->apiCustomersCustomerIdNewsletterGetRequest($customerId); - - 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(), - 'object', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiCustomersCustomerIdNewsletterGetAsync - * - * Newsletter subscription status - * - * @param string $customerId (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersCustomerIdNewsletterGetAsync($customerId) - { - return $this->apiCustomersCustomerIdNewsletterGetAsyncWithHttpInfo($customerId) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomersCustomerIdNewsletterGetAsyncWithHttpInfo - * - * Newsletter subscription status - * - * @param string $customerId (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersCustomerIdNewsletterGetAsyncWithHttpInfo($customerId) - { - $returnType = 'object'; - $request = $this->apiCustomersCustomerIdNewsletterGetRequest($customerId); - - 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 'apiCustomersCustomerIdNewsletterGet' - * - * @param string $customerId (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCustomersCustomerIdNewsletterGetRequest($customerId) - { - // 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'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - // path params - if ($customerId !== null) { - $resourcePath = str_replace( - '{' . 'customerId' . '}', - ObjectSerializer::toPathValue($customerId), - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiCustomersCustomerIdNewsletterPost - * - * Subscribe to the newsletter - * - * @param string $customerId customerId (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return object - */ - public function apiCustomersCustomerIdNewsletterPost($customerId) - { - list($response) = $this->apiCustomersCustomerIdNewsletterPostWithHttpInfo($customerId); - return $response; - } - - /** - * Operation apiCustomersCustomerIdNewsletterPostWithHttpInfo - * - * Subscribe to 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 apiCustomersCustomerIdNewsletterPostWithHttpInfo($customerId) - { - $returnType = 'object'; - $request = $this->apiCustomersCustomerIdNewsletterPostRequest($customerId); - - 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 201: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - 'object', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiCustomersCustomerIdNewsletterPostAsync - * - * Subscribe to the newsletter - * - * @param string $customerId (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersCustomerIdNewsletterPostAsync($customerId) - { - return $this->apiCustomersCustomerIdNewsletterPostAsyncWithHttpInfo($customerId) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomersCustomerIdNewsletterPostAsyncWithHttpInfo - * - * Subscribe to the newsletter - * - * @param string $customerId (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersCustomerIdNewsletterPostAsyncWithHttpInfo($customerId) - { - $returnType = 'object'; - $request = $this->apiCustomersCustomerIdNewsletterPostRequest($customerId); - - 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 'apiCustomersCustomerIdNewsletterPost' - * - * @param string $customerId (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCustomersCustomerIdNewsletterPostRequest($customerId) - { - // 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 apiCustomersCustomerIdNewsletterPost' - ); - } - - $resourcePath = '/api/Customers/{customerId}/newsletter'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - // path params - if ($customerId !== null) { - $resourcePath = str_replace( - '{' . 'customerId' . '}', - ObjectSerializer::toPathValue($customerId), - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiCustomersCustomerIdOrdersGet - * - * Get orders - * - * @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\Order[] - */ - public function apiCustomersCustomerIdOrdersGet($customerId, $filter = null) - { - list($response) = $this->apiCustomersCustomerIdOrdersGetWithHttpInfo($customerId, $filter); - return $response; - } - - /** - * Operation apiCustomersCustomerIdOrdersGetWithHttpInfo - * - * Get orders - * - * @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\Order[], HTTP status code, HTTP response headers (array of strings) - */ - public function apiCustomersCustomerIdOrdersGetWithHttpInfo($customerId, $filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Order[]'; - $request = $this->apiCustomersCustomerIdOrdersGetRequest($customerId, $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\Order[]', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiCustomersCustomerIdOrdersGetAsync - * - * Get orders - * - * @param string $customerId (required) - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersCustomerIdOrdersGetAsync($customerId, $filter = null) - { - return $this->apiCustomersCustomerIdOrdersGetAsyncWithHttpInfo($customerId, $filter) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomersCustomerIdOrdersGetAsyncWithHttpInfo - * - * Get orders - * - * @param string $customerId (required) - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersCustomerIdOrdersGetAsyncWithHttpInfo($customerId, $filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Order[]'; - $request = $this->apiCustomersCustomerIdOrdersGetRequest($customerId, $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 'apiCustomersCustomerIdOrdersGet' - * - * @param string $customerId (required) - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCustomersCustomerIdOrdersGetRequest($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 apiCustomersCustomerIdOrdersGet' - ); - } - - $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 ($customerId !== null) { - $resourcePath = str_replace( - '{' . 'customerId' . '}', - ObjectSerializer::toPathValue($customerId), - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiCustomersCustomerIdOrdersIdGet - * - * Get a order - * - * @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\Order - */ - public function apiCustomersCustomerIdOrdersIdGet($customerId, $id, $filter = null) - { - list($response) = $this->apiCustomersCustomerIdOrdersIdGetWithHttpInfo($customerId, $id, $filter); - return $response; - } - - /** - * Operation apiCustomersCustomerIdOrdersIdGetWithHttpInfo - * - * 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 \Yoast\MyYoastApiClient\Model\Order, HTTP status code, HTTP response headers (array of strings) - */ - public function apiCustomersCustomerIdOrdersIdGetWithHttpInfo($customerId, $id, $filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Order'; - $request = $this->apiCustomersCustomerIdOrdersIdGetRequest($customerId, $id, $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\Order', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiCustomersCustomerIdOrdersIdGetAsync - * - * 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 apiCustomersCustomerIdOrdersIdGetAsync($customerId, $id, $filter = null) - { - return $this->apiCustomersCustomerIdOrdersIdGetAsyncWithHttpInfo($customerId, $id, $filter) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomersCustomerIdOrdersIdGetAsyncWithHttpInfo - * - * 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 apiCustomersCustomerIdOrdersIdGetAsyncWithHttpInfo($customerId, $id, $filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Order'; - $request = $this->apiCustomersCustomerIdOrdersIdGetRequest($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 'apiCustomersCustomerIdOrdersIdGet' - * - * @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 apiCustomersCustomerIdOrdersIdGetRequest($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 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}'; - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiCustomersCustomerIdSitesGet - * - * 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 \Yoast\MyYoastApiClient\Model\Site[] - */ - public function apiCustomersCustomerIdSitesGet($customerId, $filter = null) - { - list($response) = $this->apiCustomersCustomerIdSitesGetWithHttpInfo($customerId, $filter); - return $response; - } - - /** - * Operation apiCustomersCustomerIdSitesGetWithHttpInfo - * - * 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 \Yoast\MyYoastApiClient\Model\Site[], HTTP status code, HTTP response headers (array of strings) - */ - public function apiCustomersCustomerIdSitesGetWithHttpInfo($customerId, $filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Site[]'; - $request = $this->apiCustomersCustomerIdSitesGetRequest($customerId, $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\Site[]', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiCustomersCustomerIdSitesGetAsync - * - * Get sites - * - * @param string $customerId (required) - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersCustomerIdSitesGetAsync($customerId, $filter = null) - { - return $this->apiCustomersCustomerIdSitesGetAsyncWithHttpInfo($customerId, $filter) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomersCustomerIdSitesGetAsyncWithHttpInfo - * - * Get sites - * - * @param string $customerId (required) - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersCustomerIdSitesGetAsyncWithHttpInfo($customerId, $filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Site[]'; - $request = $this->apiCustomersCustomerIdSitesGetRequest($customerId, $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 'apiCustomersCustomerIdSitesGet' - * - * @param string $customerId (required) - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCustomersCustomerIdSitesGetRequest($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 apiCustomersCustomerIdSitesGet' - ); - } - - $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; - - 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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiCustomersCustomerIdSitesIdGet - * - * Get a site - * - * @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\Site - */ - public function apiCustomersCustomerIdSitesIdGet($customerId, $id, $filter = null) - { - list($response) = $this->apiCustomersCustomerIdSitesIdGetWithHttpInfo($customerId, $id, $filter); - return $response; - } - - /** - * Operation apiCustomersCustomerIdSitesIdGetWithHttpInfo - * - * Get a site - * - * @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\Site, HTTP status code, HTTP response headers (array of strings) - */ - public function apiCustomersCustomerIdSitesIdGetWithHttpInfo($customerId, $id, $filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Site'; - $request = $this->apiCustomersCustomerIdSitesIdGetRequest($customerId, $id, $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\Site', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiCustomersCustomerIdSitesIdGetAsync - * - * Get a site - * - * @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 apiCustomersCustomerIdSitesIdGetAsync($customerId, $id, $filter = null) - { - return $this->apiCustomersCustomerIdSitesIdGetAsyncWithHttpInfo($customerId, $id, $filter) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomersCustomerIdSitesIdGetAsyncWithHttpInfo - * - * Get a site - * - * @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 apiCustomersCustomerIdSitesIdGetAsyncWithHttpInfo($customerId, $id, $filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Site'; - $request = $this->apiCustomersCustomerIdSitesIdGetRequest($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 'apiCustomersCustomerIdSitesIdGet' - * - * @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 apiCustomersCustomerIdSitesIdGetRequest($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 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}'; - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiCustomersCustomerIdSitesPost - * - * Create a site for a user - * - * @param \Yoast\MyYoastApiClient\Model\CreateSiteBodyDto $body body (required) - * @param string $customerId customerId (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\Site - */ - public function apiCustomersCustomerIdSitesPost($body, $customerId) - { - list($response) = $this->apiCustomersCustomerIdSitesPostWithHttpInfo($body, $customerId); - return $response; - } - - /** - * Operation apiCustomersCustomerIdSitesPostWithHttpInfo - * - * Create a site for a user - * - * @param \Yoast\MyYoastApiClient\Model\CreateSiteBodyDto $body (required) - * @param string $customerId (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 apiCustomersCustomerIdSitesPostWithHttpInfo($body, $customerId) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Site'; - $request = $this->apiCustomersCustomerIdSitesPostRequest($body, $customerId); - - 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 apiCustomersCustomerIdSitesPostAsync - * - * Create a site for a user - * - * @param \Yoast\MyYoastApiClient\Model\CreateSiteBodyDto $body (required) - * @param string $customerId (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersCustomerIdSitesPostAsync($body, $customerId) - { - return $this->apiCustomersCustomerIdSitesPostAsyncWithHttpInfo($body, $customerId) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomersCustomerIdSitesPostAsyncWithHttpInfo - * - * Create a site for a user - * - * @param \Yoast\MyYoastApiClient\Model\CreateSiteBodyDto $body (required) - * @param string $customerId (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersCustomerIdSitesPostAsyncWithHttpInfo($body, $customerId) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Site'; - $request = $this->apiCustomersCustomerIdSitesPostRequest($body, $customerId); - - 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 'apiCustomersCustomerIdSitesPost' - * - * @param \Yoast\MyYoastApiClient\Model\CreateSiteBodyDto $body (required) - * @param string $customerId (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCustomersCustomerIdSitesPostRequest($body, $customerId) - { - // 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 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'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - // 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( - ['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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiCustomersCustomerIdStudentCourseEnrollmentsGet - * - * Find Course Enrollments that a customer is student in - * - * @param string $customerId customerId (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\CourseEnrollment[] - */ - public function apiCustomersCustomerIdStudentCourseEnrollmentsGet($customerId) - { - list($response) = $this->apiCustomersCustomerIdStudentCourseEnrollmentsGetWithHttpInfo($customerId); - return $response; - } - - /** - * Operation apiCustomersCustomerIdStudentCourseEnrollmentsGetWithHttpInfo - * - * Find Course Enrollments that a customer is student in - * - * @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) - */ - public function apiCustomersCustomerIdStudentCourseEnrollmentsGetWithHttpInfo($customerId) - { - $returnType = '\Yoast\MyYoastApiClient\Model\CourseEnrollment[]'; - $request = $this->apiCustomersCustomerIdStudentCourseEnrollmentsGetRequest($customerId); - - 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\CourseEnrollment[]', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiCustomersCustomerIdStudentCourseEnrollmentsGetAsync - * - * Find Course Enrollments that a customer is student in - * - * @param string $customerId (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersCustomerIdStudentCourseEnrollmentsGetAsync($customerId) - { - return $this->apiCustomersCustomerIdStudentCourseEnrollmentsGetAsyncWithHttpInfo($customerId) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomersCustomerIdStudentCourseEnrollmentsGetAsyncWithHttpInfo - * - * Find Course Enrollments that a customer is student in - * - * @param string $customerId (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersCustomerIdStudentCourseEnrollmentsGetAsyncWithHttpInfo($customerId) - { - $returnType = '\Yoast\MyYoastApiClient\Model\CourseEnrollment[]'; - $request = $this->apiCustomersCustomerIdStudentCourseEnrollmentsGetRequest($customerId); - - 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 'apiCustomersCustomerIdStudentCourseEnrollmentsGet' - * - * @param string $customerId (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCustomersCustomerIdStudentCourseEnrollmentsGetRequest($customerId) - { - // 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 apiCustomersCustomerIdStudentCourseEnrollmentsGet' - ); - } - - $resourcePath = '/api/Customers/{customerId}/studentCourseEnrollments'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - // path params - if ($customerId !== null) { - $resourcePath = str_replace( - '{' . 'customerId' . '}', - ObjectSerializer::toPathValue($customerId), - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiCustomersCustomerIdSubscriptionsGet - * - * Get subscriptions - * - * @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\Subscription[] - */ - public function apiCustomersCustomerIdSubscriptionsGet($customerId, $filter = null) - { - list($response) = $this->apiCustomersCustomerIdSubscriptionsGetWithHttpInfo($customerId, $filter); - return $response; - } - - /** - * Operation apiCustomersCustomerIdSubscriptionsGetWithHttpInfo - * - * Get subscriptions - * - * @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\Subscription[], HTTP status code, HTTP response headers (array of strings) - */ - public function apiCustomersCustomerIdSubscriptionsGetWithHttpInfo($customerId, $filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Subscription[]'; - $request = $this->apiCustomersCustomerIdSubscriptionsGetRequest($customerId, $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\Subscription[]', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiCustomersCustomerIdSubscriptionsGetAsync - * - * Get subscriptions - * - * @param string $customerId (required) - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersCustomerIdSubscriptionsGetAsync($customerId, $filter = null) - { - return $this->apiCustomersCustomerIdSubscriptionsGetAsyncWithHttpInfo($customerId, $filter) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomersCustomerIdSubscriptionsGetAsyncWithHttpInfo - * - * Get subscriptions - * - * @param string $customerId (required) - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersCustomerIdSubscriptionsGetAsyncWithHttpInfo($customerId, $filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Subscription[]'; - $request = $this->apiCustomersCustomerIdSubscriptionsGetRequest($customerId, $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 'apiCustomersCustomerIdSubscriptionsGet' - * - * @param string $customerId (required) - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCustomersCustomerIdSubscriptionsGetRequest($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 apiCustomersCustomerIdSubscriptionsGet' - ); - } - - $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 ($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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiCustomersCustomerIdSubscriptionsIdCancelPost - * - * 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 object - */ - public function apiCustomersCustomerIdSubscriptionsIdCancelPost($body, $customerId, $id) - { - list($response) = $this->apiCustomersCustomerIdSubscriptionsIdCancelPostWithHttpInfo($body, $customerId, $id); - return $response; - } - - /** - * Operation apiCustomersCustomerIdSubscriptionsIdCancelPostWithHttpInfo - * - * 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 object, HTTP status code, HTTP response headers (array of strings) - */ - public function apiCustomersCustomerIdSubscriptionsIdCancelPostWithHttpInfo($body, $customerId, $id) - { - $returnType = 'object'; - $request = $this->apiCustomersCustomerIdSubscriptionsIdCancelPostRequest($body, $customerId, $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(), - 'object', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiCustomersCustomerIdSubscriptionsIdCancelPostAsync - * - * 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 apiCustomersCustomerIdSubscriptionsIdCancelPostAsync($body, $customerId, $id) - { - return $this->apiCustomersCustomerIdSubscriptionsIdCancelPostAsyncWithHttpInfo($body, $customerId, $id) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomersCustomerIdSubscriptionsIdCancelPostAsyncWithHttpInfo - * - * 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 apiCustomersCustomerIdSubscriptionsIdCancelPostAsyncWithHttpInfo($body, $customerId, $id) - { - $returnType = 'object'; - $request = $this->apiCustomersCustomerIdSubscriptionsIdCancelPostRequest($body, $customerId, $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 'apiCustomersCustomerIdSubscriptionsIdCancelPost' - * - * @param \Yoast\MyYoastApiClient\Model\CancelSubscriptionBodyDto $body (required) - * @param string $customerId (required) - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCustomersCustomerIdSubscriptionsIdCancelPostRequest($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 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' - ); - } - - $resourcePath = '/api/Customers/{customerId}/subscriptions/{id}/cancel'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $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( - ['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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiCustomersCustomerIdSubscriptionsIdGet - * - * Get a subscriptions - * - * @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\Subscription - */ - public function apiCustomersCustomerIdSubscriptionsIdGet($customerId, $id, $filter = null) - { - list($response) = $this->apiCustomersCustomerIdSubscriptionsIdGetWithHttpInfo($customerId, $id, $filter); - return $response; - } - - /** - * Operation apiCustomersCustomerIdSubscriptionsIdGetWithHttpInfo - * - * Get a subscriptions - * - * @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\Subscription, HTTP status code, HTTP response headers (array of strings) - */ - public function apiCustomersCustomerIdSubscriptionsIdGetWithHttpInfo($customerId, $id, $filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Subscription'; - $request = $this->apiCustomersCustomerIdSubscriptionsIdGetRequest($customerId, $id, $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\Subscription', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiCustomersCustomerIdSubscriptionsIdGetAsync - * - * Get a subscriptions - * - * @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 apiCustomersCustomerIdSubscriptionsIdGetAsync($customerId, $id, $filter = null) - { - return $this->apiCustomersCustomerIdSubscriptionsIdGetAsyncWithHttpInfo($customerId, $id, $filter) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomersCustomerIdSubscriptionsIdGetAsyncWithHttpInfo - * - * Get a subscriptions - * - * @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 apiCustomersCustomerIdSubscriptionsIdGetAsyncWithHttpInfo($customerId, $id, $filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Subscription'; - $request = $this->apiCustomersCustomerIdSubscriptionsIdGetRequest($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 'apiCustomersCustomerIdSubscriptionsIdGet' - * - * @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 apiCustomersCustomerIdSubscriptionsIdGetRequest($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 apiCustomersCustomerIdSubscriptionsIdGet' - ); - } - // 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' - ); - } - - $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 ($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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiCustomersGet - * - * Get customers - * - * @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[] - */ - public function apiCustomersGet($filter = null) - { - list($response) = $this->apiCustomersGetWithHttpInfo($filter); - return $response; - } - - /** - * Operation apiCustomersGetWithHttpInfo - * - * 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 \Yoast\MyYoastApiClient\Model\Customer[], HTTP status code, HTTP response headers (array of strings) - */ - public function apiCustomersGetWithHttpInfo($filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Customer[]'; - $request = $this->apiCustomersGetRequest($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\Customer[]', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiCustomersGetAsync - * - * Get customers - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersGetAsync($filter = null) - { - return $this->apiCustomersGetAsyncWithHttpInfo($filter) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomersGetAsyncWithHttpInfo - * - * Get customers - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersGetAsyncWithHttpInfo($filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Customer[]'; - $request = $this->apiCustomersGetRequest($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 'apiCustomersGet' - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCustomersGetRequest($filter = null) - { - - $resourcePath = '/api/Customers'; - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiCustomersIdAccessTokensPost - * - * Create an access token for a user - * - * @param string $id id (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function apiCustomersIdAccessTokensPost($id) - { - $this->apiCustomersIdAccessTokensPostWithHttpInfo($id); - } - - /** - * Operation apiCustomersIdAccessTokensPostWithHttpInfo - * - * Create an access token for a user - * - * @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 apiCustomersIdAccessTokensPostWithHttpInfo($id) - { - $returnType = ''; - $request = $this->apiCustomersIdAccessTokensPostRequest($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() - ); - } - - return [null, $statusCode, $response->getHeaders()]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - } - throw $e; - } - } - - /** - * Operation apiCustomersIdAccessTokensPostAsync - * - * Create an access token for a user - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersIdAccessTokensPostAsync($id) - { - return $this->apiCustomersIdAccessTokensPostAsyncWithHttpInfo($id) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomersIdAccessTokensPostAsyncWithHttpInfo - * - * Create an access token for a user - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersIdAccessTokensPostAsyncWithHttpInfo($id) - { - $returnType = ''; - $request = $this->apiCustomersIdAccessTokensPostRequest($id); - - 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 'apiCustomersIdAccessTokensPost' - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCustomersIdAccessTokensPostRequest($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 apiCustomersIdAccessTokensPost' - ); - } - - $resourcePath = '/api/Customers/{id}/accessTokens'; - $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( - [] - ); - } 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); - } - } - - - $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 apiCustomersIdAvatarPost - * - * Upload a new UserAvatar to WordPress - * - * @param string $id id (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\Customer - */ - public function apiCustomersIdAvatarPost($id) - { - list($response) = $this->apiCustomersIdAvatarPostWithHttpInfo($id); - return $response; - } - - /** - * Operation apiCustomersIdAvatarPostWithHttpInfo - * - * Upload a new UserAvatar to WordPress - * - * @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 apiCustomersIdAvatarPostWithHttpInfo($id) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Customer'; - $request = $this->apiCustomersIdAvatarPostRequest($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 apiCustomersIdAvatarPostAsync - * - * Upload a new UserAvatar to WordPress - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersIdAvatarPostAsync($id) - { - return $this->apiCustomersIdAvatarPostAsyncWithHttpInfo($id) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomersIdAvatarPostAsyncWithHttpInfo - * - * Upload a new UserAvatar to WordPress - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersIdAvatarPostAsyncWithHttpInfo($id) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Customer'; - $request = $this->apiCustomersIdAvatarPostRequest($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 'apiCustomersIdAvatarPost' - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCustomersIdAvatarPostRequest($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 apiCustomersIdAvatarPost' - ); - } - - $resourcePath = '/api/Customers/{id}/avatar'; - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiCustomersIdDownloadGet - * - * Download profile. - * - * @param string $id id (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\JSZip - */ - public function apiCustomersIdDownloadGet($id) - { - list($response) = $this->apiCustomersIdDownloadGetWithHttpInfo($id); - return $response; - } - - /** - * Operation apiCustomersIdDownloadGetWithHttpInfo - * - * Download profile. - * - * @param string $id (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) - */ - public function apiCustomersIdDownloadGetWithHttpInfo($id) - { - $returnType = '\Yoast\MyYoastApiClient\Model\JSZip'; - $request = $this->apiCustomersIdDownloadGetRequest($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\JSZip', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiCustomersIdDownloadGetAsync - * - * Download profile. - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersIdDownloadGetAsync($id) - { - return $this->apiCustomersIdDownloadGetAsyncWithHttpInfo($id) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomersIdDownloadGetAsyncWithHttpInfo - * - * Download profile. - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersIdDownloadGetAsyncWithHttpInfo($id) - { - $returnType = '\Yoast\MyYoastApiClient\Model\JSZip'; - $request = $this->apiCustomersIdDownloadGetRequest($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 'apiCustomersIdDownloadGet' - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCustomersIdDownloadGetRequest($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 apiCustomersIdDownloadGet' - ); - } - - $resourcePath = '/api/Customers/{id}/download'; - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiCustomersIdEnablePost - * - * Enables the customer with the given ID - * - * @param string $id id (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return object - */ - public function apiCustomersIdEnablePost($id) - { - list($response) = $this->apiCustomersIdEnablePostWithHttpInfo($id); - return $response; - } - - /** - * Operation apiCustomersIdEnablePostWithHttpInfo - * - * Enables the customer with the given ID - * - * @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 apiCustomersIdEnablePostWithHttpInfo($id) - { - $returnType = 'object'; - $request = $this->apiCustomersIdEnablePostRequest($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(), - 'object', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiCustomersIdEnablePostAsync - * - * Enables the customer with the given ID - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersIdEnablePostAsync($id) - { - return $this->apiCustomersIdEnablePostAsyncWithHttpInfo($id) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomersIdEnablePostAsyncWithHttpInfo - * - * Enables the customer with the given ID - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersIdEnablePostAsyncWithHttpInfo($id) - { - $returnType = 'object'; - $request = $this->apiCustomersIdEnablePostRequest($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 'apiCustomersIdEnablePost' - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCustomersIdEnablePostRequest($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' - ); - } - - $resourcePath = '/api/Customers/{id}/enable'; - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiCustomersIdFindRefundsGet - * - * 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 apiCustomersIdFindRefundsGet($id) - { - list($response) = $this->apiCustomersIdFindRefundsGetWithHttpInfo($id); - return $response; - } - - /** - * Operation apiCustomersIdFindRefundsGetWithHttpInfo - * - * 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 apiCustomersIdFindRefundsGetWithHttpInfo($id) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Refund[]'; - $request = $this->apiCustomersIdFindRefundsGetRequest($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 apiCustomersIdFindRefundsGetAsync - * - * Find refunds for user - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersIdFindRefundsGetAsync($id) - { - return $this->apiCustomersIdFindRefundsGetAsyncWithHttpInfo($id) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomersIdFindRefundsGetAsyncWithHttpInfo - * - * Find refunds for user - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersIdFindRefundsGetAsyncWithHttpInfo($id) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Refund[]'; - $request = $this->apiCustomersIdFindRefundsGetRequest($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 'apiCustomersIdFindRefundsGet' - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCustomersIdFindRefundsGetRequest($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 apiCustomersIdFindRefundsGet' - ); - } - - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiCustomersIdGdprDeleteDelete - * - * 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 apiCustomersIdGdprDeleteDelete($id) - { - list($response) = $this->apiCustomersIdGdprDeleteDeleteWithHttpInfo($id); - return $response; - } - - /** - * Operation apiCustomersIdGdprDeleteDeleteWithHttpInfo - * - * 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 apiCustomersIdGdprDeleteDeleteWithHttpInfo($id) - { - $returnType = 'string'; - $request = $this->apiCustomersIdGdprDeleteDeleteRequest($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 apiCustomersIdGdprDeleteDeleteAsync - * - * Performs a \"GDPR forget me\" request. - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersIdGdprDeleteDeleteAsync($id) - { - return $this->apiCustomersIdGdprDeleteDeleteAsyncWithHttpInfo($id) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomersIdGdprDeleteDeleteAsyncWithHttpInfo - * - * Performs a \"GDPR forget me\" request. - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersIdGdprDeleteDeleteAsyncWithHttpInfo($id) - { - $returnType = 'string'; - $request = $this->apiCustomersIdGdprDeleteDeleteRequest($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 'apiCustomersIdGdprDeleteDelete' - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCustomersIdGdprDeleteDeleteRequest($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 apiCustomersIdGdprDeleteDelete' - ); - } - - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiCustomersIdGet - * - * Get a customer - * - * @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\Customer - */ - public function apiCustomersIdGet($id, $filter = null) - { - list($response) = $this->apiCustomersIdGetWithHttpInfo($id, $filter); - return $response; - } - - /** - * Operation apiCustomersIdGetWithHttpInfo - * - * Get a customer - * - * @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\Customer, HTTP status code, HTTP response headers (array of strings) - */ - public function apiCustomersIdGetWithHttpInfo($id, $filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Customer'; - $request = $this->apiCustomersIdGetRequest($id, $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\Customer', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiCustomersIdGetAsync - * - * Get a customer - * - * @param string $id (required) - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersIdGetAsync($id, $filter = null) - { - return $this->apiCustomersIdGetAsyncWithHttpInfo($id, $filter) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomersIdGetAsyncWithHttpInfo - * - * Get a customer - * - * @param string $id (required) - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersIdGetAsyncWithHttpInfo($id, $filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Customer'; - $request = $this->apiCustomersIdGetRequest($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 'apiCustomersIdGet' - * - * @param string $id (required) - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCustomersIdGetRequest($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 apiCustomersIdGet' - ); - } - - $resourcePath = '/api/Customers/{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 ($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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiCustomersIdPasswordPatch - * - * 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 apiCustomersIdPasswordPatch($body, $id) - { - list($response) = $this->apiCustomersIdPasswordPatchWithHttpInfo($body, $id); - return $response; - } - - /** - * Operation apiCustomersIdPasswordPatchWithHttpInfo - * - * 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 apiCustomersIdPasswordPatchWithHttpInfo($body, $id) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Customer'; - $request = $this->apiCustomersIdPasswordPatchRequest($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 apiCustomersIdPasswordPatchAsync - * - * 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 apiCustomersIdPasswordPatchAsync($body, $id) - { - return $this->apiCustomersIdPasswordPatchAsyncWithHttpInfo($body, $id) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomersIdPasswordPatchAsyncWithHttpInfo - * - * 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 apiCustomersIdPasswordPatchAsyncWithHttpInfo($body, $id) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Customer'; - $request = $this->apiCustomersIdPasswordPatchRequest($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 'apiCustomersIdPasswordPatch' - * - * @param \Yoast\MyYoastApiClient\Model\ChangePasswordDto $body (required) - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCustomersIdPasswordPatchRequest($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 apiCustomersIdPasswordPatch' - ); - } - // 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 apiCustomersIdPasswordPatch' - ); - } - - $resourcePath = '/api/Customers/{id}/password'; - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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( - 'PATCH', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation apiCustomersIdPatch - * - * @param \Yoast\MyYoastApiClient\Model\UpdateUserDto $body body (required) - * @param string $id id (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function apiCustomersIdPatch($body, $id) - { - $this->apiCustomersIdPatchWithHttpInfo($body, $id); - } - - /** - * Operation apiCustomersIdPatchWithHttpInfo - * - * @param \Yoast\MyYoastApiClient\Model\UpdateUserDto $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) - */ - public function apiCustomersIdPatchWithHttpInfo($body, $id) - { - $returnType = ''; - $request = $this->apiCustomersIdPatchRequest($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() - ); - } - - return [null, $statusCode, $response->getHeaders()]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - } - throw $e; - } - } - - /** - * Operation apiCustomersIdPatchAsync - * - * - * - * @param \Yoast\MyYoastApiClient\Model\UpdateUserDto $body (required) - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersIdPatchAsync($body, $id) - { - return $this->apiCustomersIdPatchAsyncWithHttpInfo($body, $id) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomersIdPatchAsyncWithHttpInfo - * - * - * - * @param \Yoast\MyYoastApiClient\Model\UpdateUserDto $body (required) - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersIdPatchAsyncWithHttpInfo($body, $id) - { - $returnType = ''; - $request = $this->apiCustomersIdPatchRequest($body, $id); - - 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 'apiCustomersIdPatch' - * - * @param \Yoast\MyYoastApiClient\Model\UpdateUserDto $body (required) - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCustomersIdPatchRequest($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 apiCustomersIdPatch' - ); - } - // 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 apiCustomersIdPatch' - ); - } - - $resourcePath = '/api/Customers/{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( - [] - ); - } 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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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( - 'PATCH', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation apiCustomersIdProfileGet - * - * @param string $id id (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return object - */ - public function apiCustomersIdProfileGet($id) - { - list($response) = $this->apiCustomersIdProfileGetWithHttpInfo($id); - return $response; - } - - /** - * Operation apiCustomersIdProfileGetWithHttpInfo - * - * @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 apiCustomersIdProfileGetWithHttpInfo($id) - { - $returnType = 'object'; - $request = $this->apiCustomersIdProfileGetRequest($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(), - 'object', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiCustomersIdProfileGetAsync - * - * - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersIdProfileGetAsync($id) - { - return $this->apiCustomersIdProfileGetAsyncWithHttpInfo($id) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomersIdProfileGetAsyncWithHttpInfo - * - * - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersIdProfileGetAsyncWithHttpInfo($id) - { - $returnType = 'object'; - $request = $this->apiCustomersIdProfileGetRequest($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 'apiCustomersIdProfileGet' - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCustomersIdProfileGetRequest($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 apiCustomersIdProfileGet' - ); - } - - $resourcePath = '/api/Customers/{id}/profile'; - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiCustomersIdProfilePatch - * - * Update a customer to WordPress - * - * @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\Customer - */ - public function apiCustomersIdProfilePatch($body, $id) - { - list($response) = $this->apiCustomersIdProfilePatchWithHttpInfo($body, $id); - return $response; - } - - /** - * Operation apiCustomersIdProfilePatchWithHttpInfo - * - * Update a customer to WordPress - * - * @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\Customer, HTTP status code, HTTP response headers (array of strings) - */ - public function apiCustomersIdProfilePatchWithHttpInfo($body, $id) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Customer'; - $request = $this->apiCustomersIdProfilePatchRequest($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 apiCustomersIdProfilePatchAsync - * - * Update a customer to WordPress - * - * @param \Yoast\MyYoastApiClient\Model\UpdateUserToWordpressDto $body (required) - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersIdProfilePatchAsync($body, $id) - { - return $this->apiCustomersIdProfilePatchAsyncWithHttpInfo($body, $id) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomersIdProfilePatchAsyncWithHttpInfo - * - * Update a customer to WordPress - * - * @param \Yoast\MyYoastApiClient\Model\UpdateUserToWordpressDto $body (required) - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersIdProfilePatchAsyncWithHttpInfo($body, $id) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Customer'; - $request = $this->apiCustomersIdProfilePatchRequest($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 'apiCustomersIdProfilePatch' - * - * @param \Yoast\MyYoastApiClient\Model\UpdateUserToWordpressDto $body (required) - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCustomersIdProfilePatchRequest($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 apiCustomersIdProfilePatch' - ); - } - // 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' - ); - } - - $resourcePath = '/api/Customers/{id}/profile'; - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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( - 'PATCH', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation apiCustomersIdRoleMappingDelete - * - * @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 - */ - public function apiCustomersIdRoleMappingDelete($body, $id) - { - $this->apiCustomersIdRoleMappingDeleteWithHttpInfo($body, $id); - } - - /** - * Operation apiCustomersIdRoleMappingDeleteWithHttpInfo - * - * @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) - */ - public function apiCustomersIdRoleMappingDeleteWithHttpInfo($body, $id) - { - $returnType = ''; - $request = $this->apiCustomersIdRoleMappingDeleteRequest($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() - ); - } - - return [null, $statusCode, $response->getHeaders()]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - } - throw $e; - } - } - - /** - * Operation apiCustomersIdRoleMappingDeleteAsync - * - * - * - * @param \Yoast\MyYoastApiClient\Model\RoleIDDto $body (required) - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersIdRoleMappingDeleteAsync($body, $id) - { - return $this->apiCustomersIdRoleMappingDeleteAsyncWithHttpInfo($body, $id) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomersIdRoleMappingDeleteAsyncWithHttpInfo - * - * - * - * @param \Yoast\MyYoastApiClient\Model\RoleIDDto $body (required) - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersIdRoleMappingDeleteAsyncWithHttpInfo($body, $id) - { - $returnType = ''; - $request = $this->apiCustomersIdRoleMappingDeleteRequest($body, $id); - - 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 'apiCustomersIdRoleMappingDelete' - * - * @param \Yoast\MyYoastApiClient\Model\RoleIDDto $body (required) - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCustomersIdRoleMappingDeleteRequest($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 apiCustomersIdRoleMappingDelete' - ); - } - // 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' - ); - } - - $resourcePath = '/api/Customers/{id}/roleMapping'; - $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( - [] - ); - } 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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiCustomersIdRoleMappingPost - * - * @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 - */ - public function apiCustomersIdRoleMappingPost($body, $id) - { - $this->apiCustomersIdRoleMappingPostWithHttpInfo($body, $id); - } - - /** - * Operation apiCustomersIdRoleMappingPostWithHttpInfo - * - * @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) - */ - public function apiCustomersIdRoleMappingPostWithHttpInfo($body, $id) - { - $returnType = ''; - $request = $this->apiCustomersIdRoleMappingPostRequest($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() - ); - } - - return [null, $statusCode, $response->getHeaders()]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - } - throw $e; - } - } - - /** - * Operation apiCustomersIdRoleMappingPostAsync - * - * - * - * @param \Yoast\MyYoastApiClient\Model\RoleIDDto $body (required) - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersIdRoleMappingPostAsync($body, $id) - { - return $this->apiCustomersIdRoleMappingPostAsyncWithHttpInfo($body, $id) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomersIdRoleMappingPostAsyncWithHttpInfo - * - * - * - * @param \Yoast\MyYoastApiClient\Model\RoleIDDto $body (required) - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersIdRoleMappingPostAsyncWithHttpInfo($body, $id) - { - $returnType = ''; - $request = $this->apiCustomersIdRoleMappingPostRequest($body, $id); - - 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 'apiCustomersIdRoleMappingPost' - * - * @param \Yoast\MyYoastApiClient\Model\RoleIDDto $body (required) - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCustomersIdRoleMappingPostRequest($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 apiCustomersIdRoleMappingPost' - ); - } - // 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' - ); - } - - $resourcePath = '/api/Customers/{id}/roleMapping'; - $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( - [] - ); - } 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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiCustomersIdRolesGet - * - * @param string $id id (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function apiCustomersIdRolesGet($id) - { - $this->apiCustomersIdRolesGetWithHttpInfo($id); - } - - /** - * Operation apiCustomersIdRolesGetWithHttpInfo - * - * @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 apiCustomersIdRolesGetWithHttpInfo($id) - { - $returnType = ''; - $request = $this->apiCustomersIdRolesGetRequest($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() - ); - } - - return [null, $statusCode, $response->getHeaders()]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - } - throw $e; - } - } - - /** - * Operation apiCustomersIdRolesGetAsync - * - * - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersIdRolesGetAsync($id) - { - return $this->apiCustomersIdRolesGetAsyncWithHttpInfo($id) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomersIdRolesGetAsyncWithHttpInfo - * - * - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersIdRolesGetAsyncWithHttpInfo($id) - { - $returnType = ''; - $request = $this->apiCustomersIdRolesGetRequest($id); - - 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 'apiCustomersIdRolesGet' - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCustomersIdRolesGetRequest($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' - ); - } - - $resourcePath = '/api/Customers/{id}/roles'; - $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( - [] - ); - } 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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiCustomersNewsletterListSubscribePost - * - * 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 object - */ - public function apiCustomersNewsletterListSubscribePost($body, $list) - { - list($response) = $this->apiCustomersNewsletterListSubscribePostWithHttpInfo($body, $list); - return $response; - } - - /** - * Operation apiCustomersNewsletterListSubscribePostWithHttpInfo - * - * 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 object, HTTP status code, HTTP response headers (array of strings) - */ - public function apiCustomersNewsletterListSubscribePostWithHttpInfo($body, $list) - { - $returnType = 'object'; - $request = $this->apiCustomersNewsletterListSubscribePostRequest($body, $list); - - 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(), - 'object', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiCustomersNewsletterListSubscribePostAsync - * - * Subscribes a user to a newsletter - * - * @param \Yoast\MyYoastApiClient\Model\SubscribeByEmailBodyDto $body (required) - * @param string $list (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersNewsletterListSubscribePostAsync($body, $list) - { - return $this->apiCustomersNewsletterListSubscribePostAsyncWithHttpInfo($body, $list) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomersNewsletterListSubscribePostAsyncWithHttpInfo - * - * Subscribes a user to a newsletter - * - * @param \Yoast\MyYoastApiClient\Model\SubscribeByEmailBodyDto $body (required) - * @param string $list (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersNewsletterListSubscribePostAsyncWithHttpInfo($body, $list) - { - $returnType = 'object'; - $request = $this->apiCustomersNewsletterListSubscribePostRequest($body, $list); - - 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 'apiCustomersNewsletterListSubscribePost' - * - * @param \Yoast\MyYoastApiClient\Model\SubscribeByEmailBodyDto $body (required) - * @param string $list (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCustomersNewsletterListSubscribePostRequest($body, $list) - { - // 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 apiCustomersNewsletterListSubscribePost' - ); - } - // verify the required parameter 'list' is set - if ($list === null || (is_array($list) && count($list) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $list when calling apiCustomersNewsletterListSubscribePost' - ); - } - - $resourcePath = '/api/Customers/newsletter/{list}/subscribe'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - // path params - if ($list !== null) { - $resourcePath = str_replace( - '{' . 'list' . '}', - ObjectSerializer::toPathValue($list), - $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); - } - } - - - $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 apiCustomersNewsletterTZhjyjwsYFUMPzNNhJaVADZZIrixRSbXOFgptZJyyKGet - * - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function apiCustomersNewsletterTZhjyjwsYFUMPzNNhJaVADZZIrixRSbXOFgptZJyyKGet() - { - $this->apiCustomersNewsletterTZhjyjwsYFUMPzNNhJaVADZZIrixRSbXOFgptZJyyKGetWithHttpInfo(); - } - - /** - * Operation apiCustomersNewsletterTZhjyjwsYFUMPzNNhJaVADZZIrixRSbXOFgptZJyyKGetWithHttpInfo - * - * - * @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 apiCustomersNewsletterTZhjyjwsYFUMPzNNhJaVADZZIrixRSbXOFgptZJyyKGetWithHttpInfo() - { - $returnType = ''; - $request = $this->apiCustomersNewsletterTZhjyjwsYFUMPzNNhJaVADZZIrixRSbXOFgptZJyyKGetRequest(); - - 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 apiCustomersNewsletterTZhjyjwsYFUMPzNNhJaVADZZIrixRSbXOFgptZJyyKGetAsync - * - * - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersNewsletterTZhjyjwsYFUMPzNNhJaVADZZIrixRSbXOFgptZJyyKGetAsync() - { - return $this->apiCustomersNewsletterTZhjyjwsYFUMPzNNhJaVADZZIrixRSbXOFgptZJyyKGetAsyncWithHttpInfo() - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomersNewsletterTZhjyjwsYFUMPzNNhJaVADZZIrixRSbXOFgptZJyyKGetAsyncWithHttpInfo - * - * - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersNewsletterTZhjyjwsYFUMPzNNhJaVADZZIrixRSbXOFgptZJyyKGetAsyncWithHttpInfo() - { - $returnType = ''; - $request = $this->apiCustomersNewsletterTZhjyjwsYFUMPzNNhJaVADZZIrixRSbXOFgptZJyyKGetRequest(); - - 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 'apiCustomersNewsletterTZhjyjwsYFUMPzNNhJaVADZZIrixRSbXOFgptZJyyKGet' - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCustomersNewsletterTZhjyjwsYFUMPzNNhJaVADZZIrixRSbXOFgptZJyyKGetRequest() - { - - $resourcePath = '/api/Customers/newsletter/tZhjyjwsYFUMPzNNhJaVADZZIrixRSbXOFgptZJyyK'; - $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) { - $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); - } - } - - - $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 apiCustomersNewsletterTZhjyjwsYFUMPzNNhJaVADZZIrixRSbXOFgptZJyyKPost - * - * Entry point for the mailchimp webhooks - * - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function apiCustomersNewsletterTZhjyjwsYFUMPzNNhJaVADZZIrixRSbXOFgptZJyyKPost() - { - $this->apiCustomersNewsletterTZhjyjwsYFUMPzNNhJaVADZZIrixRSbXOFgptZJyyKPostWithHttpInfo(); - } - - /** - * Operation apiCustomersNewsletterTZhjyjwsYFUMPzNNhJaVADZZIrixRSbXOFgptZJyyKPostWithHttpInfo - * - * Entry point for the mailchimp webhooks - * - * - * @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 apiCustomersNewsletterTZhjyjwsYFUMPzNNhJaVADZZIrixRSbXOFgptZJyyKPostWithHttpInfo() - { - $returnType = ''; - $request = $this->apiCustomersNewsletterTZhjyjwsYFUMPzNNhJaVADZZIrixRSbXOFgptZJyyKPostRequest(); - - 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 apiCustomersNewsletterTZhjyjwsYFUMPzNNhJaVADZZIrixRSbXOFgptZJyyKPostAsync - * - * Entry point for the mailchimp webhooks - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersNewsletterTZhjyjwsYFUMPzNNhJaVADZZIrixRSbXOFgptZJyyKPostAsync() - { - return $this->apiCustomersNewsletterTZhjyjwsYFUMPzNNhJaVADZZIrixRSbXOFgptZJyyKPostAsyncWithHttpInfo() - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomersNewsletterTZhjyjwsYFUMPzNNhJaVADZZIrixRSbXOFgptZJyyKPostAsyncWithHttpInfo - * - * Entry point for the mailchimp webhooks - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersNewsletterTZhjyjwsYFUMPzNNhJaVADZZIrixRSbXOFgptZJyyKPostAsyncWithHttpInfo() - { - $returnType = ''; - $request = $this->apiCustomersNewsletterTZhjyjwsYFUMPzNNhJaVADZZIrixRSbXOFgptZJyyKPostRequest(); - - 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 'apiCustomersNewsletterTZhjyjwsYFUMPzNNhJaVADZZIrixRSbXOFgptZJyyKPost' - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCustomersNewsletterTZhjyjwsYFUMPzNNhJaVADZZIrixRSbXOFgptZJyyKPostRequest() - { - - $resourcePath = '/api/Customers/newsletter/tZhjyjwsYFUMPzNNhJaVADZZIrixRSbXOFgptZJyyK'; - $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) { - $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); - } - } - - - $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 apiCustomersNewsletterWALazNYUBfqZIeUDiqyzETbLdbkODeTCjKokMKcbJVPost - * - * Entry point for the mailblue webhooks - * - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function apiCustomersNewsletterWALazNYUBfqZIeUDiqyzETbLdbkODeTCjKokMKcbJVPost() - { - $this->apiCustomersNewsletterWALazNYUBfqZIeUDiqyzETbLdbkODeTCjKokMKcbJVPostWithHttpInfo(); - } - - /** - * Operation apiCustomersNewsletterWALazNYUBfqZIeUDiqyzETbLdbkODeTCjKokMKcbJVPostWithHttpInfo - * - * Entry point for the mailblue webhooks - * - * - * @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 apiCustomersNewsletterWALazNYUBfqZIeUDiqyzETbLdbkODeTCjKokMKcbJVPostWithHttpInfo() - { - $returnType = ''; - $request = $this->apiCustomersNewsletterWALazNYUBfqZIeUDiqyzETbLdbkODeTCjKokMKcbJVPostRequest(); - - 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 apiCustomersNewsletterWALazNYUBfqZIeUDiqyzETbLdbkODeTCjKokMKcbJVPostAsync - * - * Entry point for the mailblue webhooks - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersNewsletterWALazNYUBfqZIeUDiqyzETbLdbkODeTCjKokMKcbJVPostAsync() - { - return $this->apiCustomersNewsletterWALazNYUBfqZIeUDiqyzETbLdbkODeTCjKokMKcbJVPostAsyncWithHttpInfo() - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomersNewsletterWALazNYUBfqZIeUDiqyzETbLdbkODeTCjKokMKcbJVPostAsyncWithHttpInfo - * - * Entry point for the mailblue webhooks - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersNewsletterWALazNYUBfqZIeUDiqyzETbLdbkODeTCjKokMKcbJVPostAsyncWithHttpInfo() - { - $returnType = ''; - $request = $this->apiCustomersNewsletterWALazNYUBfqZIeUDiqyzETbLdbkODeTCjKokMKcbJVPostRequest(); - - 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 'apiCustomersNewsletterWALazNYUBfqZIeUDiqyzETbLdbkODeTCjKokMKcbJVPost' - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCustomersNewsletterWALazNYUBfqZIeUDiqyzETbLdbkODeTCjKokMKcbJVPostRequest() - { - - $resourcePath = '/api/Customers/newsletter/wALazNYUBfqZIeUDiqyzETbLdbkODeTCjKokMKcbJV'; - $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) { - $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); - } - } - - - $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 apiCustomersPagedGet - * - * 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 apiCustomersPagedGet($filter = null) - { - $this->apiCustomersPagedGetWithHttpInfo($filter); - } - - /** - * Operation apiCustomersPagedGetWithHttpInfo - * - * 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 apiCustomersPagedGetWithHttpInfo($filter = null) - { - $returnType = ''; - $request = $this->apiCustomersPagedGetRequest($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 apiCustomersPagedGetAsync - * - * Get customers - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersPagedGetAsync($filter = null) - { - return $this->apiCustomersPagedGetAsyncWithHttpInfo($filter) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomersPagedGetAsyncWithHttpInfo - * - * Get customers - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersPagedGetAsyncWithHttpInfo($filter = null) - { - $returnType = ''; - $request = $this->apiCustomersPagedGetRequest($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 'apiCustomersPagedGet' - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCustomersPagedGetRequest($filter = null) - { - - $resourcePath = '/api/Customers/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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiCustomersResetPasswordPatch - * - * Reset the user's password. - * - * @param \Yoast\MyYoastApiClient\Model\ResetPasswordDto $body body (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return object - */ - public function apiCustomersResetPasswordPatch($body) - { - list($response) = $this->apiCustomersResetPasswordPatchWithHttpInfo($body); - return $response; - } - - /** - * Operation apiCustomersResetPasswordPatchWithHttpInfo - * - * Reset the user's password. - * - * @param \Yoast\MyYoastApiClient\Model\ResetPasswordDto $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 apiCustomersResetPasswordPatchWithHttpInfo($body) - { - $returnType = 'object'; - $request = $this->apiCustomersResetPasswordPatchRequest($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(), - 'object', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiCustomersResetPasswordPatchAsync - * - * Reset the user's password. - * - * @param \Yoast\MyYoastApiClient\Model\ResetPasswordDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersResetPasswordPatchAsync($body) - { - return $this->apiCustomersResetPasswordPatchAsyncWithHttpInfo($body) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomersResetPasswordPatchAsyncWithHttpInfo - * - * Reset the user's password. - * - * @param \Yoast\MyYoastApiClient\Model\ResetPasswordDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersResetPasswordPatchAsyncWithHttpInfo($body) - { - $returnType = 'object'; - $request = $this->apiCustomersResetPasswordPatchRequest($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 'apiCustomersResetPasswordPatch' - * - * @param \Yoast\MyYoastApiClient\Model\ResetPasswordDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCustomersResetPasswordPatchRequest($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 apiCustomersResetPasswordPatch' - ); - } - - $resourcePath = '/api/Customers/resetPassword'; - $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); - } - } - - - $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( - 'PATCH', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation apiCustomersRolemappingIdsGet - * - * Get the ids of all customers with at least one role. - * - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return string[] - */ - public function apiCustomersRolemappingIdsGet() - { - list($response) = $this->apiCustomersRolemappingIdsGetWithHttpInfo(); - return $response; - } - - /** - * Operation apiCustomersRolemappingIdsGetWithHttpInfo - * - * Get the ids of all customers with at least one role. - * - * - * @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 apiCustomersRolemappingIdsGetWithHttpInfo() - { - $returnType = 'string[]'; - $request = $this->apiCustomersRolemappingIdsGetRequest(); - - 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 apiCustomersRolemappingIdsGetAsync - * - * Get the ids of all customers with at least one role. - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersRolemappingIdsGetAsync() - { - return $this->apiCustomersRolemappingIdsGetAsyncWithHttpInfo() - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomersRolemappingIdsGetAsyncWithHttpInfo - * - * Get the ids of all customers with at least one role. - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersRolemappingIdsGetAsyncWithHttpInfo() - { - $returnType = 'string[]'; - $request = $this->apiCustomersRolemappingIdsGetRequest(); - - 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 'apiCustomersRolemappingIdsGet' - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCustomersRolemappingIdsGetRequest() - { - - $resourcePath = '/api/Customers/rolemapping-ids'; - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiCustomersSendResetPasswordEmailPost - * - * Send a reset password email to the user. - * - * @param \Yoast\MyYoastApiClient\Model\SendResetPasswordEmailDto $body body (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return object - */ - public function apiCustomersSendResetPasswordEmailPost($body) - { - list($response) = $this->apiCustomersSendResetPasswordEmailPostWithHttpInfo($body); - return $response; - } - - /** - * Operation apiCustomersSendResetPasswordEmailPostWithHttpInfo - * - * Send a reset password email to the user. - * - * @param \Yoast\MyYoastApiClient\Model\SendResetPasswordEmailDto $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 apiCustomersSendResetPasswordEmailPostWithHttpInfo($body) - { - $returnType = 'object'; - $request = $this->apiCustomersSendResetPasswordEmailPostRequest($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(), - 'object', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiCustomersSendResetPasswordEmailPostAsync - * - * Send a reset password email to the user. - * - * @param \Yoast\MyYoastApiClient\Model\SendResetPasswordEmailDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersSendResetPasswordEmailPostAsync($body) - { - return $this->apiCustomersSendResetPasswordEmailPostAsyncWithHttpInfo($body) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomersSendResetPasswordEmailPostAsyncWithHttpInfo - * - * Send a reset password email to the user. - * - * @param \Yoast\MyYoastApiClient\Model\SendResetPasswordEmailDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersSendResetPasswordEmailPostAsyncWithHttpInfo($body) - { - $returnType = 'object'; - $request = $this->apiCustomersSendResetPasswordEmailPostRequest($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 'apiCustomersSendResetPasswordEmailPost' - * - * @param \Yoast\MyYoastApiClient\Model\SendResetPasswordEmailDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCustomersSendResetPasswordEmailPostRequest($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 apiCustomersSendResetPasswordEmailPost' - ); - } - - $resourcePath = '/api/Customers/sendResetPasswordEmail'; - $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); - } - } - - - $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 apiCustomersSignupPost - * - * Signup a customer on yoast.com following the normal signup flow. - * - * @param \Yoast\MyYoastApiClient\Model\SignupAccountDto $body body (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return object - */ - public function apiCustomersSignupPost($body) - { - list($response) = $this->apiCustomersSignupPostWithHttpInfo($body); - return $response; - } - - /** - * Operation apiCustomersSignupPostWithHttpInfo - * - * Signup a customer on yoast.com following the normal signup flow. - * - * @param \Yoast\MyYoastApiClient\Model\SignupAccountDto $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 apiCustomersSignupPostWithHttpInfo($body) - { - $returnType = 'object'; - $request = $this->apiCustomersSignupPostRequest($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(), - 'object', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiCustomersSignupPostAsync - * - * Signup a customer on yoast.com following the normal signup flow. - * - * @param \Yoast\MyYoastApiClient\Model\SignupAccountDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersSignupPostAsync($body) - { - return $this->apiCustomersSignupPostAsyncWithHttpInfo($body) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomersSignupPostAsyncWithHttpInfo - * - * Signup a customer on yoast.com following the normal signup flow. - * - * @param \Yoast\MyYoastApiClient\Model\SignupAccountDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersSignupPostAsyncWithHttpInfo($body) - { - $returnType = 'object'; - $request = $this->apiCustomersSignupPostRequest($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 'apiCustomersSignupPost' - * - * @param \Yoast\MyYoastApiClient\Model\SignupAccountDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCustomersSignupPostRequest($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 apiCustomersSignupPost' - ); - } - - $resourcePath = '/api/Customers/signup'; - $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); - } - } - - - $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/CustomerNoteApi.php b/src/Api/CustomerNoteApi.php deleted file mode 100644 index c355efb..0000000 --- a/src/Api/CustomerNoteApi.php +++ /dev/null @@ -1,1087 +0,0 @@ -client = $client ?: new Client(); - $this->config = $config ?: new Configuration(); - $this->headerSelector = $selector ?: new HeaderSelector(); - } - - /** - * @return Configuration - */ - public function getConfig() - { - return $this->config; - } - - /** - * Operation apiCustomerNotesGet - * - * Get customer notes - * - * @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[] - */ - public function apiCustomerNotesGet($filter = null) - { - list($response) = $this->apiCustomerNotesGetWithHttpInfo($filter); - return $response; - } - - /** - * Operation apiCustomerNotesGetWithHttpInfo - * - * Get customer notes - * - * @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) - */ - public function apiCustomerNotesGetWithHttpInfo($filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\CustomerNote[]'; - $request = $this->apiCustomerNotesGetRequest($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\CustomerNote[]', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiCustomerNotesGetAsync - * - * Get customer notes - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomerNotesGetAsync($filter = null) - { - return $this->apiCustomerNotesGetAsyncWithHttpInfo($filter) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomerNotesGetAsyncWithHttpInfo - * - * Get customer notes - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomerNotesGetAsyncWithHttpInfo($filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\CustomerNote[]'; - $request = $this->apiCustomerNotesGetRequest($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 'apiCustomerNotesGet' - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCustomerNotesGetRequest($filter = null) - { - - $resourcePath = '/api/CustomerNotes'; - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiCustomerNotesIdDelete - * - * @param string $id id (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function apiCustomerNotesIdDelete($id) - { - $this->apiCustomerNotesIdDeleteWithHttpInfo($id); - } - - /** - * Operation apiCustomerNotesIdDeleteWithHttpInfo - * - * @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 apiCustomerNotesIdDeleteWithHttpInfo($id) - { - $returnType = ''; - $request = $this->apiCustomerNotesIdDeleteRequest($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() - ); - } - - return [null, $statusCode, $response->getHeaders()]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - } - throw $e; - } - } - - /** - * Operation apiCustomerNotesIdDeleteAsync - * - * - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomerNotesIdDeleteAsync($id) - { - return $this->apiCustomerNotesIdDeleteAsyncWithHttpInfo($id) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomerNotesIdDeleteAsyncWithHttpInfo - * - * - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomerNotesIdDeleteAsyncWithHttpInfo($id) - { - $returnType = ''; - $request = $this->apiCustomerNotesIdDeleteRequest($id); - - 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 'apiCustomerNotesIdDelete' - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCustomerNotesIdDeleteRequest($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' - ); - } - - $resourcePath = '/api/CustomerNotes/{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( - [] - ); - } 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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiCustomerNotesIdGet - * - * 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 \Yoast\MyYoastApiClient\Model\CustomerNote - */ - public function apiCustomerNotesIdGet($id, $filter = null) - { - list($response) = $this->apiCustomerNotesIdGetWithHttpInfo($id, $filter); - return $response; - } - - /** - * Operation apiCustomerNotesIdGetWithHttpInfo - * - * Get a customer note - * - * @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\CustomerNote, HTTP status code, HTTP response headers (array of strings) - */ - public function apiCustomerNotesIdGetWithHttpInfo($id, $filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\CustomerNote'; - $request = $this->apiCustomerNotesIdGetRequest($id, $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\CustomerNote', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiCustomerNotesIdGetAsync - * - * Get a customer note - * - * @param string $id (required) - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomerNotesIdGetAsync($id, $filter = null) - { - return $this->apiCustomerNotesIdGetAsyncWithHttpInfo($id, $filter) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomerNotesIdGetAsyncWithHttpInfo - * - * Get a customer note - * - * @param string $id (required) - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomerNotesIdGetAsyncWithHttpInfo($id, $filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\CustomerNote'; - $request = $this->apiCustomerNotesIdGetRequest($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 'apiCustomerNotesIdGet' - * - * @param string $id (required) - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCustomerNotesIdGetRequest($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 apiCustomerNotesIdGet' - ); - } - - $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 ($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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiCustomerNotesPost - * - * @param \Yoast\MyYoastApiClient\Model\CreateCustomerNoteDto $body body (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function apiCustomerNotesPost($body) - { - $this->apiCustomerNotesPostWithHttpInfo($body); - } - - /** - * Operation apiCustomerNotesPostWithHttpInfo - * - * @param \Yoast\MyYoastApiClient\Model\CreateCustomerNoteDto $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 apiCustomerNotesPostWithHttpInfo($body) - { - $returnType = ''; - $request = $this->apiCustomerNotesPostRequest($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() - ); - } - - return [null, $statusCode, $response->getHeaders()]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - } - throw $e; - } - } - - /** - * Operation apiCustomerNotesPostAsync - * - * - * - * @param \Yoast\MyYoastApiClient\Model\CreateCustomerNoteDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomerNotesPostAsync($body) - { - return $this->apiCustomerNotesPostAsyncWithHttpInfo($body) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomerNotesPostAsyncWithHttpInfo - * - * - * - * @param \Yoast\MyYoastApiClient\Model\CreateCustomerNoteDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomerNotesPostAsyncWithHttpInfo($body) - { - $returnType = ''; - $request = $this->apiCustomerNotesPostRequest($body); - - 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 'apiCustomerNotesPost' - * - * @param \Yoast\MyYoastApiClient\Model\CreateCustomerNoteDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCustomerNotesPostRequest($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 apiCustomerNotesPost' - ); - } - - $resourcePath = '/api/CustomerNotes'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - - // body params - $_tempBody = null; - if (isset($body)) { - $_tempBody = $body; - } - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); - } 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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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/DownloadApi.php b/src/Api/DownloadApi.php deleted file mode 100644 index 0e6bd6c..0000000 --- a/src/Api/DownloadApi.php +++ /dev/null @@ -1,653 +0,0 @@ -client = $client ?: new Client(); - $this->config = $config ?: new Configuration(); - $this->headerSelector = $selector ?: new HeaderSelector(); - } - - /** - * @return Configuration - */ - public function getConfig() - { - return $this->config; - } - - /** - * Operation apiDownloadsFileNameGet - * - * Route to download a file - * - * @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 - */ - public function apiDownloadsFileNameGet($version, $pluginVersion, $site, $name) - { - $this->apiDownloadsFileNameGetWithHttpInfo($version, $pluginVersion, $site, $name); - } - - /** - * Operation apiDownloadsFileNameGetWithHttpInfo - * - * Route to download a file - * - * @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) - */ - public function apiDownloadsFileNameGetWithHttpInfo($version, $pluginVersion, $site, $name) - { - $returnType = ''; - $request = $this->apiDownloadsFileNameGetRequest($version, $pluginVersion, $site, $name); - - 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 apiDownloadsFileNameGetAsync - * - * Route to download a file - * - * @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) - { - return $this->apiDownloadsFileNameGetAsyncWithHttpInfo($version, $pluginVersion, $site, $name) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiDownloadsFileNameGetAsyncWithHttpInfo - * - * Route to download a file - * - * @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) - { - $returnType = ''; - $request = $this->apiDownloadsFileNameGetRequest($version, $pluginVersion, $site, $name); - - 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 'apiDownloadsFileNameGet' - * - * @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) - { - // 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' - ); - } - // 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' - ); - } - // 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' - ); - } - - $resourcePath = '/api/downloads/file/{name}'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - // query params - if ($version !== null) { - $queryParams['version'] = ObjectSerializer::toQueryValue($version, null); - } - // query params - if ($pluginVersion !== null) { - $queryParams['plugin_version'] = ObjectSerializer::toQueryValue($pluginVersion, null); - } - // query params - if ($site !== null) { - $queryParams['site'] = ObjectSerializer::toQueryValue($site, null); - } - - // path params - if ($name !== null) { - $resourcePath = str_replace( - '{' . 'name' . '}', - ObjectSerializer::toPathValue($name), - $resourcePath - ); - } - - // 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); - } - } - - - $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 apiDownloadsFileNamePost - * - * Route to update a file. - * - * @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($body, $name) - { - list($response) = $this->apiDownloadsFileNamePostWithHttpInfo($body, $name); - return $response; - } - - /** - * Operation apiDownloadsFileNamePostWithHttpInfo - * - * Route to update a file. - * - * @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($body, $name) - { - $returnType = 'object'; - $request = $this->apiDownloadsFileNamePostRequest($body, $name); - - 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(), - 'object', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiDownloadsFileNamePostAsync - * - * Route to update a file. - * - * @param \Yoast\MyYoastApiClient\Model\UpdateFileDto $body (required) - * @param string $name (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiDownloadsFileNamePostAsync($body, $name) - { - return $this->apiDownloadsFileNamePostAsyncWithHttpInfo($body, $name) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiDownloadsFileNamePostAsyncWithHttpInfo - * - * Route to update a file. - * - * @param \Yoast\MyYoastApiClient\Model\UpdateFileDto $body (required) - * @param string $name (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiDownloadsFileNamePostAsyncWithHttpInfo($body, $name) - { - $returnType = 'object'; - $request = $this->apiDownloadsFileNamePostRequest($body, $name); - - 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 'apiDownloadsFileNamePost' - * - * @param \Yoast\MyYoastApiClient\Model\UpdateFileDto $body (required) - * @param string $name (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiDownloadsFileNamePostRequest($body, $name) - { - // 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 apiDownloadsFileNamePost' - ); - } - // 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' - ); - } - - $resourcePath = '/api/downloads/file/{name}'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $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'] - ); - } - - // 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); - } - } - - - $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/EDDApi.php b/src/Api/EDDApi.php deleted file mode 100644 index fb164ea..0000000 --- a/src/Api/EDDApi.php +++ /dev/null @@ -1,589 +0,0 @@ -client = $client ?: new Client(); - $this->config = $config ?: new Configuration(); - $this->headerSelector = $selector ?: new HeaderSelector(); - } - - /** - * @return Configuration - */ - public function getConfig() - { - return $this->config; - } - - /** - * Operation eddSlApiGet - * - * Activate or deactivate a site license - * - * @param string $eddAction eddAction (required) - * @param string $url url (required) - * @param string $itemName itemName (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function eddSlApiGet($eddAction, $url, $itemName) - { - $this->eddSlApiGetWithHttpInfo($eddAction, $url, $itemName); - } - - /** - * Operation eddSlApiGetWithHttpInfo - * - * Activate or deactivate a site license - * - * @param string $eddAction (required) - * @param string $url (required) - * @param string $itemName (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 eddSlApiGetWithHttpInfo($eddAction, $url, $itemName) - { - $returnType = ''; - $request = $this->eddSlApiGetRequest($eddAction, $url, $itemName); - - 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 eddSlApiGetAsync - * - * Activate or deactivate a site license - * - * @param string $eddAction (required) - * @param string $url (required) - * @param string $itemName (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function eddSlApiGetAsync($eddAction, $url, $itemName) - { - return $this->eddSlApiGetAsyncWithHttpInfo($eddAction, $url, $itemName) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation eddSlApiGetAsyncWithHttpInfo - * - * Activate or deactivate a site license - * - * @param string $eddAction (required) - * @param string $url (required) - * @param string $itemName (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function eddSlApiGetAsyncWithHttpInfo($eddAction, $url, $itemName) - { - $returnType = ''; - $request = $this->eddSlApiGetRequest($eddAction, $url, $itemName); - - 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 'eddSlApiGet' - * - * @param string $eddAction (required) - * @param string $url (required) - * @param string $itemName (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function eddSlApiGetRequest($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' - ); - } - // 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' - ); - } - // 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' - ); - } - - $resourcePath = '/edd-sl-api'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - // query params - if ($eddAction !== null) { - $queryParams['edd_action'] = ObjectSerializer::toQueryValue($eddAction, null); - } - // query params - if ($url !== null) { - $queryParams['url'] = ObjectSerializer::toQueryValue($url, null); - } - // query params - if ($itemName !== null) { - $queryParams['item_name'] = ObjectSerializer::toQueryValue($itemName, 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); - } - } - - - $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 eddSlApiPost - * - * @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($body, $eddAction) - { - $this->eddSlApiPostWithHttpInfo($body, $eddAction); - } - - /** - * Operation eddSlApiPostWithHttpInfo - * - * @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($body, $eddAction) - { - $returnType = ''; - $request = $this->eddSlApiPostRequest($body, $eddAction); - - 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 eddSlApiPostAsync - * - * - * - * @param \Yoast\MyYoastApiClient\Model\EddDTO $body (required) - * @param string $eddAction (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function eddSlApiPostAsync($body, $eddAction) - { - return $this->eddSlApiPostAsyncWithHttpInfo($body, $eddAction) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation eddSlApiPostAsyncWithHttpInfo - * - * - * - * @param \Yoast\MyYoastApiClient\Model\EddDTO $body (required) - * @param string $eddAction (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function eddSlApiPostAsyncWithHttpInfo($body, $eddAction) - { - $returnType = ''; - $request = $this->eddSlApiPostRequest($body, $eddAction); - - 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 'eddSlApiPost' - * - * @param \Yoast\MyYoastApiClient\Model\EddDTO $body (required) - * @param string $eddAction (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function eddSlApiPostRequest($body, $eddAction) - { - // 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 eddSlApiPost' - ); - } - // 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' - ); - } - - $resourcePath = '/edd-sl-api'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - // query params - if ($eddAction !== null) { - $queryParams['edd_action'] = ObjectSerializer::toQueryValue($eddAction, null); - } - - - // body params - $_tempBody = null; - if (isset($body)) { - $_tempBody = $body; - } - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); - } 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); - } - } - - - $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/EmailApi.php b/src/Api/EmailApi.php deleted file mode 100644 index 5124242..0000000 --- a/src/Api/EmailApi.php +++ /dev/null @@ -1,365 +0,0 @@ -client = $client ?: new Client(); - $this->config = $config ?: new Configuration(); - $this->headerSelector = $selector ?: new HeaderSelector(); - } - - /** - * @return Configuration - */ - public function getConfig() - { - return $this->config; - } - - /** - * Operation apiEmailsBulkSendPost - * - * @param \Yoast\MyYoastApiClient\Model\BulkSendEmailDto $body body (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return int - */ - public function apiEmailsBulkSendPost($body) - { - list($response) = $this->apiEmailsBulkSendPostWithHttpInfo($body); - return $response; - } - - /** - * Operation apiEmailsBulkSendPostWithHttpInfo - * - * @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 apiEmailsBulkSendPostWithHttpInfo($body) - { - $returnType = 'int'; - $request = $this->apiEmailsBulkSendPostRequest($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 apiEmailsBulkSendPostAsync - * - * - * - * @param \Yoast\MyYoastApiClient\Model\BulkSendEmailDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiEmailsBulkSendPostAsync($body) - { - return $this->apiEmailsBulkSendPostAsyncWithHttpInfo($body) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiEmailsBulkSendPostAsyncWithHttpInfo - * - * - * - * @param \Yoast\MyYoastApiClient\Model\BulkSendEmailDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiEmailsBulkSendPostAsyncWithHttpInfo($body) - { - $returnType = 'int'; - $request = $this->apiEmailsBulkSendPostRequest($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 'apiEmailsBulkSendPost' - * - * @param \Yoast\MyYoastApiClient\Model\BulkSendEmailDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiEmailsBulkSendPostRequest($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 apiEmailsBulkSendPost' - ); - } - - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 deleted file mode 100644 index 41f9b36..0000000 --- a/src/Api/ExportOrdersApi.php +++ /dev/null @@ -1,725 +0,0 @@ -client = $client ?: new Client(); - $this->config = $config ?: new Configuration(); - $this->headerSelector = $selector ?: new HeaderSelector(); - } - - /** - * @return Configuration - */ - public function getConfig() - { - return $this->config; - } - - /** - * Operation exportOrdersV2FromToTypeGet - * - * Creates an export for orders - * - * @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 string - */ - public function exportOrdersV2FromToTypeGet($from, $to, $type, $password = null) - { - list($response) = $this->exportOrdersV2FromToTypeGetWithHttpInfo($from, $to, $type, $password); - return $response; - } - - /** - * Operation exportOrdersV2FromToTypeGetWithHttpInfo - * - * Creates an export for orders - * - * @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 string, HTTP status code, HTTP response headers (array of strings) - */ - public function exportOrdersV2FromToTypeGetWithHttpInfo($from, $to, $type, $password = null) - { - $returnType = 'string'; - $request = $this->exportOrdersV2FromToTypeGetRequest($from, $to, $type, $password); - - 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 exportOrdersV2FromToTypeGetAsync - * - * Creates an export for orders - * - * @param string $from (required) - * @param string $to (required) - * @param string $type (required) - * @param string $password (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function exportOrdersV2FromToTypeGetAsync($from, $to, $type, $password = null) - { - return $this->exportOrdersV2FromToTypeGetAsyncWithHttpInfo($from, $to, $type, $password) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation exportOrdersV2FromToTypeGetAsyncWithHttpInfo - * - * Creates an export for orders - * - * @param string $from (required) - * @param string $to (required) - * @param string $type (required) - * @param string $password (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function exportOrdersV2FromToTypeGetAsyncWithHttpInfo($from, $to, $type, $password = null) - { - $returnType = 'string'; - $request = $this->exportOrdersV2FromToTypeGetRequest($from, $to, $type, $password); - - 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 'exportOrdersV2FromToTypeGet' - * - * @param string $from (required) - * @param string $to (required) - * @param string $type (required) - * @param string $password (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function exportOrdersV2FromToTypeGetRequest($from, $to, $type, $password = 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 exportOrdersV2FromToTypeGet' - ); - } - // verify the required parameter 'to' is set - if ($to === null || (is_array($to) && count($to) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $to when calling exportOrdersV2FromToTypeGet' - ); - } - // 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' - ); - } - - $resourcePath = '/export-orders/v2/{from}/{to}/{type}'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - // query params - if ($password !== null) { - $queryParams['password'] = ObjectSerializer::toQueryValue($password, null); - } - - // path params - if ($from !== null) { - $resourcePath = str_replace( - '{' . 'from' . '}', - ObjectSerializer::toPathValue($from), - $resourcePath - ); - } - // path params - if ($to !== null) { - $resourcePath = str_replace( - '{' . 'to' . '}', - ObjectSerializer::toPathValue($to), - $resourcePath - ); - } - // path params - if ($type !== null) { - $resourcePath = str_replace( - '{' . 'type' . '}', - ObjectSerializer::toPathValue($type), - $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); - } - } - - - $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 exportOrdersYearMonthTypeGet - * - * Creates an export for orders - * - * @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 string - */ - public function exportOrdersYearMonthTypeGet($year, $month, $type, $password = null) - { - list($response) = $this->exportOrdersYearMonthTypeGetWithHttpInfo($year, $month, $type, $password); - return $response; - } - - /** - * Operation exportOrdersYearMonthTypeGetWithHttpInfo - * - * Creates an export for orders - * - * @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 string, HTTP status code, HTTP response headers (array of strings) - */ - public function exportOrdersYearMonthTypeGetWithHttpInfo($year, $month, $type, $password = null) - { - $returnType = 'string'; - $request = $this->exportOrdersYearMonthTypeGetRequest($year, $month, $type, $password); - - 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 exportOrdersYearMonthTypeGetAsync - * - * Creates an export for orders - * - * @param string $year (required) - * @param string $month (required) - * @param string $type (required) - * @param string $password (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function exportOrdersYearMonthTypeGetAsync($year, $month, $type, $password = null) - { - return $this->exportOrdersYearMonthTypeGetAsyncWithHttpInfo($year, $month, $type, $password) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation exportOrdersYearMonthTypeGetAsyncWithHttpInfo - * - * Creates an export for orders - * - * @param string $year (required) - * @param string $month (required) - * @param string $type (required) - * @param string $password (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function exportOrdersYearMonthTypeGetAsyncWithHttpInfo($year, $month, $type, $password = null) - { - $returnType = 'string'; - $request = $this->exportOrdersYearMonthTypeGetRequest($year, $month, $type, $password); - - 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 'exportOrdersYearMonthTypeGet' - * - * @param string $year (required) - * @param string $month (required) - * @param string $type (required) - * @param string $password (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function exportOrdersYearMonthTypeGetRequest($year, $month, $type, $password = null) - { - // verify the required parameter 'year' is set - if ($year === null || (is_array($year) && count($year) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $year when calling exportOrdersYearMonthTypeGet' - ); - } - // verify the required parameter 'month' is set - if ($month === null || (is_array($month) && count($month) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $month when calling exportOrdersYearMonthTypeGet' - ); - } - // 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' - ); - } - - $resourcePath = '/export-orders/{year}/{month}/{type}'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - // query params - if ($password !== null) { - $queryParams['password'] = ObjectSerializer::toQueryValue($password, null); - } - - // path params - if ($year !== null) { - $resourcePath = str_replace( - '{' . 'year' . '}', - ObjectSerializer::toPathValue($year), - $resourcePath - ); - } - // path params - if ($month !== null) { - $resourcePath = str_replace( - '{' . 'month' . '}', - ObjectSerializer::toPathValue($month), - $resourcePath - ); - } - // path params - if ($type !== null) { - $resourcePath = str_replace( - '{' . 'type' . '}', - ObjectSerializer::toPathValue($type), - $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); - } - } - - - $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/FromWooCommerceApi.php b/src/Api/FromWooCommerceApi.php deleted file mode 100644 index 25baa28..0000000 --- a/src/Api/FromWooCommerceApi.php +++ /dev/null @@ -1,1155 +0,0 @@ -client = $client ?: new Client(); - $this->config = $config ?: new Configuration(); - $this->headerSelector = $selector ?: new HeaderSelector(); - } - - /** - * @return Configuration - */ - public function getConfig() - { - return $this->config; - } - - /** - * Operation apiCustomersFromWooCommercePut - * - * Update or create a customer - * - * @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($body) - { - list($response) = $this->apiCustomersFromWooCommercePutWithHttpInfo($body); - return $response; - } - - /** - * Operation apiCustomersFromWooCommercePutWithHttpInfo - * - * Update or create a customer - * - * @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($body) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Customer'; - $request = $this->apiCustomersFromWooCommercePutRequest($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\Customer', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiCustomersFromWooCommercePutAsync - * - * Update or create a customer - * - * @param \Yoast\MyYoastApiClient\Model\CustomerFromWooDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersFromWooCommercePutAsync($body) - { - return $this->apiCustomersFromWooCommercePutAsyncWithHttpInfo($body) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomersFromWooCommercePutAsyncWithHttpInfo - * - * Update or create a customer - * - * @param \Yoast\MyYoastApiClient\Model\CustomerFromWooDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersFromWooCommercePutAsyncWithHttpInfo($body) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Customer'; - $request = $this->apiCustomersFromWooCommercePutRequest($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 'apiCustomersFromWooCommercePut' - * - * @param \Yoast\MyYoastApiClient\Model\CustomerFromWooDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCustomersFromWooCommercePutRequest($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 apiCustomersFromWooCommercePut' - ); - } - - $resourcePath = '/api/Customers/fromWooCommerce'; - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiOrdersFromWooCommercePut - * - * Sync orders to MyYoast. - * - * @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($body) - { - list($response) = $this->apiOrdersFromWooCommercePutWithHttpInfo($body); - return $response; - } - - /** - * Operation apiOrdersFromWooCommercePutWithHttpInfo - * - * Sync orders to MyYoast. - * - * @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($body) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Order'; - $request = $this->apiOrdersFromWooCommercePutRequest($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\Order', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiOrdersFromWooCommercePutAsync - * - * Sync orders to MyYoast. - * - * @param \Yoast\MyYoastApiClient\Model\OrderFromWooDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiOrdersFromWooCommercePutAsync($body) - { - return $this->apiOrdersFromWooCommercePutAsyncWithHttpInfo($body) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiOrdersFromWooCommercePutAsyncWithHttpInfo - * - * Sync orders to MyYoast. - * - * @param \Yoast\MyYoastApiClient\Model\OrderFromWooDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiOrdersFromWooCommercePutAsyncWithHttpInfo($body) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Order'; - $request = $this->apiOrdersFromWooCommercePutRequest($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 'apiOrdersFromWooCommercePut' - * - * @param \Yoast\MyYoastApiClient\Model\OrderFromWooDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiOrdersFromWooCommercePutRequest($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 apiOrdersFromWooCommercePut' - ); - } - - $resourcePath = '/api/Orders/fromWooCommerce'; - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiProductGroupsFromWooCommercePut - * - * Sync products to MyYoast. - * - * @param \Yoast\MyYoastApiClient\Model\ProductGroupFromWooDto $body body (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\ProductGroup - */ - public function apiProductGroupsFromWooCommercePut($body) - { - list($response) = $this->apiProductGroupsFromWooCommercePutWithHttpInfo($body); - return $response; - } - - /** - * Operation apiProductGroupsFromWooCommercePutWithHttpInfo - * - * Sync products to MyYoast. - * - * @param \Yoast\MyYoastApiClient\Model\ProductGroupFromWooDto $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) - */ - public function apiProductGroupsFromWooCommercePutWithHttpInfo($body) - { - $returnType = '\Yoast\MyYoastApiClient\Model\ProductGroup'; - $request = $this->apiProductGroupsFromWooCommercePutRequest($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\ProductGroup', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiProductGroupsFromWooCommercePutAsync - * - * Sync products to MyYoast. - * - * @param \Yoast\MyYoastApiClient\Model\ProductGroupFromWooDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiProductGroupsFromWooCommercePutAsync($body) - { - return $this->apiProductGroupsFromWooCommercePutAsyncWithHttpInfo($body) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiProductGroupsFromWooCommercePutAsyncWithHttpInfo - * - * Sync products to MyYoast. - * - * @param \Yoast\MyYoastApiClient\Model\ProductGroupFromWooDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiProductGroupsFromWooCommercePutAsyncWithHttpInfo($body) - { - $returnType = '\Yoast\MyYoastApiClient\Model\ProductGroup'; - $request = $this->apiProductGroupsFromWooCommercePutRequest($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 'apiProductGroupsFromWooCommercePut' - * - * @param \Yoast\MyYoastApiClient\Model\ProductGroupFromWooDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiProductGroupsFromWooCommercePutRequest($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 apiProductGroupsFromWooCommercePut' - ); - } - - $resourcePath = '/api/ProductGroups/fromWooCommerce'; - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiProductsFromWooCommercePut - * - * Sync products to MyYoast. - * - * @param \Yoast\MyYoastApiClient\Model\ProductFromWooDto $body body (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\Product - */ - public function apiProductsFromWooCommercePut($body) - { - list($response) = $this->apiProductsFromWooCommercePutWithHttpInfo($body); - return $response; - } - - /** - * Operation apiProductsFromWooCommercePutWithHttpInfo - * - * Sync products to MyYoast. - * - * @param \Yoast\MyYoastApiClient\Model\ProductFromWooDto $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) - */ - public function apiProductsFromWooCommercePutWithHttpInfo($body) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Product'; - $request = $this->apiProductsFromWooCommercePutRequest($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\Product', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiProductsFromWooCommercePutAsync - * - * Sync products to MyYoast. - * - * @param \Yoast\MyYoastApiClient\Model\ProductFromWooDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiProductsFromWooCommercePutAsync($body) - { - return $this->apiProductsFromWooCommercePutAsyncWithHttpInfo($body) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiProductsFromWooCommercePutAsyncWithHttpInfo - * - * Sync products to MyYoast. - * - * @param \Yoast\MyYoastApiClient\Model\ProductFromWooDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiProductsFromWooCommercePutAsyncWithHttpInfo($body) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Product'; - $request = $this->apiProductsFromWooCommercePutRequest($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 'apiProductsFromWooCommercePut' - * - * @param \Yoast\MyYoastApiClient\Model\ProductFromWooDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiProductsFromWooCommercePutRequest($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 apiProductsFromWooCommercePut' - ); - } - - $resourcePath = '/api/Products/fromWooCommerce'; - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 - ); - } - - /** - * 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/GDPRApi.php b/src/Api/GDPRApi.php deleted file mode 100644 index 67de15b..0000000 --- a/src/Api/GDPRApi.php +++ /dev/null @@ -1,374 +0,0 @@ -client = $client ?: new Client(); - $this->config = $config ?: new Configuration(); - $this->headerSelector = $selector ?: new HeaderSelector(); - } - - /** - * @return Configuration - */ - public function getConfig() - { - return $this->config; - } - - /** - * Operation apiCustomersIdGdprDeleteDelete - * - * 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 apiCustomersIdGdprDeleteDelete($id) - { - list($response) = $this->apiCustomersIdGdprDeleteDeleteWithHttpInfo($id); - return $response; - } - - /** - * Operation apiCustomersIdGdprDeleteDeleteWithHttpInfo - * - * 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 apiCustomersIdGdprDeleteDeleteWithHttpInfo($id) - { - $returnType = 'string'; - $request = $this->apiCustomersIdGdprDeleteDeleteRequest($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 apiCustomersIdGdprDeleteDeleteAsync - * - * Performs a \"GDPR forget me\" request. - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersIdGdprDeleteDeleteAsync($id) - { - return $this->apiCustomersIdGdprDeleteDeleteAsyncWithHttpInfo($id) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiCustomersIdGdprDeleteDeleteAsyncWithHttpInfo - * - * Performs a \"GDPR forget me\" request. - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiCustomersIdGdprDeleteDeleteAsyncWithHttpInfo($id) - { - $returnType = 'string'; - $request = $this->apiCustomersIdGdprDeleteDeleteRequest($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 'apiCustomersIdGdprDeleteDelete' - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiCustomersIdGdprDeleteDeleteRequest($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 apiCustomersIdGdprDeleteDelete' - ); - } - - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 deleted file mode 100644 index 8a8e610..0000000 --- a/src/Api/HelpscoutApi.php +++ /dev/null @@ -1,379 +0,0 @@ -client = $client ?: new Client(); - $this->config = $config ?: new Configuration(); - $this->headerSelector = $selector ?: new HeaderSelector(); - } - - /** - * @return Configuration - */ - public function getConfig() - { - return $this->config; - } - - /** - * Operation helpscoutPost - * - * Get information about a customer - * - * @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($body, $xHelpScoutSignature) - { - list($response) = $this->helpscoutPostWithHttpInfo($body, $xHelpScoutSignature); - return $response; - } - - /** - * Operation helpscoutPostWithHttpInfo - * - * Get information about a customer - * - * @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($body, $xHelpScoutSignature) - { - $returnType = 'object'; - $request = $this->helpscoutPostRequest($body, $xHelpScoutSignature); - - 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(), - 'object', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation helpscoutPostAsync - * - * Get information about a customer - * - * @param \Yoast\MyYoastApiClient\Model\HelpScoutDto $body (required) - * @param string $xHelpScoutSignature The Helpscout signature (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function helpscoutPostAsync($body, $xHelpScoutSignature) - { - return $this->helpscoutPostAsyncWithHttpInfo($body, $xHelpScoutSignature) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation helpscoutPostAsyncWithHttpInfo - * - * Get information about a customer - * - * @param \Yoast\MyYoastApiClient\Model\HelpScoutDto $body (required) - * @param string $xHelpScoutSignature The Helpscout signature (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function helpscoutPostAsyncWithHttpInfo($body, $xHelpScoutSignature) - { - $returnType = 'object'; - $request = $this->helpscoutPostRequest($body, $xHelpScoutSignature); - - 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 'helpscoutPost' - * - * @param \Yoast\MyYoastApiClient\Model\HelpScoutDto $body (required) - * @param string $xHelpScoutSignature The Helpscout signature (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function helpscoutPostRequest($body, $xHelpScoutSignature) - { - // 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 helpscoutPost' - ); - } - // 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' - ); - } - - $resourcePath = '/helpscout'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - // header params - if ($xHelpScoutSignature !== null) { - $headerParams['X-HelpScout-Signature'] = ObjectSerializer::toHeaderValue($xHelpScoutSignature); - } - - - // 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); - } - } - - - $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/MailingListApi.php b/src/Api/MailingListApi.php deleted file mode 100644 index bd4a711..0000000 --- a/src/Api/MailingListApi.php +++ /dev/null @@ -1,1430 +0,0 @@ -client = $client ?: new Client(); - $this->config = $config ?: new Configuration(); - $this->headerSelector = $selector ?: new HeaderSelector(); - } - - /** - * @return Configuration - */ - public function getConfig() - { - return $this->config; - } - - /** - * Operation apiMailingListGet - * - * Get mailingLists Names. - * - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function apiMailingListGet() - { - $this->apiMailingListGetWithHttpInfo(); - } - - /** - * Operation apiMailingListGetWithHttpInfo - * - * Get mailingLists Names. - * - * - * @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 apiMailingListGetWithHttpInfo() - { - $returnType = ''; - $request = $this->apiMailingListGetRequest(); - - 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 apiMailingListGetAsync - * - * Get mailingLists Names. - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiMailingListGetAsync() - { - return $this->apiMailingListGetAsyncWithHttpInfo() - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiMailingListGetAsyncWithHttpInfo - * - * Get mailingLists Names. - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiMailingListGetAsyncWithHttpInfo() - { - $returnType = ''; - $request = $this->apiMailingListGetRequest(); - - 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 'apiMailingListGet' - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiMailingListGetRequest() - { - - $resourcePath = '/api/Mailing-list'; - $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) { - $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); - } - } - - - $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 apiMailingListIsSubscribedToNewsletterGet - * - * Get the subscription status. - * - * @param string $email email (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function apiMailingListIsSubscribedToNewsletterGet($email) - { - $this->apiMailingListIsSubscribedToNewsletterGetWithHttpInfo($email); - } - - /** - * Operation apiMailingListIsSubscribedToNewsletterGetWithHttpInfo - * - * Get the subscription status. - * - * @param string $email (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 apiMailingListIsSubscribedToNewsletterGetWithHttpInfo($email) - { - $returnType = ''; - $request = $this->apiMailingListIsSubscribedToNewsletterGetRequest($email); - - 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 apiMailingListIsSubscribedToNewsletterGetAsync - * - * Get the subscription status. - * - * @param string $email (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiMailingListIsSubscribedToNewsletterGetAsync($email) - { - return $this->apiMailingListIsSubscribedToNewsletterGetAsyncWithHttpInfo($email) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiMailingListIsSubscribedToNewsletterGetAsyncWithHttpInfo - * - * Get the subscription status. - * - * @param string $email (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiMailingListIsSubscribedToNewsletterGetAsyncWithHttpInfo($email) - { - $returnType = ''; - $request = $this->apiMailingListIsSubscribedToNewsletterGetRequest($email); - - 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 'apiMailingListIsSubscribedToNewsletterGet' - * - * @param string $email (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiMailingListIsSubscribedToNewsletterGetRequest($email) - { - // verify the required parameter 'email' is set - if ($email === null || (is_array($email) && count($email) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $email when calling apiMailingListIsSubscribedToNewsletterGet' - ); - } - - $resourcePath = '/api/Mailing-list/isSubscribedToNewsletter'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - // query params - if ($email !== null) { - $queryParams['email'] = ObjectSerializer::toQueryValue($email, 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); - } - } - - - $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 apiMailingListStatusGet - * - * Get the subscription status. - * - * @param string $email email (required) - * @param string $list list (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function apiMailingListStatusGet($email, $list) - { - $this->apiMailingListStatusGetWithHttpInfo($email, $list); - } - - /** - * Operation apiMailingListStatusGetWithHttpInfo - * - * Get the subscription status. - * - * @param string $email (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) - */ - public function apiMailingListStatusGetWithHttpInfo($email, $list) - { - $returnType = ''; - $request = $this->apiMailingListStatusGetRequest($email, $list); - - 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 apiMailingListStatusGetAsync - * - * Get the subscription status. - * - * @param string $email (required) - * @param string $list (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiMailingListStatusGetAsync($email, $list) - { - return $this->apiMailingListStatusGetAsyncWithHttpInfo($email, $list) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiMailingListStatusGetAsyncWithHttpInfo - * - * Get the subscription status. - * - * @param string $email (required) - * @param string $list (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiMailingListStatusGetAsyncWithHttpInfo($email, $list) - { - $returnType = ''; - $request = $this->apiMailingListStatusGetRequest($email, $list); - - 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 'apiMailingListStatusGet' - * - * @param string $email (required) - * @param string $list (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiMailingListStatusGetRequest($email, $list) - { - // verify the required parameter 'email' is set - if ($email === null || (is_array($email) && count($email) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $email when calling apiMailingListStatusGet' - ); - } - // verify the required parameter 'list' is set - if ($list === null || (is_array($list) && count($list) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $list when calling apiMailingListStatusGet' - ); - } - - $resourcePath = '/api/Mailing-list/status'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - // query params - if ($email !== null) { - $queryParams['email'] = ObjectSerializer::toQueryValue($email, null); - } - // query params - if ($list !== null) { - $queryParams['list'] = ObjectSerializer::toQueryValue($list, 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); - } - } - - - $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 apiMailingListSubscribePost - * - * Subscribe contact to a mailing list. - * - * @param \Yoast\MyYoastApiClient\Model\SubscribeDto $body body (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function apiMailingListSubscribePost($body) - { - $this->apiMailingListSubscribePostWithHttpInfo($body); - } - - /** - * Operation apiMailingListSubscribePostWithHttpInfo - * - * Subscribe contact to a mailing list. - * - * @param \Yoast\MyYoastApiClient\Model\SubscribeDto $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 apiMailingListSubscribePostWithHttpInfo($body) - { - $returnType = ''; - $request = $this->apiMailingListSubscribePostRequest($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() - ); - } - - return [null, $statusCode, $response->getHeaders()]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - } - throw $e; - } - } - - /** - * Operation apiMailingListSubscribePostAsync - * - * Subscribe contact to a mailing list. - * - * @param \Yoast\MyYoastApiClient\Model\SubscribeDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiMailingListSubscribePostAsync($body) - { - return $this->apiMailingListSubscribePostAsyncWithHttpInfo($body) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiMailingListSubscribePostAsyncWithHttpInfo - * - * Subscribe contact to a mailing list. - * - * @param \Yoast\MyYoastApiClient\Model\SubscribeDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiMailingListSubscribePostAsyncWithHttpInfo($body) - { - $returnType = ''; - $request = $this->apiMailingListSubscribePostRequest($body); - - 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 'apiMailingListSubscribePost' - * - * @param \Yoast\MyYoastApiClient\Model\SubscribeDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiMailingListSubscribePostRequest($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 apiMailingListSubscribePost' - ); - } - - $resourcePath = '/api/Mailing-list/subscribe'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - - // body params - $_tempBody = null; - if (isset($body)) { - $_tempBody = $body; - } - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); - } 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); - } - } - - - $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 apiMailingListUnsubscribeFromNewsletterPost - * - * Unsubscribe to a mailing list. - * - * @param \Yoast\MyYoastApiClient\Model\UnsubscribeFromNewsletterDto $body body (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function apiMailingListUnsubscribeFromNewsletterPost($body) - { - $this->apiMailingListUnsubscribeFromNewsletterPostWithHttpInfo($body); - } - - /** - * Operation apiMailingListUnsubscribeFromNewsletterPostWithHttpInfo - * - * Unsubscribe to a mailing list. - * - * @param \Yoast\MyYoastApiClient\Model\UnsubscribeFromNewsletterDto $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 apiMailingListUnsubscribeFromNewsletterPostWithHttpInfo($body) - { - $returnType = ''; - $request = $this->apiMailingListUnsubscribeFromNewsletterPostRequest($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() - ); - } - - return [null, $statusCode, $response->getHeaders()]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - } - throw $e; - } - } - - /** - * Operation apiMailingListUnsubscribeFromNewsletterPostAsync - * - * Unsubscribe to a mailing list. - * - * @param \Yoast\MyYoastApiClient\Model\UnsubscribeFromNewsletterDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiMailingListUnsubscribeFromNewsletterPostAsync($body) - { - return $this->apiMailingListUnsubscribeFromNewsletterPostAsyncWithHttpInfo($body) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiMailingListUnsubscribeFromNewsletterPostAsyncWithHttpInfo - * - * Unsubscribe to a mailing list. - * - * @param \Yoast\MyYoastApiClient\Model\UnsubscribeFromNewsletterDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiMailingListUnsubscribeFromNewsletterPostAsyncWithHttpInfo($body) - { - $returnType = ''; - $request = $this->apiMailingListUnsubscribeFromNewsletterPostRequest($body); - - 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 'apiMailingListUnsubscribeFromNewsletterPost' - * - * @param \Yoast\MyYoastApiClient\Model\UnsubscribeFromNewsletterDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiMailingListUnsubscribeFromNewsletterPostRequest($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 apiMailingListUnsubscribeFromNewsletterPost' - ); - } - - $resourcePath = '/api/Mailing-list/unsubscribeFromNewsletter'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - - // body params - $_tempBody = null; - if (isset($body)) { - $_tempBody = $body; - } - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); - } 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); - } - } - - - $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 apiMailingListUnsubscribePost - * - * Unsubscribe to a mailing list. - * - * @param \Yoast\MyYoastApiClient\Model\UnsubscribeDto $body body (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function apiMailingListUnsubscribePost($body) - { - $this->apiMailingListUnsubscribePostWithHttpInfo($body); - } - - /** - * Operation apiMailingListUnsubscribePostWithHttpInfo - * - * Unsubscribe to a mailing list. - * - * @param \Yoast\MyYoastApiClient\Model\UnsubscribeDto $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 apiMailingListUnsubscribePostWithHttpInfo($body) - { - $returnType = ''; - $request = $this->apiMailingListUnsubscribePostRequest($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() - ); - } - - return [null, $statusCode, $response->getHeaders()]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - } - throw $e; - } - } - - /** - * Operation apiMailingListUnsubscribePostAsync - * - * Unsubscribe to a mailing list. - * - * @param \Yoast\MyYoastApiClient\Model\UnsubscribeDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiMailingListUnsubscribePostAsync($body) - { - return $this->apiMailingListUnsubscribePostAsyncWithHttpInfo($body) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiMailingListUnsubscribePostAsyncWithHttpInfo - * - * Unsubscribe to a mailing list. - * - * @param \Yoast\MyYoastApiClient\Model\UnsubscribeDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiMailingListUnsubscribePostAsyncWithHttpInfo($body) - { - $returnType = ''; - $request = $this->apiMailingListUnsubscribePostRequest($body); - - 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 'apiMailingListUnsubscribePost' - * - * @param \Yoast\MyYoastApiClient\Model\UnsubscribeDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiMailingListUnsubscribePostRequest($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 apiMailingListUnsubscribePost' - ); - } - - $resourcePath = '/api/Mailing-list/unsubscribe'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - - // body params - $_tempBody = null; - if (isset($body)) { - $_tempBody = $body; - } - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); - } 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); - } - } - - - $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/OrderApi.php b/src/Api/OrderApi.php deleted file mode 100644 index 6abfa36..0000000 --- a/src/Api/OrderApi.php +++ /dev/null @@ -1,2440 +0,0 @@ -client = $client ?: new Client(); - $this->config = $config ?: new Configuration(); - $this->headerSelector = $selector ?: new HeaderSelector(); - } - - /** - * @return Configuration - */ - public function getConfig() - { - return $this->config; - } - - /** - * Operation apiOrdersAutoRenewalCountGet - * - * @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 - */ - public function apiOrdersAutoRenewalCountGet($startDate, $endDate, $secret) - { - list($response) = $this->apiOrdersAutoRenewalCountGetWithHttpInfo($startDate, $endDate, $secret); - return $response; - } - - /** - * Operation apiOrdersAutoRenewalCountGetWithHttpInfo - * - * @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) - */ - public function apiOrdersAutoRenewalCountGetWithHttpInfo($startDate, $endDate, $secret) - { - $returnType = '\Yoast\MyYoastApiClient\Model\AutoRenewalCountResponseDto'; - $request = $this->apiOrdersAutoRenewalCountGetRequest($startDate, $endDate, $secret); - - 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\AutoRenewalCountResponseDto', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiOrdersAutoRenewalCountGetAsync - * - * - * - * @param \DateTime $startDate (required) - * @param \DateTime $endDate (required) - * @param string $secret (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiOrdersAutoRenewalCountGetAsync($startDate, $endDate, $secret) - { - return $this->apiOrdersAutoRenewalCountGetAsyncWithHttpInfo($startDate, $endDate, $secret) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiOrdersAutoRenewalCountGetAsyncWithHttpInfo - * - * - * - * @param \DateTime $startDate (required) - * @param \DateTime $endDate (required) - * @param string $secret (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiOrdersAutoRenewalCountGetAsyncWithHttpInfo($startDate, $endDate, $secret) - { - $returnType = '\Yoast\MyYoastApiClient\Model\AutoRenewalCountResponseDto'; - $request = $this->apiOrdersAutoRenewalCountGetRequest($startDate, $endDate, $secret); - - 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 'apiOrdersAutoRenewalCountGet' - * - * @param \DateTime $startDate (required) - * @param \DateTime $endDate (required) - * @param string $secret (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiOrdersAutoRenewalCountGetRequest($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 apiOrdersAutoRenewalCountGet' - ); - } - // 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' - ); - } - - $resourcePath = '/api/Orders/auto-renewal-count'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - // query params - if ($startDate !== null) { - $queryParams['start_date'] = ObjectSerializer::toQueryValue($startDate, 'date-time'); - } - // query params - if ($endDate !== null) { - $queryParams['end_date'] = ObjectSerializer::toQueryValue($endDate, 'date-time'); - } - // query params - if ($secret !== null) { - $queryParams['secret'] = ObjectSerializer::toQueryValue($secret, 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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiOrdersExportGet - * - * Get orders - * - * @param \DateTime $startDate startDate (required) - * @param \DateTime $endDate endDate (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\Order[] - */ - public function apiOrdersExportGet($startDate, $endDate) - { - list($response) = $this->apiOrdersExportGetWithHttpInfo($startDate, $endDate); - return $response; - } - - /** - * Operation apiOrdersExportGetWithHttpInfo - * - * Get orders - * - * @param \DateTime $startDate (required) - * @param \DateTime $endDate (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 apiOrdersExportGetWithHttpInfo($startDate, $endDate) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Order[]'; - $request = $this->apiOrdersExportGetRequest($startDate, $endDate); - - 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\Order[]', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiOrdersExportGetAsync - * - * Get orders - * - * @param \DateTime $startDate (required) - * @param \DateTime $endDate (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiOrdersExportGetAsync($startDate, $endDate) - { - return $this->apiOrdersExportGetAsyncWithHttpInfo($startDate, $endDate) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiOrdersExportGetAsyncWithHttpInfo - * - * Get orders - * - * @param \DateTime $startDate (required) - * @param \DateTime $endDate (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiOrdersExportGetAsyncWithHttpInfo($startDate, $endDate) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Order[]'; - $request = $this->apiOrdersExportGetRequest($startDate, $endDate); - - 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 'apiOrdersExportGet' - * - * @param \DateTime $startDate (required) - * @param \DateTime $endDate (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiOrdersExportGetRequest($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 apiOrdersExportGet' - ); - } - // 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' - ); - } - - $resourcePath = '/api/Orders/export'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - // query params - if ($startDate !== null) { - $queryParams['start_date'] = ObjectSerializer::toQueryValue($startDate, 'date-time'); - } - // query params - if ($endDate !== null) { - $queryParams['end_date'] = ObjectSerializer::toQueryValue($endDate, 'date-time'); - } - - - // 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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiOrdersGet - * - * Get orders - * - * @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) - { - list($response) = $this->apiOrdersGetWithHttpInfo($filter); - return $response; - } - - /** - * Operation apiOrdersGetWithHttpInfo - * - * 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 \Yoast\MyYoastApiClient\Model\Order[], HTTP status code, HTTP response headers (array of strings) - */ - public function apiOrdersGetWithHttpInfo($filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Order[]'; - $request = $this->apiOrdersGetRequest($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\Order[]', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiOrdersGetAsync - * - * Get orders - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiOrdersGetAsync($filter = null) - { - return $this->apiOrdersGetAsyncWithHttpInfo($filter) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiOrdersGetAsyncWithHttpInfo - * - * Get orders - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiOrdersGetAsyncWithHttpInfo($filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Order[]'; - $request = $this->apiOrdersGetRequest($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 'apiOrdersGet' - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiOrdersGetRequest($filter = null) - { - - $resourcePath = '/api/Orders'; - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiOrdersIdGet - * - * Get a order - * - * @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\Order - */ - public function apiOrdersIdGet($id, $filter = null) - { - list($response) = $this->apiOrdersIdGetWithHttpInfo($id, $filter); - return $response; - } - - /** - * Operation apiOrdersIdGetWithHttpInfo - * - * Get a order - * - * @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\Order, HTTP status code, HTTP response headers (array of strings) - */ - public function apiOrdersIdGetWithHttpInfo($id, $filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Order'; - $request = $this->apiOrdersIdGetRequest($id, $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\Order', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiOrdersIdGetAsync - * - * Get a order - * - * @param string $id (required) - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiOrdersIdGetAsync($id, $filter = null) - { - return $this->apiOrdersIdGetAsyncWithHttpInfo($id, $filter) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiOrdersIdGetAsyncWithHttpInfo - * - * Get a order - * - * @param string $id (required) - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiOrdersIdGetAsyncWithHttpInfo($id, $filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Order'; - $request = $this->apiOrdersIdGetRequest($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 'apiOrdersIdGet' - * - * @param string $id (required) - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiOrdersIdGetRequest($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' - ); - } - - $resourcePath = '/api/Orders/{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 ($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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiOrdersIdInvoiceGet - * - * Create invoice - * - * @param string $id id (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function apiOrdersIdInvoiceGet($id) - { - $this->apiOrdersIdInvoiceGetWithHttpInfo($id); - } - - /** - * Operation apiOrdersIdInvoiceGetWithHttpInfo - * - * Create invoice - * - * @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 apiOrdersIdInvoiceGetWithHttpInfo($id) - { - $returnType = ''; - $request = $this->apiOrdersIdInvoiceGetRequest($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() - ); - } - - return [null, $statusCode, $response->getHeaders()]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - } - throw $e; - } - } - - /** - * Operation apiOrdersIdInvoiceGetAsync - * - * Create invoice - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiOrdersIdInvoiceGetAsync($id) - { - return $this->apiOrdersIdInvoiceGetAsyncWithHttpInfo($id) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiOrdersIdInvoiceGetAsyncWithHttpInfo - * - * Create invoice - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiOrdersIdInvoiceGetAsyncWithHttpInfo($id) - { - $returnType = ''; - $request = $this->apiOrdersIdInvoiceGetRequest($id); - - 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 'apiOrdersIdInvoiceGet' - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiOrdersIdInvoiceGetRequest($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' - ); - } - - $resourcePath = '/api/Orders/{id}/invoice'; - $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( - [] - ); - } 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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiOrdersIdRefundsRefundIdInvoiceGet - * - * Creates a credit note - * - * @param string $id id (required) - * @param string $refundId refundId (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function apiOrdersIdRefundsRefundIdInvoiceGet($id, $refundId) - { - $this->apiOrdersIdRefundsRefundIdInvoiceGetWithHttpInfo($id, $refundId); - } - - /** - * Operation apiOrdersIdRefundsRefundIdInvoiceGetWithHttpInfo - * - * Creates a credit note - * - * @param string $id (required) - * @param string $refundId (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 apiOrdersIdRefundsRefundIdInvoiceGetWithHttpInfo($id, $refundId) - { - $returnType = ''; - $request = $this->apiOrdersIdRefundsRefundIdInvoiceGetRequest($id, $refundId); - - 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 apiOrdersIdRefundsRefundIdInvoiceGetAsync - * - * Creates a credit note - * - * @param string $id (required) - * @param string $refundId (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiOrdersIdRefundsRefundIdInvoiceGetAsync($id, $refundId) - { - return $this->apiOrdersIdRefundsRefundIdInvoiceGetAsyncWithHttpInfo($id, $refundId) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiOrdersIdRefundsRefundIdInvoiceGetAsyncWithHttpInfo - * - * Creates a credit note - * - * @param string $id (required) - * @param string $refundId (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiOrdersIdRefundsRefundIdInvoiceGetAsyncWithHttpInfo($id, $refundId) - { - $returnType = ''; - $request = $this->apiOrdersIdRefundsRefundIdInvoiceGetRequest($id, $refundId); - - 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 'apiOrdersIdRefundsRefundIdInvoiceGet' - * - * @param string $id (required) - * @param string $refundId (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiOrdersIdRefundsRefundIdInvoiceGetRequest($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' - ); - } - // 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' - ); - } - - $resourcePath = '/api/Orders/{id}/refunds/{refundId}/invoice'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - // path params - if ($id !== null) { - $resourcePath = str_replace( - '{' . 'id' . '}', - ObjectSerializer::toPathValue($id), - $resourcePath - ); - } - // path params - if ($refundId !== null) { - $resourcePath = str_replace( - '{' . 'refundId' . '}', - ObjectSerializer::toPathValue($refundId), - $resourcePath - ); - } - - // 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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiOrdersInvoiceNumberInvoiceNumberGet - * - * Get a order by invoiceNumber - * - * @param string $invoiceNumber invoiceNumber (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\Order - */ - public function apiOrdersInvoiceNumberInvoiceNumberGet($invoiceNumber) - { - list($response) = $this->apiOrdersInvoiceNumberInvoiceNumberGetWithHttpInfo($invoiceNumber); - return $response; - } - - /** - * Operation apiOrdersInvoiceNumberInvoiceNumberGetWithHttpInfo - * - * Get a order by invoiceNumber - * - * @param string $invoiceNumber (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 apiOrdersInvoiceNumberInvoiceNumberGetWithHttpInfo($invoiceNumber) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Order'; - $request = $this->apiOrdersInvoiceNumberInvoiceNumberGetRequest($invoiceNumber); - - 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\Order', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiOrdersInvoiceNumberInvoiceNumberGetAsync - * - * Get a order by invoiceNumber - * - * @param string $invoiceNumber (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiOrdersInvoiceNumberInvoiceNumberGetAsync($invoiceNumber) - { - return $this->apiOrdersInvoiceNumberInvoiceNumberGetAsyncWithHttpInfo($invoiceNumber) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiOrdersInvoiceNumberInvoiceNumberGetAsyncWithHttpInfo - * - * Get a order by invoiceNumber - * - * @param string $invoiceNumber (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiOrdersInvoiceNumberInvoiceNumberGetAsyncWithHttpInfo($invoiceNumber) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Order'; - $request = $this->apiOrdersInvoiceNumberInvoiceNumberGetRequest($invoiceNumber); - - 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 'apiOrdersInvoiceNumberInvoiceNumberGet' - * - * @param string $invoiceNumber (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiOrdersInvoiceNumberInvoiceNumberGetRequest($invoiceNumber) - { - // verify the required parameter 'invoiceNumber' is set - if ($invoiceNumber === null || (is_array($invoiceNumber) && count($invoiceNumber) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $invoiceNumber when calling apiOrdersInvoiceNumberInvoiceNumberGet' - ); - } - - $resourcePath = '/api/Orders/InvoiceNumber/{invoiceNumber}'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - // path params - if ($invoiceNumber !== null) { - $resourcePath = str_replace( - '{' . 'invoiceNumber' . '}', - ObjectSerializer::toPathValue($invoiceNumber), - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiOrdersPagedGet - * - * 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 apiOrdersPagedGet($filter = null) - { - $this->apiOrdersPagedGetWithHttpInfo($filter); - } - - /** - * Operation apiOrdersPagedGetWithHttpInfo - * - * 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 apiOrdersPagedGetWithHttpInfo($filter = null) - { - $returnType = ''; - $request = $this->apiOrdersPagedGetRequest($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 apiOrdersPagedGetAsync - * - * Get orders - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiOrdersPagedGetAsync($filter = null) - { - return $this->apiOrdersPagedGetAsyncWithHttpInfo($filter) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiOrdersPagedGetAsyncWithHttpInfo - * - * Get orders - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiOrdersPagedGetAsyncWithHttpInfo($filter = null) - { - $returnType = ''; - $request = $this->apiOrdersPagedGetRequest($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 'apiOrdersPagedGet' - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiOrdersPagedGetRequest($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) { - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiOrdersProductGroupsInvoiceNumberGet - * - * Get productGroups by invoiceNumber - * - * @param string $invoiceNumber invoiceNumber (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\ProductGroup[] - */ - public function apiOrdersProductGroupsInvoiceNumberGet($invoiceNumber) - { - list($response) = $this->apiOrdersProductGroupsInvoiceNumberGetWithHttpInfo($invoiceNumber); - return $response; - } - - /** - * Operation apiOrdersProductGroupsInvoiceNumberGetWithHttpInfo - * - * Get productGroups by invoiceNumber - * - * @param string $invoiceNumber (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) - */ - public function apiOrdersProductGroupsInvoiceNumberGetWithHttpInfo($invoiceNumber) - { - $returnType = '\Yoast\MyYoastApiClient\Model\ProductGroup[]'; - $request = $this->apiOrdersProductGroupsInvoiceNumberGetRequest($invoiceNumber); - - 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\ProductGroup[]', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiOrdersProductGroupsInvoiceNumberGetAsync - * - * Get productGroups by invoiceNumber - * - * @param string $invoiceNumber (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiOrdersProductGroupsInvoiceNumberGetAsync($invoiceNumber) - { - return $this->apiOrdersProductGroupsInvoiceNumberGetAsyncWithHttpInfo($invoiceNumber) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiOrdersProductGroupsInvoiceNumberGetAsyncWithHttpInfo - * - * Get productGroups by invoiceNumber - * - * @param string $invoiceNumber (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiOrdersProductGroupsInvoiceNumberGetAsyncWithHttpInfo($invoiceNumber) - { - $returnType = '\Yoast\MyYoastApiClient\Model\ProductGroup[]'; - $request = $this->apiOrdersProductGroupsInvoiceNumberGetRequest($invoiceNumber); - - 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 'apiOrdersProductGroupsInvoiceNumberGet' - * - * @param string $invoiceNumber (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiOrdersProductGroupsInvoiceNumberGetRequest($invoiceNumber) - { - // verify the required parameter 'invoiceNumber' is set - if ($invoiceNumber === null || (is_array($invoiceNumber) && count($invoiceNumber) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $invoiceNumber when calling apiOrdersProductGroupsInvoiceNumberGet' - ); - } - - $resourcePath = '/api/Orders/productGroups/{invoiceNumber}'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - // path params - if ($invoiceNumber !== null) { - $resourcePath = str_replace( - '{' . 'invoiceNumber' . '}', - ObjectSerializer::toPathValue($invoiceNumber), - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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/PackagesApi.php b/src/Api/PackagesApi.php deleted file mode 100644 index cb98132..0000000 --- a/src/Api/PackagesApi.php +++ /dev/null @@ -1,1212 +0,0 @@ -client = $client ?: new Client(); - $this->config = $config ?: new Configuration(); - $this->headerSelector = $selector ?: new HeaderSelector(); - } - - /** - * @return Configuration - */ - public function getConfig() - { - return $this->config; - } - - /** - * Operation packagesDistOrgNameArchiveZipGet - * - * Serves an .zip of the plugin. - * - * @param string $org org (required) - * @param string $archive archive (required) - * @param string $name name (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return string - */ - public function packagesDistOrgNameArchiveZipGet($org, $archive, $name) - { - list($response) = $this->packagesDistOrgNameArchiveZipGetWithHttpInfo($org, $archive, $name); - return $response; - } - - /** - * Operation packagesDistOrgNameArchiveZipGetWithHttpInfo - * - * Serves an .zip of the plugin. - * - * @param string $org (required) - * @param string $archive (required) - * @param string $name (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 packagesDistOrgNameArchiveZipGetWithHttpInfo($org, $archive, $name) - { - $returnType = 'string'; - $request = $this->packagesDistOrgNameArchiveZipGetRequest($org, $archive, $name); - - 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 packagesDistOrgNameArchiveZipGetAsync - * - * Serves an .zip of the plugin. - * - * @param string $org (required) - * @param string $archive (required) - * @param string $name (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function packagesDistOrgNameArchiveZipGetAsync($org, $archive, $name) - { - return $this->packagesDistOrgNameArchiveZipGetAsyncWithHttpInfo($org, $archive, $name) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation packagesDistOrgNameArchiveZipGetAsyncWithHttpInfo - * - * Serves an .zip of the plugin. - * - * @param string $org (required) - * @param string $archive (required) - * @param string $name (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function packagesDistOrgNameArchiveZipGetAsyncWithHttpInfo($org, $archive, $name) - { - $returnType = 'string'; - $request = $this->packagesDistOrgNameArchiveZipGetRequest($org, $archive, $name); - - 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 'packagesDistOrgNameArchiveZipGet' - * - * @param string $org (required) - * @param string $archive (required) - * @param string $name (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function packagesDistOrgNameArchiveZipGetRequest($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' - ); - } - // 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' - ); - } - // 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' - ); - } - - $resourcePath = '/packages/dist/{org}/{name}/{archive}.zip'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - // path params - if ($org !== null) { - $resourcePath = str_replace( - '{' . 'org' . '}', - ObjectSerializer::toPathValue($org), - $resourcePath - ); - } - // path params - if ($archive !== null) { - $resourcePath = str_replace( - '{' . 'archive' . '}', - ObjectSerializer::toPathValue($archive), - $resourcePath - ); - } - // path params - if ($name !== null) { - $resourcePath = str_replace( - '{' . 'name' . '}', - ObjectSerializer::toPathValue($name), - $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); - } - } - - - $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 packagesP2OrgNameJsonGet - * - * Serves the requested provider.json - * - * @param string $org org (required) - * @param string $name The package name, optionally suffixed with -dev (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return string - */ - public function packagesP2OrgNameJsonGet($org, $name) - { - list($response) = $this->packagesP2OrgNameJsonGetWithHttpInfo($org, $name); - return $response; - } - - /** - * Operation packagesP2OrgNameJsonGetWithHttpInfo - * - * Serves the requested provider.json - * - * @param string $org (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 string, HTTP status code, HTTP response headers (array of strings) - */ - public function packagesP2OrgNameJsonGetWithHttpInfo($org, $name) - { - $returnType = 'string'; - $request = $this->packagesP2OrgNameJsonGetRequest($org, $name); - - 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 packagesP2OrgNameJsonGetAsync - * - * Serves the requested provider.json - * - * @param string $org (required) - * @param string $name The package name, optionally suffixed with -dev (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function packagesP2OrgNameJsonGetAsync($org, $name) - { - return $this->packagesP2OrgNameJsonGetAsyncWithHttpInfo($org, $name) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation packagesP2OrgNameJsonGetAsyncWithHttpInfo - * - * Serves the requested provider.json - * - * @param string $org (required) - * @param string $name The package name, optionally suffixed with -dev (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function packagesP2OrgNameJsonGetAsyncWithHttpInfo($org, $name) - { - $returnType = 'string'; - $request = $this->packagesP2OrgNameJsonGetRequest($org, $name); - - 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 'packagesP2OrgNameJsonGet' - * - * @param string $org (required) - * @param string $name The package name, optionally suffixed with -dev (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function packagesP2OrgNameJsonGetRequest($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 packagesP2OrgNameJsonGet' - ); - } - // 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 packagesP2OrgNameJsonGet' - ); - } - - $resourcePath = '/packages/p2/{org}/{name}.json'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - // path params - if ($org !== null) { - $resourcePath = str_replace( - '{' . 'org' . '}', - ObjectSerializer::toPathValue($org), - $resourcePath - ); - } - // path params - if ($name !== null) { - $resourcePath = str_replace( - '{' . 'name' . '}', - ObjectSerializer::toPathValue($name), - $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); - } - } - - - $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 packagesPOrgNameAndHashJsonGet - * - * 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 string - */ - public function packagesPOrgNameAndHashJsonGet($org, $nameAndHash) - { - list($response) = $this->packagesPOrgNameAndHashJsonGetWithHttpInfo($org, $nameAndHash); - return $response; - } - - /** - * Operation packagesPOrgNameAndHashJsonGetWithHttpInfo - * - * 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 string, HTTP status code, HTTP response headers (array of strings) - */ - public function packagesPOrgNameAndHashJsonGetWithHttpInfo($org, $nameAndHash) - { - $returnType = 'string'; - $request = $this->packagesPOrgNameAndHashJsonGetRequest($org, $nameAndHash); - - 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 packagesPOrgNameAndHashJsonGetAsync - * - * 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 packagesPOrgNameAndHashJsonGetAsync($org, $nameAndHash) - { - return $this->packagesPOrgNameAndHashJsonGetAsyncWithHttpInfo($org, $nameAndHash) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation packagesPOrgNameAndHashJsonGetAsyncWithHttpInfo - * - * 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 packagesPOrgNameAndHashJsonGetAsyncWithHttpInfo($org, $nameAndHash) - { - $returnType = 'string'; - $request = $this->packagesPOrgNameAndHashJsonGetRequest($org, $nameAndHash); - - 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 'packagesPOrgNameAndHashJsonGet' - * - * @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 packagesPOrgNameAndHashJsonGetRequest($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 packagesPOrgNameAndHashJsonGet' - ); - } - // 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 packagesPOrgNameAndHashJsonGet' - ); - } - - $resourcePath = '/packages/p/{org}/{nameAndHash}.json'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $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; - - 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); - } - } - - - $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 packagesPackagesJsonGet - * - * Serves the general packages.json file. - * - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return string - */ - public function packagesPackagesJsonGet() - { - list($response) = $this->packagesPackagesJsonGetWithHttpInfo(); - return $response; - } - - /** - * Operation packagesPackagesJsonGetWithHttpInfo - * - * 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 packagesPackagesJsonGetWithHttpInfo() - { - $returnType = 'string'; - $request = $this->packagesPackagesJsonGetRequest(); - - 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 packagesPackagesJsonGetAsync - * - * Serves the general packages.json file. - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function packagesPackagesJsonGetAsync() - { - return $this->packagesPackagesJsonGetAsyncWithHttpInfo() - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation packagesPackagesJsonGetAsyncWithHttpInfo - * - * Serves the general packages.json file. - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function packagesPackagesJsonGetAsyncWithHttpInfo() - { - $returnType = 'string'; - $request = $this->packagesPackagesJsonGetRequest(); - - 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 'packagesPackagesJsonGet' - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function packagesPackagesJsonGetRequest() - { - - $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 = []; - 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); - } - } - - - $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/ProductApi.php b/src/Api/ProductApi.php deleted file mode 100644 index 671a1c8..0000000 --- a/src/Api/ProductApi.php +++ /dev/null @@ -1,1062 +0,0 @@ -client = $client ?: new Client(); - $this->config = $config ?: new Configuration(); - $this->headerSelector = $selector ?: new HeaderSelector(); - } - - /** - * @return Configuration - */ - public function getConfig() - { - return $this->config; - } - - /** - * Operation apiProductsGet - * - * Get products - * - * @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[] - */ - public function apiProductsGet($filter = null) - { - list($response) = $this->apiProductsGetWithHttpInfo($filter); - return $response; - } - - /** - * Operation apiProductsGetWithHttpInfo - * - * Get products - * - * @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) - */ - public function apiProductsGetWithHttpInfo($filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Product[]'; - $request = $this->apiProductsGetRequest($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\Product[]', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiProductsGetAsync - * - * Get products - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiProductsGetAsync($filter = null) - { - return $this->apiProductsGetAsyncWithHttpInfo($filter) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiProductsGetAsyncWithHttpInfo - * - * Get products - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiProductsGetAsyncWithHttpInfo($filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Product[]'; - $request = $this->apiProductsGetRequest($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 'apiProductsGet' - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiProductsGetRequest($filter = null) - { - - $resourcePath = '/api/Products'; - $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); - } - } - - - $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 apiProductsIdGet - * - * 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 \Yoast\MyYoastApiClient\Model\Product - */ - public function apiProductsIdGet($id, $filter = null) - { - list($response) = $this->apiProductsIdGetWithHttpInfo($id, $filter); - return $response; - } - - /** - * Operation apiProductsIdGetWithHttpInfo - * - * 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 \Yoast\MyYoastApiClient\Model\Product, HTTP status code, HTTP response headers (array of strings) - */ - public function apiProductsIdGetWithHttpInfo($id, $filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Product'; - $request = $this->apiProductsIdGetRequest($id, $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\Product', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiProductsIdGetAsync - * - * 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 apiProductsIdGetAsync($id, $filter = null) - { - return $this->apiProductsIdGetAsyncWithHttpInfo($id, $filter) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiProductsIdGetAsyncWithHttpInfo - * - * 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 apiProductsIdGetAsyncWithHttpInfo($id, $filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Product'; - $request = $this->apiProductsIdGetRequest($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 'apiProductsIdGet' - * - * @param string $id (required) - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiProductsIdGetRequest($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 apiProductsIdGet' - ); - } - - $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) { - $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); - } - } - - - $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 apiProductsProductIdDelete - * - * @param string $id id (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function apiProductsProductIdDelete($id) - { - $this->apiProductsProductIdDeleteWithHttpInfo($id); - } - - /** - * Operation apiProductsProductIdDeleteWithHttpInfo - * - * @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 apiProductsProductIdDeleteWithHttpInfo($id) - { - $returnType = ''; - $request = $this->apiProductsProductIdDeleteRequest($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() - ); - } - - return [null, $statusCode, $response->getHeaders()]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - } - throw $e; - } - } - - /** - * Operation apiProductsProductIdDeleteAsync - * - * - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiProductsProductIdDeleteAsync($id) - { - return $this->apiProductsProductIdDeleteAsyncWithHttpInfo($id) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiProductsProductIdDeleteAsyncWithHttpInfo - * - * - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiProductsProductIdDeleteAsyncWithHttpInfo($id) - { - $returnType = ''; - $request = $this->apiProductsProductIdDeleteRequest($id); - - 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 'apiProductsProductIdDelete' - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiProductsProductIdDeleteRequest($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 apiProductsProductIdDelete' - ); - } - - $resourcePath = '/api/Products/{productId}'; - $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( - [] - ); - } 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); - } - } - - - $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 apiProductsWordpressPluginVersionDetailsGet - * - * @param string $password password (optional) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function apiProductsWordpressPluginVersionDetailsGet($password = null) - { - $this->apiProductsWordpressPluginVersionDetailsGetWithHttpInfo($password); - } - - /** - * Operation apiProductsWordpressPluginVersionDetailsGetWithHttpInfo - * - * @param string $password (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 apiProductsWordpressPluginVersionDetailsGetWithHttpInfo($password = null) - { - $returnType = ''; - $request = $this->apiProductsWordpressPluginVersionDetailsGetRequest($password); - - 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 apiProductsWordpressPluginVersionDetailsGetAsync - * - * - * - * @param string $password (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiProductsWordpressPluginVersionDetailsGetAsync($password = null) - { - return $this->apiProductsWordpressPluginVersionDetailsGetAsyncWithHttpInfo($password) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiProductsWordpressPluginVersionDetailsGetAsyncWithHttpInfo - * - * - * - * @param string $password (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiProductsWordpressPluginVersionDetailsGetAsyncWithHttpInfo($password = null) - { - $returnType = ''; - $request = $this->apiProductsWordpressPluginVersionDetailsGetRequest($password); - - 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 'apiProductsWordpressPluginVersionDetailsGet' - * - * @param string $password (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiProductsWordpressPluginVersionDetailsGetRequest($password = null) - { - - $resourcePath = '/api/Products/wordpressPluginVersionDetails'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - // query params - if ($password !== null) { - $queryParams['password'] = ObjectSerializer::toQueryValue($password, 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); - } - } - - - $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/ProductGroupApi.php b/src/Api/ProductGroupApi.php deleted file mode 100644 index 7ac8594..0000000 --- a/src/Api/ProductGroupApi.php +++ /dev/null @@ -1,626 +0,0 @@ -client = $client ?: new Client(); - $this->config = $config ?: new Configuration(); - $this->headerSelector = $selector ?: new HeaderSelector(); - } - - /** - * @return Configuration - */ - public function getConfig() - { - return $this->config; - } - - /** - * Operation apiProductGroupsGet - * - * Get productgroups - * - * @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) - { - list($response) = $this->apiProductGroupsGetWithHttpInfo($filter); - return $response; - } - - /** - * Operation apiProductGroupsGetWithHttpInfo - * - * Get productgroups - * - * @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) - { - $returnType = '\Yoast\MyYoastApiClient\Model\ProductGroup[]'; - $request = $this->apiProductGroupsGetRequest($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\ProductGroup[]', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiProductGroupsGetAsync - * - * Get productgroups - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiProductGroupsGetAsync($filter = null) - { - return $this->apiProductGroupsGetAsyncWithHttpInfo($filter) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiProductGroupsGetAsyncWithHttpInfo - * - * Get productgroups - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiProductGroupsGetAsyncWithHttpInfo($filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\ProductGroup[]'; - $request = $this->apiProductGroupsGetRequest($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 'apiProductGroupsGet' - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiProductGroupsGetRequest($filter = null) - { - - $resourcePath = '/api/ProductGroups'; - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiProductGroupsUpdateDownloadPatch - * - * Update the download - * - * @param \Yoast\MyYoastApiClient\Model\UpdateDownloadDto $body body (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\ProductGroup - */ - public function apiProductGroupsUpdateDownloadPatch($body) - { - list($response) = $this->apiProductGroupsUpdateDownloadPatchWithHttpInfo($body); - return $response; - } - - /** - * Operation apiProductGroupsUpdateDownloadPatchWithHttpInfo - * - * Update the download - * - * @param \Yoast\MyYoastApiClient\Model\UpdateDownloadDto $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) - */ - public function apiProductGroupsUpdateDownloadPatchWithHttpInfo($body) - { - $returnType = '\Yoast\MyYoastApiClient\Model\ProductGroup'; - $request = $this->apiProductGroupsUpdateDownloadPatchRequest($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\ProductGroup', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiProductGroupsUpdateDownloadPatchAsync - * - * Update the download - * - * @param \Yoast\MyYoastApiClient\Model\UpdateDownloadDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiProductGroupsUpdateDownloadPatchAsync($body) - { - return $this->apiProductGroupsUpdateDownloadPatchAsyncWithHttpInfo($body) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiProductGroupsUpdateDownloadPatchAsyncWithHttpInfo - * - * Update the download - * - * @param \Yoast\MyYoastApiClient\Model\UpdateDownloadDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiProductGroupsUpdateDownloadPatchAsyncWithHttpInfo($body) - { - $returnType = '\Yoast\MyYoastApiClient\Model\ProductGroup'; - $request = $this->apiProductGroupsUpdateDownloadPatchRequest($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 'apiProductGroupsUpdateDownloadPatch' - * - * @param \Yoast\MyYoastApiClient\Model\UpdateDownloadDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiProductGroupsUpdateDownloadPatchRequest($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 apiProductGroupsUpdateDownloadPatch' - ); - } - - $resourcePath = '/api/ProductGroups/updateDownload'; - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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( - 'PATCH', - $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/ProvisionerApi.php b/src/Api/ProvisionerApi.php deleted file mode 100644 index 8e43e3b..0000000 --- a/src/Api/ProvisionerApi.php +++ /dev/null @@ -1,622 +0,0 @@ -client = $client ?: new Client(); - $this->config = $config ?: new Configuration(); - $this->headerSelector = $selector ?: new HeaderSelector(); - } - - /** - * @return Configuration - */ - public function getConfig() - { - return $this->config; - } - - /** - * Operation apiProvisionerDataGet - * - * Get provisioner data - * - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\ProvisionerData[] - */ - public function apiProvisionerDataGet() - { - list($response) = $this->apiProvisionerDataGetWithHttpInfo(); - return $response; - } - - /** - * Operation apiProvisionerDataGetWithHttpInfo - * - * 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 apiProvisionerDataGetWithHttpInfo() - { - $returnType = '\Yoast\MyYoastApiClient\Model\ProvisionerData[]'; - $request = $this->apiProvisionerDataGetRequest(); - - 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 apiProvisionerDataGetAsync - * - * Get provisioner data - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiProvisionerDataGetAsync() - { - return $this->apiProvisionerDataGetAsyncWithHttpInfo() - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiProvisionerDataGetAsyncWithHttpInfo - * - * Get provisioner data - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiProvisionerDataGetAsyncWithHttpInfo() - { - $returnType = '\Yoast\MyYoastApiClient\Model\ProvisionerData[]'; - $request = $this->apiProvisionerDataGetRequest(); - - 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 'apiProvisionerDataGet' - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiProvisionerDataGetRequest() - { - - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiProvisionerDataIdGet - * - * 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 apiProvisionerDataIdGet($id) - { - list($response) = $this->apiProvisionerDataIdGetWithHttpInfo($id); - return $response; - } - - /** - * Operation apiProvisionerDataIdGetWithHttpInfo - * - * 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 apiProvisionerDataIdGetWithHttpInfo($id) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Subscription'; - $request = $this->apiProvisionerDataIdGetRequest($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 apiProvisionerDataIdGetAsync - * - * Get provisioner data - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiProvisionerDataIdGetAsync($id) - { - return $this->apiProvisionerDataIdGetAsyncWithHttpInfo($id) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiProvisionerDataIdGetAsyncWithHttpInfo - * - * Get provisioner data - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiProvisionerDataIdGetAsyncWithHttpInfo($id) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Subscription'; - $request = $this->apiProvisionerDataIdGetRequest($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 'apiProvisionerDataIdGet' - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiProvisionerDataIdGetRequest($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 apiProvisionerDataIdGet' - ); - } - - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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/ProvisioningAccountApi.php b/src/Api/ProvisioningAccountApi.php deleted file mode 100644 index f9b899a..0000000 --- a/src/Api/ProvisioningAccountApi.php +++ /dev/null @@ -1,350 +0,0 @@ -client = $client ?: new Client(); - $this->config = $config ?: new Configuration(); - $this->headerSelector = $selector ?: new HeaderSelector(); - } - - /** - * @return Configuration - */ - public function getConfig() - { - return $this->config; - } - - /** - * Operation apiProvisioningAccountRegenerateTokenPost - * - * Generate a new auth token - * - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\RegenerateTokenResponseDto - */ - public function apiProvisioningAccountRegenerateTokenPost() - { - list($response) = $this->apiProvisioningAccountRegenerateTokenPostWithHttpInfo(); - return $response; - } - - /** - * Operation apiProvisioningAccountRegenerateTokenPostWithHttpInfo - * - * Generate a new auth token - * - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return array of \Yoast\MyYoastApiClient\Model\RegenerateTokenResponseDto, HTTP status code, HTTP response headers (array of strings) - */ - public function apiProvisioningAccountRegenerateTokenPostWithHttpInfo() - { - $returnType = '\Yoast\MyYoastApiClient\Model\RegenerateTokenResponseDto'; - $request = $this->apiProvisioningAccountRegenerateTokenPostRequest(); - - 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\RegenerateTokenResponseDto', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiProvisioningAccountRegenerateTokenPostAsync - * - * Generate a new auth token - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiProvisioningAccountRegenerateTokenPostAsync() - { - return $this->apiProvisioningAccountRegenerateTokenPostAsyncWithHttpInfo() - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiProvisioningAccountRegenerateTokenPostAsyncWithHttpInfo - * - * Generate a new auth token - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiProvisioningAccountRegenerateTokenPostAsyncWithHttpInfo() - { - $returnType = '\Yoast\MyYoastApiClient\Model\RegenerateTokenResponseDto'; - $request = $this->apiProvisioningAccountRegenerateTokenPostRequest(); - - 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 'apiProvisioningAccountRegenerateTokenPost' - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiProvisioningAccountRegenerateTokenPostRequest() - { - - $resourcePath = '/api/provisioning/account/regenerate-token'; - $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); - } - } - - - $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/ProvisioningDownloadsApi.php b/src/Api/ProvisioningDownloadsApi.php deleted file mode 100644 index 3d6617d..0000000 --- a/src/Api/ProvisioningDownloadsApi.php +++ /dev/null @@ -1,586 +0,0 @@ -client = $client ?: new Client(); - $this->config = $config ?: new Configuration(); - $this->headerSelector = $selector ?: new HeaderSelector(); - } - - /** - * @return Configuration - */ - public function getConfig() - { - return $this->config; - } - - /** - * Operation apiProvisioningDownloadsCurrentVersionGet - * - * Retrieve the current version for the productCode for the provisioner. - * - * @param string $productCode The code used to create the product. (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return string - */ - public function apiProvisioningDownloadsCurrentVersionGet($productCode) - { - list($response) = $this->apiProvisioningDownloadsCurrentVersionGetWithHttpInfo($productCode); - return $response; - } - - /** - * Operation apiProvisioningDownloadsCurrentVersionGetWithHttpInfo - * - * Retrieve the current version for the productCode for the provisioner. - * - * @param string $productCode The code used to create the product. (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 apiProvisioningDownloadsCurrentVersionGetWithHttpInfo($productCode) - { - $returnType = 'string'; - $request = $this->apiProvisioningDownloadsCurrentVersionGetRequest($productCode); - - 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 apiProvisioningDownloadsCurrentVersionGetAsync - * - * Retrieve the current version for the productCode for the provisioner. - * - * @param string $productCode The code used to create the product. (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiProvisioningDownloadsCurrentVersionGetAsync($productCode) - { - return $this->apiProvisioningDownloadsCurrentVersionGetAsyncWithHttpInfo($productCode) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiProvisioningDownloadsCurrentVersionGetAsyncWithHttpInfo - * - * Retrieve the current version for the productCode for the provisioner. - * - * @param string $productCode The code used to create the product. (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiProvisioningDownloadsCurrentVersionGetAsyncWithHttpInfo($productCode) - { - $returnType = 'string'; - $request = $this->apiProvisioningDownloadsCurrentVersionGetRequest($productCode); - - 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 'apiProvisioningDownloadsCurrentVersionGet' - * - * @param string $productCode The code used to create the product. (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiProvisioningDownloadsCurrentVersionGetRequest($productCode) - { - // verify the required parameter 'productCode' is set - if ($productCode === null || (is_array($productCode) && count($productCode) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $productCode when calling apiProvisioningDownloadsCurrentVersionGet' - ); - } - - $resourcePath = '/api/provisioning/downloads/currentVersion'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - // query params - if ($productCode !== null) { - $queryParams['productCode'] = ObjectSerializer::toQueryValue($productCode, 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); - } - } - - - $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 apiProvisioningDownloadsCurrentZipGet - * - * Redirect to the current zip for the productCode. - * - * @param string $productCode The code used to create the product. (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function apiProvisioningDownloadsCurrentZipGet($productCode) - { - $this->apiProvisioningDownloadsCurrentZipGetWithHttpInfo($productCode); - } - - /** - * Operation apiProvisioningDownloadsCurrentZipGetWithHttpInfo - * - * Redirect to the current zip for the productCode. - * - * @param string $productCode The code used to create the product. (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 apiProvisioningDownloadsCurrentZipGetWithHttpInfo($productCode) - { - $returnType = ''; - $request = $this->apiProvisioningDownloadsCurrentZipGetRequest($productCode); - - 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 apiProvisioningDownloadsCurrentZipGetAsync - * - * Redirect to the current zip for the productCode. - * - * @param string $productCode The code used to create the product. (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiProvisioningDownloadsCurrentZipGetAsync($productCode) - { - return $this->apiProvisioningDownloadsCurrentZipGetAsyncWithHttpInfo($productCode) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiProvisioningDownloadsCurrentZipGetAsyncWithHttpInfo - * - * Redirect to the current zip for the productCode. - * - * @param string $productCode The code used to create the product. (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiProvisioningDownloadsCurrentZipGetAsyncWithHttpInfo($productCode) - { - $returnType = ''; - $request = $this->apiProvisioningDownloadsCurrentZipGetRequest($productCode); - - 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 'apiProvisioningDownloadsCurrentZipGet' - * - * @param string $productCode The code used to create the product. (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiProvisioningDownloadsCurrentZipGetRequest($productCode) - { - // verify the required parameter 'productCode' is set - if ($productCode === null || (is_array($productCode) && count($productCode) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $productCode when calling apiProvisioningDownloadsCurrentZipGet' - ); - } - - $resourcePath = '/api/provisioning/downloads/currentZip'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - // query params - if ($productCode !== null) { - $queryParams['productCode'] = ObjectSerializer::toQueryValue($productCode, 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); - } - } - - - $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/ProvisioningUsersApi.php b/src/Api/ProvisioningUsersApi.php deleted file mode 100644 index ca3b9ea..0000000 --- a/src/Api/ProvisioningUsersApi.php +++ /dev/null @@ -1,364 +0,0 @@ -client = $client ?: new Client(); - $this->config = $config ?: new Configuration(); - $this->headerSelector = $selector ?: new HeaderSelector(); - } - - /** - * @return Configuration - */ - public function getConfig() - { - return $this->config; - } - - /** - * Operation apiProvisioningUserScheduleDeletePost - * - * Schedule a delete for a subscription - * - * @param \Yoast\MyYoastApiClient\Model\ScheduleDeleteUserDto $body body (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto - */ - public function apiProvisioningUserScheduleDeletePost($body) - { - list($response) = $this->apiProvisioningUserScheduleDeletePostWithHttpInfo($body); - return $response; - } - - /** - * Operation apiProvisioningUserScheduleDeletePostWithHttpInfo - * - * Schedule a delete for a subscription - * - * @param \Yoast\MyYoastApiClient\Model\ScheduleDeleteUserDto $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 apiProvisioningUserScheduleDeletePostWithHttpInfo($body) - { - $returnType = '\Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto'; - $request = $this->apiProvisioningUserScheduleDeletePostRequest($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 apiProvisioningUserScheduleDeletePostAsync - * - * Schedule a delete for a subscription - * - * @param \Yoast\MyYoastApiClient\Model\ScheduleDeleteUserDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiProvisioningUserScheduleDeletePostAsync($body) - { - return $this->apiProvisioningUserScheduleDeletePostAsyncWithHttpInfo($body) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiProvisioningUserScheduleDeletePostAsyncWithHttpInfo - * - * Schedule a delete for a subscription - * - * @param \Yoast\MyYoastApiClient\Model\ScheduleDeleteUserDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiProvisioningUserScheduleDeletePostAsyncWithHttpInfo($body) - { - $returnType = '\Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto'; - $request = $this->apiProvisioningUserScheduleDeletePostRequest($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 'apiProvisioningUserScheduleDeletePost' - * - * @param \Yoast\MyYoastApiClient\Model\ScheduleDeleteUserDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiProvisioningUserScheduleDeletePostRequest($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 apiProvisioningUserScheduleDeletePost' - ); - } - - $resourcePath = '/api/provisioning/user/schedule-delete'; - $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); - } - } - - - $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/RefundApi.php b/src/Api/RefundApi.php deleted file mode 100644 index 8d54d6f..0000000 --- a/src/Api/RefundApi.php +++ /dev/null @@ -1,918 +0,0 @@ -client = $client ?: new Client(); - $this->config = $config ?: new Configuration(); - $this->headerSelector = $selector ?: new HeaderSelector(); - } - - /** - * @return Configuration - */ - public function getConfig() - { - return $this->config; - } - - /** - * Operation apiRefundsExportGet - * - * Get refunds - * - * @param \DateTime $startDate startDate (required) - * @param \DateTime $endDate endDate (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\Refund[] - */ - public function apiRefundsExportGet($startDate, $endDate) - { - list($response) = $this->apiRefundsExportGetWithHttpInfo($startDate, $endDate); - return $response; - } - - /** - * Operation apiRefundsExportGetWithHttpInfo - * - * Get refunds - * - * @param \DateTime $startDate (required) - * @param \DateTime $endDate (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 apiRefundsExportGetWithHttpInfo($startDate, $endDate) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Refund[]'; - $request = $this->apiRefundsExportGetRequest($startDate, $endDate); - - 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 apiRefundsExportGetAsync - * - * Get refunds - * - * @param \DateTime $startDate (required) - * @param \DateTime $endDate (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiRefundsExportGetAsync($startDate, $endDate) - { - return $this->apiRefundsExportGetAsyncWithHttpInfo($startDate, $endDate) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiRefundsExportGetAsyncWithHttpInfo - * - * Get refunds - * - * @param \DateTime $startDate (required) - * @param \DateTime $endDate (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiRefundsExportGetAsyncWithHttpInfo($startDate, $endDate) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Refund[]'; - $request = $this->apiRefundsExportGetRequest($startDate, $endDate); - - 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 'apiRefundsExportGet' - * - * @param \DateTime $startDate (required) - * @param \DateTime $endDate (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiRefundsExportGetRequest($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' - ); - } - // 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' - ); - } - - $resourcePath = '/api/Refunds/export'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - // query params - if ($startDate !== null) { - $queryParams['start_date'] = ObjectSerializer::toQueryValue($startDate, 'date-time'); - } - // query params - if ($endDate !== null) { - $queryParams['end_date'] = ObjectSerializer::toQueryValue($endDate, 'date-time'); - } - - - // 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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiRefundsGet - * - * Get refunds - * - * @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) - { - list($response) = $this->apiRefundsGetWithHttpInfo($filter); - return $response; - } - - /** - * Operation apiRefundsGetWithHttpInfo - * - * Get refunds - * - * @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) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Refund[]'; - $request = $this->apiRefundsGetRequest($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\Refund[]', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiRefundsGetAsync - * - * Get refunds - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiRefundsGetAsync($filter = null) - { - return $this->apiRefundsGetAsyncWithHttpInfo($filter) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiRefundsGetAsyncWithHttpInfo - * - * Get refunds - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiRefundsGetAsyncWithHttpInfo($filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Refund[]'; - $request = $this->apiRefundsGetRequest($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 'apiRefundsGet' - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiRefundsGetRequest($filter = null) - { - - $resourcePath = '/api/Refunds'; - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiRefundsIdGet - * - * Get a refund - * - * @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\Refund - */ - public function apiRefundsIdGet($id, $filter = null) - { - list($response) = $this->apiRefundsIdGetWithHttpInfo($id, $filter); - return $response; - } - - /** - * Operation apiRefundsIdGetWithHttpInfo - * - * Get a refund - * - * @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\Refund, HTTP status code, HTTP response headers (array of strings) - */ - public function apiRefundsIdGetWithHttpInfo($id, $filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Refund'; - $request = $this->apiRefundsIdGetRequest($id, $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\Refund', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiRefundsIdGetAsync - * - * Get a refund - * - * @param string $id (required) - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiRefundsIdGetAsync($id, $filter = null) - { - return $this->apiRefundsIdGetAsyncWithHttpInfo($id, $filter) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiRefundsIdGetAsyncWithHttpInfo - * - * Get a refund - * - * @param string $id (required) - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiRefundsIdGetAsyncWithHttpInfo($id, $filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Refund'; - $request = $this->apiRefundsIdGetRequest($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 'apiRefundsIdGet' - * - * @param string $id (required) - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiRefundsIdGetRequest($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' - ); - } - - $resourcePath = '/api/Refunds/{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 ($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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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/RobotsApi.php b/src/Api/RobotsApi.php deleted file mode 100644 index 0691473..0000000 --- a/src/Api/RobotsApi.php +++ /dev/null @@ -1,346 +0,0 @@ -client = $client ?: new Client(); - $this->config = $config ?: new Configuration(); - $this->headerSelector = $selector ?: new HeaderSelector(); - } - - /** - * @return Configuration - */ - public function getConfig() - { - return $this->config; - } - - /** - * Operation robotsTxtGet - * - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return string - */ - public function robotsTxtGet() - { - list($response) = $this->robotsTxtGetWithHttpInfo(); - return $response; - } - - /** - * Operation robotsTxtGetWithHttpInfo - * - * - * @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 robotsTxtGetWithHttpInfo() - { - $returnType = 'string'; - $request = $this->robotsTxtGetRequest(); - - 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 robotsTxtGetAsync - * - * - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function robotsTxtGetAsync() - { - return $this->robotsTxtGetAsyncWithHttpInfo() - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation robotsTxtGetAsyncWithHttpInfo - * - * - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function robotsTxtGetAsyncWithHttpInfo() - { - $returnType = 'string'; - $request = $this->robotsTxtGetRequest(); - - 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 'robotsTxtGet' - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function robotsTxtGetRequest() - { - - $resourcePath = '/robots.txt'; - $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); - } - } - - - $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/ServerCheckApi.php b/src/Api/ServerCheckApi.php deleted file mode 100644 index a9b2010..0000000 --- a/src/Api/ServerCheckApi.php +++ /dev/null @@ -1,350 +0,0 @@ -client = $client ?: new Client(); - $this->config = $config ?: new Configuration(); - $this->headerSelector = $selector ?: new HeaderSelector(); - } - - /** - * @return Configuration - */ - public function getConfig() - { - return $this->config; - } - - /** - * Operation serverCheckGet - * - * Server health check - * - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return string - */ - public function serverCheckGet() - { - list($response) = $this->serverCheckGetWithHttpInfo(); - return $response; - } - - /** - * Operation serverCheckGetWithHttpInfo - * - * Server health check - * - * - * @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 serverCheckGetWithHttpInfo() - { - $returnType = 'string'; - $request = $this->serverCheckGetRequest(); - - 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 serverCheckGetAsync - * - * Server health check - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function serverCheckGetAsync() - { - return $this->serverCheckGetAsyncWithHttpInfo() - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation serverCheckGetAsyncWithHttpInfo - * - * Server health check - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function serverCheckGetAsyncWithHttpInfo() - { - $returnType = 'string'; - $request = $this->serverCheckGetRequest(); - - 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 'serverCheckGet' - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function serverCheckGetRequest() - { - - $resourcePath = '/server-check'; - $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); - } - } - - - $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/SiteApi.php b/src/Api/SiteApi.php deleted file mode 100644 index a37a930..0000000 --- a/src/Api/SiteApi.php +++ /dev/null @@ -1,3775 +0,0 @@ -client = $client ?: new Client(); - $this->config = $config ?: new Configuration(); - $this->headerSelector = $selector ?: new HeaderSelector(); - } - - /** - * @return Configuration - */ - public function getConfig() - { - return $this->config; - } - - /** - * Operation apiSitesCurrentGet - * - * Get the current connected site for an access token. - * - * @param string $token token (optional) - * @param string $url url (optional) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return object - */ - public function apiSitesCurrentGet($token = null, $url = null) - { - list($response) = $this->apiSitesCurrentGetWithHttpInfo($token, $url); - return $response; - } - - /** - * Operation apiSitesCurrentGetWithHttpInfo - * - * Get the current connected site for an access token. - * - * @param string $token (optional) - * @param string $url (optional) - * - * @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 apiSitesCurrentGetWithHttpInfo($token = null, $url = null) - { - $returnType = 'object'; - $request = $this->apiSitesCurrentGetRequest($token, $url); - - 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(), - 'object', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiSitesCurrentGetAsync - * - * Get the current connected site for an access token. - * - * @param string $token (optional) - * @param string $url (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiSitesCurrentGetAsync($token = null, $url = null) - { - return $this->apiSitesCurrentGetAsyncWithHttpInfo($token, $url) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiSitesCurrentGetAsyncWithHttpInfo - * - * Get the current connected site for an access token. - * - * @param string $token (optional) - * @param string $url (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiSitesCurrentGetAsyncWithHttpInfo($token = null, $url = null) - { - $returnType = 'object'; - $request = $this->apiSitesCurrentGetRequest($token, $url); - - 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 'apiSitesCurrentGet' - * - * @param string $token (optional) - * @param string $url (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiSitesCurrentGetRequest($token = null, $url = null) - { - - $resourcePath = '/api/Sites/current'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - // query params - if ($token !== null) { - $queryParams['token'] = ObjectSerializer::toQueryValue($token, null); - } - // query params - if ($url !== null) { - $queryParams['url'] = ObjectSerializer::toQueryValue($url, 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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiSitesGet - * - * Get 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\Site[] - */ - public function apiSitesGet($filter = null) - { - list($response) = $this->apiSitesGetWithHttpInfo($filter); - return $response; - } - - /** - * Operation apiSitesGetWithHttpInfo - * - * 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 \Yoast\MyYoastApiClient\Model\Site[], HTTP status code, HTTP response headers (array of strings) - */ - public function apiSitesGetWithHttpInfo($filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Site[]'; - $request = $this->apiSitesGetRequest($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\Site[]', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiSitesGetAsync - * - * Get sites - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiSitesGetAsync($filter = null) - { - return $this->apiSitesGetAsyncWithHttpInfo($filter) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiSitesGetAsyncWithHttpInfo - * - * Get sites - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiSitesGetAsyncWithHttpInfo($filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Site[]'; - $request = $this->apiSitesGetRequest($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 'apiSitesGet' - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiSitesGetRequest($filter = null) - { - - $resourcePath = '/api/Sites'; - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiSitesGetSiteStatusGet - * - * Get a url's HTTP status - * - * @param string $url url (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return int - */ - public function apiSitesGetSiteStatusGet($url) - { - list($response) = $this->apiSitesGetSiteStatusGetWithHttpInfo($url); - return $response; - } - - /** - * Operation apiSitesGetSiteStatusGetWithHttpInfo - * - * Get a url's HTTP status - * - * @param string $url (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 apiSitesGetSiteStatusGetWithHttpInfo($url) - { - $returnType = 'int'; - $request = $this->apiSitesGetSiteStatusGetRequest($url); - - 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 apiSitesGetSiteStatusGetAsync - * - * Get a url's HTTP status - * - * @param string $url (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiSitesGetSiteStatusGetAsync($url) - { - return $this->apiSitesGetSiteStatusGetAsyncWithHttpInfo($url) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiSitesGetSiteStatusGetAsyncWithHttpInfo - * - * Get a url's HTTP status - * - * @param string $url (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiSitesGetSiteStatusGetAsyncWithHttpInfo($url) - { - $returnType = 'int'; - $request = $this->apiSitesGetSiteStatusGetRequest($url); - - 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 'apiSitesGetSiteStatusGet' - * - * @param string $url (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiSitesGetSiteStatusGetRequest($url) - { - // 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 apiSitesGetSiteStatusGet' - ); - } - - $resourcePath = '/api/Sites/getSiteStatus'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - // query params - if ($url !== null) { - $queryParams['url'] = ObjectSerializer::toQueryValue($url, 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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiSitesIdDelete - * - * @param string $id id (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function apiSitesIdDelete($id) - { - $this->apiSitesIdDeleteWithHttpInfo($id); - } - - /** - * Operation apiSitesIdDeleteWithHttpInfo - * - * @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 apiSitesIdDeleteWithHttpInfo($id) - { - $returnType = ''; - $request = $this->apiSitesIdDeleteRequest($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() - ); - } - - return [null, $statusCode, $response->getHeaders()]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - } - throw $e; - } - } - - /** - * Operation apiSitesIdDeleteAsync - * - * - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiSitesIdDeleteAsync($id) - { - return $this->apiSitesIdDeleteAsyncWithHttpInfo($id) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiSitesIdDeleteAsyncWithHttpInfo - * - * - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiSitesIdDeleteAsyncWithHttpInfo($id) - { - $returnType = ''; - $request = $this->apiSitesIdDeleteRequest($id); - - 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 'apiSitesIdDelete' - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiSitesIdDeleteRequest($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' - ); - } - - $resourcePath = '/api/Sites/{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( - [] - ); - } 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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiSitesIdGet - * - * Get a site - * - * @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 apiSitesIdGet($id, $filter = null) - { - list($response) = $this->apiSitesIdGetWithHttpInfo($id, $filter); - return $response; - } - - /** - * Operation apiSitesIdGetWithHttpInfo - * - * Get a site - * - * @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 apiSitesIdGetWithHttpInfo($id, $filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Site'; - $request = $this->apiSitesIdGetRequest($id, $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\Site', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiSitesIdGetAsync - * - * Get a site - * - * @param string $id (required) - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiSitesIdGetAsync($id, $filter = null) - { - return $this->apiSitesIdGetAsyncWithHttpInfo($id, $filter) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiSitesIdGetAsyncWithHttpInfo - * - * Get a site - * - * @param string $id (required) - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiSitesIdGetAsyncWithHttpInfo($id, $filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Site'; - $request = $this->apiSitesIdGetRequest($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 'apiSitesIdGet' - * - * @param string $id (required) - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiSitesIdGetRequest($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 apiSitesIdGet' - ); - } - - $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) { - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiSitesIdPatch - * - * @param \Yoast\MyYoastApiClient\Model\UpdateSiteDto $body body (required) - * @param string $id id (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function apiSitesIdPatch($body, $id) - { - $this->apiSitesIdPatchWithHttpInfo($body, $id); - } - - /** - * Operation apiSitesIdPatchWithHttpInfo - * - * @param \Yoast\MyYoastApiClient\Model\UpdateSiteDto $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) - */ - public function apiSitesIdPatchWithHttpInfo($body, $id) - { - $returnType = ''; - $request = $this->apiSitesIdPatchRequest($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() - ); - } - - return [null, $statusCode, $response->getHeaders()]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - } - throw $e; - } - } - - /** - * Operation apiSitesIdPatchAsync - * - * - * - * @param \Yoast\MyYoastApiClient\Model\UpdateSiteDto $body (required) - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiSitesIdPatchAsync($body, $id) - { - return $this->apiSitesIdPatchAsyncWithHttpInfo($body, $id) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiSitesIdPatchAsyncWithHttpInfo - * - * - * - * @param \Yoast\MyYoastApiClient\Model\UpdateSiteDto $body (required) - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiSitesIdPatchAsyncWithHttpInfo($body, $id) - { - $returnType = ''; - $request = $this->apiSitesIdPatchRequest($body, $id); - - 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 'apiSitesIdPatch' - * - * @param \Yoast\MyYoastApiClient\Model\UpdateSiteDto $body (required) - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiSitesIdPatchRequest($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 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}'; - $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( - [] - ); - } 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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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( - 'PATCH', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation apiSitesIdSubscriptionsPut - * - * Adds a subscription to a site - * - * @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 - */ - public function apiSitesIdSubscriptionsPut($body, $id) - { - list($response) = $this->apiSitesIdSubscriptionsPutWithHttpInfo($body, $id); - return $response; - } - - /** - * Operation apiSitesIdSubscriptionsPutWithHttpInfo - * - * Adds a subscription to a site - * - * @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) - */ - public function apiSitesIdSubscriptionsPutWithHttpInfo($body, $id) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Site'; - $request = $this->apiSitesIdSubscriptionsPutRequest($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\Site', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiSitesIdSubscriptionsPutAsync - * - * Adds a subscription to a site - * - * @param \Yoast\MyYoastApiClient\Model\AddSubscriptionDto $body (required) - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiSitesIdSubscriptionsPutAsync($body, $id) - { - return $this->apiSitesIdSubscriptionsPutAsyncWithHttpInfo($body, $id) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiSitesIdSubscriptionsPutAsyncWithHttpInfo - * - * Adds a subscription to a site - * - * @param \Yoast\MyYoastApiClient\Model\AddSubscriptionDto $body (required) - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiSitesIdSubscriptionsPutAsyncWithHttpInfo($body, $id) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Site'; - $request = $this->apiSitesIdSubscriptionsPutRequest($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 'apiSitesIdSubscriptionsPut' - * - * @param \Yoast\MyYoastApiClient\Model\AddSubscriptionDto $body (required) - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiSitesIdSubscriptionsPutRequest($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 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' - ); - } - - $resourcePath = '/api/Sites/{id}/subscriptions'; - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiSitesIdSubscriptionsSubscriptionIdDelete - * - * 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 apiSitesIdSubscriptionsSubscriptionIdDelete($id, $subscriptionId) - { - list($response) = $this->apiSitesIdSubscriptionsSubscriptionIdDeleteWithHttpInfo($id, $subscriptionId); - return $response; - } - - /** - * Operation apiSitesIdSubscriptionsSubscriptionIdDeleteWithHttpInfo - * - * 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 apiSitesIdSubscriptionsSubscriptionIdDeleteWithHttpInfo($id, $subscriptionId) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Site'; - $request = $this->apiSitesIdSubscriptionsSubscriptionIdDeleteRequest($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 apiSitesIdSubscriptionsSubscriptionIdDeleteAsync - * - * Removes a subscription from a site - * - * @param string $id (required) - * @param string $subscriptionId (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiSitesIdSubscriptionsSubscriptionIdDeleteAsync($id, $subscriptionId) - { - return $this->apiSitesIdSubscriptionsSubscriptionIdDeleteAsyncWithHttpInfo($id, $subscriptionId) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiSitesIdSubscriptionsSubscriptionIdDeleteAsyncWithHttpInfo - * - * Removes a subscription from a site - * - * @param string $id (required) - * @param string $subscriptionId (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiSitesIdSubscriptionsSubscriptionIdDeleteAsyncWithHttpInfo($id, $subscriptionId) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Site'; - $request = $this->apiSitesIdSubscriptionsSubscriptionIdDeleteRequest($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 'apiSitesIdSubscriptionsSubscriptionIdDelete' - * - * @param string $id (required) - * @param string $subscriptionId (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiSitesIdSubscriptionsSubscriptionIdDeleteRequest($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 apiSitesIdSubscriptionsSubscriptionIdDelete' - ); - } - // 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 apiSitesIdSubscriptionsSubscriptionIdDelete' - ); - } - - $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) { - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiSitesIndexPost - * - * @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 object - */ - public function apiSitesIndexPost($token, $url, $method) - { - list($response) = $this->apiSitesIndexPostWithHttpInfo($token, $url, $method); - return $response; - } - - /** - * Operation apiSitesIndexPostWithHttpInfo - * - * @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 object, HTTP status code, HTTP response headers (array of strings) - */ - public function apiSitesIndexPostWithHttpInfo($token, $url, $method) - { - $returnType = 'object'; - $request = $this->apiSitesIndexPostRequest($token, $url, $method); - - 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(), - 'object', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiSitesIndexPostAsync - * - * - * - * @param string $token (required) - * @param string $url (required) - * @param string $method (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiSitesIndexPostAsync($token, $url, $method) - { - return $this->apiSitesIndexPostAsyncWithHttpInfo($token, $url, $method) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiSitesIndexPostAsyncWithHttpInfo - * - * - * - * @param string $token (required) - * @param string $url (required) - * @param string $method (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiSitesIndexPostAsyncWithHttpInfo($token, $url, $method) - { - $returnType = 'object'; - $request = $this->apiSitesIndexPostRequest($token, $url, $method); - - 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 'apiSitesIndexPost' - * - * @param string $token (required) - * @param string $url (required) - * @param string $method (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiSitesIndexPostRequest($token, $url, $method) - { - // 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)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $method when calling apiSitesIndexPost' - ); - } - - $resourcePath = '/api/Sites/index'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $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 ($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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiSitesInfoGet - * - * Get the current connected site for an access token. - * - * @param string $token token (optional) - * @param string $url url (optional) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return object - */ - public function apiSitesInfoGet($token = null, $url = null) - { - list($response) = $this->apiSitesInfoGetWithHttpInfo($token, $url); - return $response; - } - - /** - * Operation apiSitesInfoGetWithHttpInfo - * - * Get the current connected site for an access token. - * - * @param string $token (optional) - * @param string $url (optional) - * - * @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 apiSitesInfoGetWithHttpInfo($token = null, $url = null) - { - $returnType = 'object'; - $request = $this->apiSitesInfoGetRequest($token, $url); - - 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(), - 'object', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiSitesInfoGetAsync - * - * Get the current connected site for an access token. - * - * @param string $token (optional) - * @param string $url (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiSitesInfoGetAsync($token = null, $url = null) - { - return $this->apiSitesInfoGetAsyncWithHttpInfo($token, $url) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiSitesInfoGetAsyncWithHttpInfo - * - * Get the current connected site for an access token. - * - * @param string $token (optional) - * @param string $url (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiSitesInfoGetAsyncWithHttpInfo($token = null, $url = null) - { - $returnType = 'object'; - $request = $this->apiSitesInfoGetRequest($token, $url); - - 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 'apiSitesInfoGet' - * - * @param string $token (optional) - * @param string $url (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiSitesInfoGetRequest($token = null, $url = null) - { - - $resourcePath = '/api/Sites/info'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - // query params - if ($token !== null) { - $queryParams['token'] = ObjectSerializer::toQueryValue($token, null); - } - // query params - if ($url !== null) { - $queryParams['url'] = ObjectSerializer::toQueryValue($url, 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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiSitesPagedGet - * - * Get sites - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function apiSitesPagedGet($filter = null) - { - $this->apiSitesPagedGetWithHttpInfo($filter); - } - - /** - * Operation apiSitesPagedGetWithHttpInfo - * - * 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) - */ - public function apiSitesPagedGetWithHttpInfo($filter = null) - { - $returnType = ''; - $request = $this->apiSitesPagedGetRequest($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 apiSitesPagedGetAsync - * - * Get sites - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiSitesPagedGetAsync($filter = null) - { - return $this->apiSitesPagedGetAsyncWithHttpInfo($filter) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiSitesPagedGetAsyncWithHttpInfo - * - * Get sites - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiSitesPagedGetAsyncWithHttpInfo($filter = null) - { - $returnType = ''; - $request = $this->apiSitesPagedGetRequest($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 'apiSitesPagedGet' - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiSitesPagedGetRequest($filter = null) - { - - $resourcePath = '/api/Sites/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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiSitesSwitchSubscriptionNumberOfTimesPost - * - * Switches the subscription for a number of times. - * - * @param \Yoast\MyYoastApiClient\Model\SwitchSubscriptionNumberOfTimesDto $body body (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return object - */ - public function apiSitesSwitchSubscriptionNumberOfTimesPost($body) - { - list($response) = $this->apiSitesSwitchSubscriptionNumberOfTimesPostWithHttpInfo($body); - return $response; - } - - /** - * Operation apiSitesSwitchSubscriptionNumberOfTimesPostWithHttpInfo - * - * Switches the subscription for a number of times. - * - * @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) - */ - public function apiSitesSwitchSubscriptionNumberOfTimesPostWithHttpInfo($body) - { - $returnType = 'object'; - $request = $this->apiSitesSwitchSubscriptionNumberOfTimesPostRequest($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(), - 'object', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiSitesSwitchSubscriptionNumberOfTimesPostAsync - * - * Switches the subscription for a number of times. - * - * @param \Yoast\MyYoastApiClient\Model\SwitchSubscriptionNumberOfTimesDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiSitesSwitchSubscriptionNumberOfTimesPostAsync($body) - { - return $this->apiSitesSwitchSubscriptionNumberOfTimesPostAsyncWithHttpInfo($body) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiSitesSwitchSubscriptionNumberOfTimesPostAsyncWithHttpInfo - * - * Switches the subscription for a number of times. - * - * @param \Yoast\MyYoastApiClient\Model\SwitchSubscriptionNumberOfTimesDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiSitesSwitchSubscriptionNumberOfTimesPostAsyncWithHttpInfo($body) - { - $returnType = 'object'; - $request = $this->apiSitesSwitchSubscriptionNumberOfTimesPostRequest($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 'apiSitesSwitchSubscriptionNumberOfTimesPost' - * - * @param \Yoast\MyYoastApiClient\Model\SwitchSubscriptionNumberOfTimesDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiSitesSwitchSubscriptionNumberOfTimesPostRequest($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 apiSitesSwitchSubscriptionNumberOfTimesPost' - ); - } - - $resourcePath = '/api/Sites/switchSubscriptionNumberOfTimes'; - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiSitesSwitchSubscriptionPost - * - * 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 int - */ - public function apiSitesSwitchSubscriptionPost($body) - { - list($response) = $this->apiSitesSwitchSubscriptionPostWithHttpInfo($body); - return $response; - } - - /** - * Operation apiSitesSwitchSubscriptionPostWithHttpInfo - * - * 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 int, HTTP status code, HTTP response headers (array of strings) - */ - public function apiSitesSwitchSubscriptionPostWithHttpInfo($body) - { - $returnType = 'int'; - $request = $this->apiSitesSwitchSubscriptionPostRequest($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 apiSitesSwitchSubscriptionPostAsync - * - * Switches the subscription for a number of times. - * - * @param \Yoast\MyYoastApiClient\Model\TransferSiteDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiSitesSwitchSubscriptionPostAsync($body) - { - return $this->apiSitesSwitchSubscriptionPostAsyncWithHttpInfo($body) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiSitesSwitchSubscriptionPostAsyncWithHttpInfo - * - * Switches the subscription for a number of times. - * - * @param \Yoast\MyYoastApiClient\Model\TransferSiteDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiSitesSwitchSubscriptionPostAsyncWithHttpInfo($body) - { - $returnType = 'int'; - $request = $this->apiSitesSwitchSubscriptionPostRequest($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 'apiSitesSwitchSubscriptionPost' - * - * @param \Yoast\MyYoastApiClient\Model\TransferSiteDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiSitesSwitchSubscriptionPostRequest($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 apiSitesSwitchSubscriptionPost' - ); - } - - $resourcePath = '/api/Sites/switchSubscription'; - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiSitesTransferPost - * - * Transfer sites. - * - * @param \Yoast\MyYoastApiClient\Model\TransferSiteDto $body body (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\Site[] - */ - public function apiSitesTransferPost($body) - { - list($response) = $this->apiSitesTransferPostWithHttpInfo($body); - return $response; - } - - /** - * Operation apiSitesTransferPostWithHttpInfo - * - * Transfer sites. - * - * @param \Yoast\MyYoastApiClient\Model\TransferSiteDto $body (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 apiSitesTransferPostWithHttpInfo($body) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Site[]'; - $request = $this->apiSitesTransferPostRequest($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\Site[]', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiSitesTransferPostAsync - * - * Transfer sites. - * - * @param \Yoast\MyYoastApiClient\Model\TransferSiteDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiSitesTransferPostAsync($body) - { - return $this->apiSitesTransferPostAsyncWithHttpInfo($body) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiSitesTransferPostAsyncWithHttpInfo - * - * Transfer sites. - * - * @param \Yoast\MyYoastApiClient\Model\TransferSiteDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiSitesTransferPostAsyncWithHttpInfo($body) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Site[]'; - $request = $this->apiSitesTransferPostRequest($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 'apiSitesTransferPost' - * - * @param \Yoast\MyYoastApiClient\Model\TransferSiteDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiSitesTransferPostRequest($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 apiSitesTransferPost' - ); - } - - $resourcePath = '/api/Sites/transfer'; - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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/SubscriptionApi.php b/src/Api/SubscriptionApi.php deleted file mode 100644 index fdd8d3b..0000000 --- a/src/Api/SubscriptionApi.php +++ /dev/null @@ -1,2979 +0,0 @@ -client = $client ?: new Client(); - $this->config = $config ?: new Configuration(); - $this->headerSelector = $selector ?: new HeaderSelector(); - } - - /** - * @return Configuration - */ - public function getConfig() - { - return $this->config; - } - - /** - * Operation apiSubscriptionsExpiringGet - * - * @param \DateTime $from from (required) - * @param \DateTime $until until (required) - * @param bool $requiresManualRenewal requiresManualRenewal (optional) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\Subscription[] - */ - public function apiSubscriptionsExpiringGet($from, $until, $requiresManualRenewal = null) - { - list($response) = $this->apiSubscriptionsExpiringGetWithHttpInfo($from, $until, $requiresManualRenewal); - return $response; - } - - /** - * Operation apiSubscriptionsExpiringGetWithHttpInfo - * - * @param \DateTime $from (required) - * @param \DateTime $until (required) - * @param bool $requiresManualRenewal (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 apiSubscriptionsExpiringGetWithHttpInfo($from, $until, $requiresManualRenewal = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Subscription[]'; - $request = $this->apiSubscriptionsExpiringGetRequest($from, $until, $requiresManualRenewal); - - 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 apiSubscriptionsExpiringGetAsync - * - * - * - * @param \DateTime $from (required) - * @param \DateTime $until (required) - * @param bool $requiresManualRenewal (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiSubscriptionsExpiringGetAsync($from, $until, $requiresManualRenewal = null) - { - return $this->apiSubscriptionsExpiringGetAsyncWithHttpInfo($from, $until, $requiresManualRenewal) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiSubscriptionsExpiringGetAsyncWithHttpInfo - * - * - * - * @param \DateTime $from (required) - * @param \DateTime $until (required) - * @param bool $requiresManualRenewal (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiSubscriptionsExpiringGetAsyncWithHttpInfo($from, $until, $requiresManualRenewal = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Subscription[]'; - $request = $this->apiSubscriptionsExpiringGetRequest($from, $until, $requiresManualRenewal); - - 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 'apiSubscriptionsExpiringGet' - * - * @param \DateTime $from (required) - * @param \DateTime $until (required) - * @param bool $requiresManualRenewal (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiSubscriptionsExpiringGetRequest($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' - ); - } - // 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' - ); - } - - $resourcePath = '/api/Subscriptions/expiring'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - // query params - if ($from !== null) { - $queryParams['from'] = ObjectSerializer::toQueryValue($from, 'date-time'); - } - // query params - if ($until !== null) { - $queryParams['until'] = ObjectSerializer::toQueryValue($until, 'date-time'); - } - // query params - if ($requiresManualRenewal !== null) { - $queryParams['requiresManualRenewal'] = ObjectSerializer::toQueryValue($requiresManualRenewal, 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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiSubscriptionsGet - * - * Get subscriptions - * - * @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) - { - list($response) = $this->apiSubscriptionsGetWithHttpInfo($filter); - return $response; - } - - /** - * Operation apiSubscriptionsGetWithHttpInfo - * - * Get subscriptions - * - * @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) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Subscription[]'; - $request = $this->apiSubscriptionsGetRequest($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\Subscription[]', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiSubscriptionsGetAsync - * - * Get subscriptions - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiSubscriptionsGetAsync($filter = null) - { - return $this->apiSubscriptionsGetAsyncWithHttpInfo($filter) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiSubscriptionsGetAsyncWithHttpInfo - * - * Get subscriptions - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiSubscriptionsGetAsyncWithHttpInfo($filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Subscription[]'; - $request = $this->apiSubscriptionsGetRequest($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 'apiSubscriptionsGet' - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiSubscriptionsGetRequest($filter = null) - { - - $resourcePath = '/api/Subscriptions'; - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiSubscriptionsIdDelete - * - * Delete a subscription - * - * @param string $id id (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return string - */ - public function apiSubscriptionsIdDelete($id) - { - list($response) = $this->apiSubscriptionsIdDeleteWithHttpInfo($id); - return $response; - } - - /** - * Operation apiSubscriptionsIdDeleteWithHttpInfo - * - * 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 apiSubscriptionsIdDeleteWithHttpInfo($id) - { - $returnType = 'string'; - $request = $this->apiSubscriptionsIdDeleteRequest($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 apiSubscriptionsIdDeleteAsync - * - * Delete a subscription - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiSubscriptionsIdDeleteAsync($id) - { - return $this->apiSubscriptionsIdDeleteAsyncWithHttpInfo($id) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiSubscriptionsIdDeleteAsyncWithHttpInfo - * - * Delete a subscription - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiSubscriptionsIdDeleteAsyncWithHttpInfo($id) - { - $returnType = 'string'; - $request = $this->apiSubscriptionsIdDeleteRequest($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 'apiSubscriptionsIdDelete' - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiSubscriptionsIdDeleteRequest($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 apiSubscriptionsIdDelete' - ); - } - - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiSubscriptionsIdForceCancelPost - * - * Forcefully cancel a subscription - * - * @param string $id id (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function apiSubscriptionsIdForceCancelPost($id) - { - $this->apiSubscriptionsIdForceCancelPostWithHttpInfo($id); - } - - /** - * Operation apiSubscriptionsIdForceCancelPostWithHttpInfo - * - * Forcefully cancel a subscription - * - * @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 apiSubscriptionsIdForceCancelPostWithHttpInfo($id) - { - $returnType = ''; - $request = $this->apiSubscriptionsIdForceCancelPostRequest($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() - ); - } - - return [null, $statusCode, $response->getHeaders()]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - } - throw $e; - } - } - - /** - * Operation apiSubscriptionsIdForceCancelPostAsync - * - * Forcefully cancel a subscription - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiSubscriptionsIdForceCancelPostAsync($id) - { - return $this->apiSubscriptionsIdForceCancelPostAsyncWithHttpInfo($id) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiSubscriptionsIdForceCancelPostAsyncWithHttpInfo - * - * Forcefully cancel a subscription - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiSubscriptionsIdForceCancelPostAsyncWithHttpInfo($id) - { - $returnType = ''; - $request = $this->apiSubscriptionsIdForceCancelPostRequest($id); - - 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 'apiSubscriptionsIdForceCancelPost' - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiSubscriptionsIdForceCancelPostRequest($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 apiSubscriptionsIdForceCancelPost' - ); - } - - $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( - [] - ); - } 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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiSubscriptionsIdGet - * - * Get a subscription - * - * @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\Subscription - */ - public function apiSubscriptionsIdGet($id, $filter = null) - { - list($response) = $this->apiSubscriptionsIdGetWithHttpInfo($id, $filter); - return $response; - } - - /** - * Operation apiSubscriptionsIdGetWithHttpInfo - * - * Get a subscription - * - * @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\Subscription, HTTP status code, HTTP response headers (array of strings) - */ - public function apiSubscriptionsIdGetWithHttpInfo($id, $filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Subscription'; - $request = $this->apiSubscriptionsIdGetRequest($id, $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\Subscription', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiSubscriptionsIdGetAsync - * - * Get a subscription - * - * @param string $id (required) - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiSubscriptionsIdGetAsync($id, $filter = null) - { - return $this->apiSubscriptionsIdGetAsyncWithHttpInfo($id, $filter) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiSubscriptionsIdGetAsyncWithHttpInfo - * - * Get a subscription - * - * @param string $id (required) - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiSubscriptionsIdGetAsyncWithHttpInfo($id, $filter = null) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Subscription'; - $request = $this->apiSubscriptionsIdGetRequest($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 'apiSubscriptionsIdGet' - * - * @param string $id (required) - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiSubscriptionsIdGetRequest($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' - ); - } - - $resourcePath = '/api/Subscriptions/{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 ($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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiSubscriptionsIdRecalculateSubscriptionCountPost - * - * Recalculate SubscriptionCount. - * - * @param string $id id (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\Subscription - */ - public function apiSubscriptionsIdRecalculateSubscriptionCountPost($id) - { - list($response) = $this->apiSubscriptionsIdRecalculateSubscriptionCountPostWithHttpInfo($id); - return $response; - } - - /** - * Operation apiSubscriptionsIdRecalculateSubscriptionCountPostWithHttpInfo - * - * Recalculate SubscriptionCount. - * - * @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 apiSubscriptionsIdRecalculateSubscriptionCountPostWithHttpInfo($id) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Subscription'; - $request = $this->apiSubscriptionsIdRecalculateSubscriptionCountPostRequest($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 apiSubscriptionsIdRecalculateSubscriptionCountPostAsync - * - * Recalculate SubscriptionCount. - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiSubscriptionsIdRecalculateSubscriptionCountPostAsync($id) - { - return $this->apiSubscriptionsIdRecalculateSubscriptionCountPostAsyncWithHttpInfo($id) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiSubscriptionsIdRecalculateSubscriptionCountPostAsyncWithHttpInfo - * - * Recalculate SubscriptionCount. - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiSubscriptionsIdRecalculateSubscriptionCountPostAsyncWithHttpInfo($id) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Subscription'; - $request = $this->apiSubscriptionsIdRecalculateSubscriptionCountPostRequest($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 'apiSubscriptionsIdRecalculateSubscriptionCountPost' - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiSubscriptionsIdRecalculateSubscriptionCountPostRequest($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' - ); - } - - $resourcePath = '/api/Subscriptions/{id}/recalculateSubscriptionCount'; - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiSubscriptionsLinkSitePost - * - * Link a subscription to provided site URL - * - * @param \Yoast\MyYoastApiClient\Model\LinkSiteDto $body body (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\Site - */ - public function apiSubscriptionsLinkSitePost($body) - { - list($response) = $this->apiSubscriptionsLinkSitePostWithHttpInfo($body); - return $response; - } - - /** - * Operation apiSubscriptionsLinkSitePostWithHttpInfo - * - * Link a subscription to provided site URL - * - * @param \Yoast\MyYoastApiClient\Model\LinkSiteDto $body (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 apiSubscriptionsLinkSitePostWithHttpInfo($body) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Site'; - $request = $this->apiSubscriptionsLinkSitePostRequest($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\Site', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiSubscriptionsLinkSitePostAsync - * - * Link a subscription to provided site URL - * - * @param \Yoast\MyYoastApiClient\Model\LinkSiteDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiSubscriptionsLinkSitePostAsync($body) - { - return $this->apiSubscriptionsLinkSitePostAsyncWithHttpInfo($body) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiSubscriptionsLinkSitePostAsyncWithHttpInfo - * - * Link a subscription to provided site URL - * - * @param \Yoast\MyYoastApiClient\Model\LinkSiteDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiSubscriptionsLinkSitePostAsyncWithHttpInfo($body) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Site'; - $request = $this->apiSubscriptionsLinkSitePostRequest($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 'apiSubscriptionsLinkSitePost' - * - * @param \Yoast\MyYoastApiClient\Model\LinkSiteDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiSubscriptionsLinkSitePostRequest($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 apiSubscriptionsLinkSitePost' - ); - } - - $resourcePath = '/api/Subscriptions/link-site'; - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiSubscriptionsPagedGet - * - * Get subscriptions - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function apiSubscriptionsPagedGet($filter = null) - { - $this->apiSubscriptionsPagedGetWithHttpInfo($filter); - } - - /** - * Operation apiSubscriptionsPagedGetWithHttpInfo - * - * Get subscriptions - * - * @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 apiSubscriptionsPagedGetWithHttpInfo($filter = null) - { - $returnType = ''; - $request = $this->apiSubscriptionsPagedGetRequest($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 apiSubscriptionsPagedGetAsync - * - * Get subscriptions - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiSubscriptionsPagedGetAsync($filter = null) - { - return $this->apiSubscriptionsPagedGetAsyncWithHttpInfo($filter) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiSubscriptionsPagedGetAsyncWithHttpInfo - * - * Get subscriptions - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiSubscriptionsPagedGetAsyncWithHttpInfo($filter = null) - { - $returnType = ''; - $request = $this->apiSubscriptionsPagedGetRequest($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 'apiSubscriptionsPagedGet' - * - * @param object $filter Used for filtering/joining the results. (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiSubscriptionsPagedGetRequest($filter = null) - { - - $resourcePath = '/api/Subscriptions/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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiSubscriptionsRenewSubscriptionNumberSecretKeyGet - * - * Renew subscriptions - * - * @param string $subscriptionNumber subscriptionNumber (required) - * @param string $secretKey secretKey (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return \Yoast\MyYoastApiClient\Model\Subscription - */ - public function apiSubscriptionsRenewSubscriptionNumberSecretKeyGet($subscriptionNumber, $secretKey) - { - list($response) = $this->apiSubscriptionsRenewSubscriptionNumberSecretKeyGetWithHttpInfo($subscriptionNumber, $secretKey); - return $response; - } - - /** - * Operation apiSubscriptionsRenewSubscriptionNumberSecretKeyGetWithHttpInfo - * - * Renew subscriptions - * - * @param string $subscriptionNumber (required) - * @param string $secretKey (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 apiSubscriptionsRenewSubscriptionNumberSecretKeyGetWithHttpInfo($subscriptionNumber, $secretKey) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Subscription'; - $request = $this->apiSubscriptionsRenewSubscriptionNumberSecretKeyGetRequest($subscriptionNumber, $secretKey); - - 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 apiSubscriptionsRenewSubscriptionNumberSecretKeyGetAsync - * - * Renew subscriptions - * - * @param string $subscriptionNumber (required) - * @param string $secretKey (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiSubscriptionsRenewSubscriptionNumberSecretKeyGetAsync($subscriptionNumber, $secretKey) - { - return $this->apiSubscriptionsRenewSubscriptionNumberSecretKeyGetAsyncWithHttpInfo($subscriptionNumber, $secretKey) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiSubscriptionsRenewSubscriptionNumberSecretKeyGetAsyncWithHttpInfo - * - * Renew subscriptions - * - * @param string $subscriptionNumber (required) - * @param string $secretKey (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiSubscriptionsRenewSubscriptionNumberSecretKeyGetAsyncWithHttpInfo($subscriptionNumber, $secretKey) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Subscription'; - $request = $this->apiSubscriptionsRenewSubscriptionNumberSecretKeyGetRequest($subscriptionNumber, $secretKey); - - 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 'apiSubscriptionsRenewSubscriptionNumberSecretKeyGet' - * - * @param string $subscriptionNumber (required) - * @param string $secretKey (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiSubscriptionsRenewSubscriptionNumberSecretKeyGetRequest($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' - ); - } - // 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' - ); - } - - $resourcePath = '/api/Subscriptions/renew/{subscriptionNumber}/{secretKey}'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - // path params - if ($subscriptionNumber !== null) { - $resourcePath = str_replace( - '{' . 'subscriptionNumber' . '}', - ObjectSerializer::toPathValue($subscriptionNumber), - $resourcePath - ); - } - // path params - if ($secretKey !== null) { - $resourcePath = str_replace( - '{' . 'secretKey' . '}', - ObjectSerializer::toPathValue($secretKey), - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiSubscriptionsSetExpiryDatePost - * - * Set Date. - * - * @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($body) - { - list($response) = $this->apiSubscriptionsSetExpiryDatePostWithHttpInfo($body); - return $response; - } - - /** - * Operation apiSubscriptionsSetExpiryDatePostWithHttpInfo - * - * Set Date. - * - * @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($body) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Subscription'; - $request = $this->apiSubscriptionsSetExpiryDatePostRequest($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\Subscription', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiSubscriptionsSetExpiryDatePostAsync - * - * Set Date. - * - * @param \Yoast\MyYoastApiClient\Model\SetExpiryDateDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiSubscriptionsSetExpiryDatePostAsync($body) - { - return $this->apiSubscriptionsSetExpiryDatePostAsyncWithHttpInfo($body) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiSubscriptionsSetExpiryDatePostAsyncWithHttpInfo - * - * Set Date. - * - * @param \Yoast\MyYoastApiClient\Model\SetExpiryDateDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiSubscriptionsSetExpiryDatePostAsyncWithHttpInfo($body) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Subscription'; - $request = $this->apiSubscriptionsSetExpiryDatePostRequest($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 'apiSubscriptionsSetExpiryDatePost' - * - * @param \Yoast\MyYoastApiClient\Model\SetExpiryDateDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiSubscriptionsSetExpiryDatePostRequest($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 apiSubscriptionsSetExpiryDatePost' - ); - } - - $resourcePath = '/api/Subscriptions/setExpiryDate'; - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiSubscriptionsTransferPost - * - * Transfer subscription ownership - * - * @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($body) - { - list($response) = $this->apiSubscriptionsTransferPostWithHttpInfo($body); - return $response; - } - - /** - * Operation apiSubscriptionsTransferPostWithHttpInfo - * - * Transfer subscription ownership - * - * @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($body) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Subscription[]'; - $request = $this->apiSubscriptionsTransferPostRequest($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\Subscription[]', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation apiSubscriptionsTransferPostAsync - * - * Transfer subscription ownership - * - * @param \Yoast\MyYoastApiClient\Model\TransferOwnershipDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiSubscriptionsTransferPostAsync($body) - { - return $this->apiSubscriptionsTransferPostAsyncWithHttpInfo($body) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiSubscriptionsTransferPostAsyncWithHttpInfo - * - * Transfer subscription ownership - * - * @param \Yoast\MyYoastApiClient\Model\TransferOwnershipDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiSubscriptionsTransferPostAsyncWithHttpInfo($body) - { - $returnType = '\Yoast\MyYoastApiClient\Model\Subscription[]'; - $request = $this->apiSubscriptionsTransferPostRequest($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 'apiSubscriptionsTransferPost' - * - * @param \Yoast\MyYoastApiClient\Model\TransferOwnershipDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiSubscriptionsTransferPostRequest($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 apiSubscriptionsTransferPost' - ); - } - - $resourcePath = '/api/Subscriptions/transfer'; - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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/SubscriptionProvisioningApi.php b/src/Api/SubscriptionProvisioningApi.php deleted file mode 100644 index 5eaae64..0000000 --- a/src/Api/SubscriptionProvisioningApi.php +++ /dev/null @@ -1,1440 +0,0 @@ -client = $client ?: new Client(); - $this->config = $config ?: new Configuration(); - $this->headerSelector = $selector ?: new HeaderSelector(); - } - - /** - * @return Configuration - */ - public function getConfig() - { - return $this->config; - } - - /** - * Operation apiProvisioningSubscriptionsCreatePost - * - * 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 apiProvisioningSubscriptionsCreatePost($body) - { - list($response) = $this->apiProvisioningSubscriptionsCreatePostWithHttpInfo($body); - return $response; - } - - /** - * Operation apiProvisioningSubscriptionsCreatePostWithHttpInfo - * - * 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 apiProvisioningSubscriptionsCreatePostWithHttpInfo($body) - { - $returnType = '\Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto'; - $request = $this->apiProvisioningSubscriptionsCreatePostRequest($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 apiProvisioningSubscriptionsCreatePostAsync - * - * Create a subscription - * - * @param \Yoast\MyYoastApiClient\Model\CreateProvisionedSubscriptionDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiProvisioningSubscriptionsCreatePostAsync($body) - { - return $this->apiProvisioningSubscriptionsCreatePostAsyncWithHttpInfo($body) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiProvisioningSubscriptionsCreatePostAsyncWithHttpInfo - * - * Create a subscription - * - * @param \Yoast\MyYoastApiClient\Model\CreateProvisionedSubscriptionDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiProvisioningSubscriptionsCreatePostAsyncWithHttpInfo($body) - { - $returnType = '\Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto'; - $request = $this->apiProvisioningSubscriptionsCreatePostRequest($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 'apiProvisioningSubscriptionsCreatePost' - * - * @param \Yoast\MyYoastApiClient\Model\CreateProvisionedSubscriptionDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiProvisioningSubscriptionsCreatePostRequest($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 apiProvisioningSubscriptionsCreatePost' - ); - } - - $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); - } - } - - - $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 apiProvisioningSubscriptionsIdCancelPost - * - * 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 apiProvisioningSubscriptionsIdCancelPost($body, $id) - { - list($response) = $this->apiProvisioningSubscriptionsIdCancelPostWithHttpInfo($body, $id); - return $response; - } - - /** - * Operation apiProvisioningSubscriptionsIdCancelPostWithHttpInfo - * - * 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 apiProvisioningSubscriptionsIdCancelPostWithHttpInfo($body, $id) - { - $returnType = '\Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto'; - $request = $this->apiProvisioningSubscriptionsIdCancelPostRequest($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 apiProvisioningSubscriptionsIdCancelPostAsync - * - * Cancel a single subscription - * - * @param \Yoast\MyYoastApiClient\Model\CancelProvisionedSubscriptionDto $body (required) - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiProvisioningSubscriptionsIdCancelPostAsync($body, $id) - { - return $this->apiProvisioningSubscriptionsIdCancelPostAsyncWithHttpInfo($body, $id) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiProvisioningSubscriptionsIdCancelPostAsyncWithHttpInfo - * - * Cancel a single subscription - * - * @param \Yoast\MyYoastApiClient\Model\CancelProvisionedSubscriptionDto $body (required) - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiProvisioningSubscriptionsIdCancelPostAsyncWithHttpInfo($body, $id) - { - $returnType = '\Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto'; - $request = $this->apiProvisioningSubscriptionsIdCancelPostRequest($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 'apiProvisioningSubscriptionsIdCancelPost' - * - * @param \Yoast\MyYoastApiClient\Model\CancelProvisionedSubscriptionDto $body (required) - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiProvisioningSubscriptionsIdCancelPostRequest($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 apiProvisioningSubscriptionsIdCancelPost' - ); - } - // 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 apiProvisioningSubscriptionsIdCancelPost' - ); - } - - $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); - } - } - - - $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 apiProvisioningSubscriptionsIdGet - * - * 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 apiProvisioningSubscriptionsIdGet($id) - { - list($response) = $this->apiProvisioningSubscriptionsIdGetWithHttpInfo($id); - return $response; - } - - /** - * Operation apiProvisioningSubscriptionsIdGetWithHttpInfo - * - * 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 apiProvisioningSubscriptionsIdGetWithHttpInfo($id) - { - $returnType = '\Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto'; - $request = $this->apiProvisioningSubscriptionsIdGetRequest($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 apiProvisioningSubscriptionsIdGetAsync - * - * Get a subscription - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiProvisioningSubscriptionsIdGetAsync($id) - { - return $this->apiProvisioningSubscriptionsIdGetAsyncWithHttpInfo($id) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiProvisioningSubscriptionsIdGetAsyncWithHttpInfo - * - * Get a subscription - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiProvisioningSubscriptionsIdGetAsyncWithHttpInfo($id) - { - $returnType = '\Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto'; - $request = $this->apiProvisioningSubscriptionsIdGetRequest($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 'apiProvisioningSubscriptionsIdGet' - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiProvisioningSubscriptionsIdGetRequest($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 apiProvisioningSubscriptionsIdGet' - ); - } - - $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); - } - } - - - $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 apiProvisioningSubscriptionsIdRenewPost - * - * 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 apiProvisioningSubscriptionsIdRenewPost($id) - { - list($response) = $this->apiProvisioningSubscriptionsIdRenewPostWithHttpInfo($id); - return $response; - } - - /** - * Operation apiProvisioningSubscriptionsIdRenewPostWithHttpInfo - * - * 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 apiProvisioningSubscriptionsIdRenewPostWithHttpInfo($id) - { - $returnType = '\Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto'; - $request = $this->apiProvisioningSubscriptionsIdRenewPostRequest($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 apiProvisioningSubscriptionsIdRenewPostAsync - * - * Renew a subscription - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiProvisioningSubscriptionsIdRenewPostAsync($id) - { - return $this->apiProvisioningSubscriptionsIdRenewPostAsyncWithHttpInfo($id) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiProvisioningSubscriptionsIdRenewPostAsyncWithHttpInfo - * - * Renew a subscription - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiProvisioningSubscriptionsIdRenewPostAsyncWithHttpInfo($id) - { - $returnType = '\Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto'; - $request = $this->apiProvisioningSubscriptionsIdRenewPostRequest($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 'apiProvisioningSubscriptionsIdRenewPost' - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiProvisioningSubscriptionsIdRenewPostRequest($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 apiProvisioningSubscriptionsIdRenewPost' - ); - } - - $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); - } - } - - - $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 apiProvisioningSubscriptionsIdSetSitePost - * - * 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 apiProvisioningSubscriptionsIdSetSitePost($body, $id) - { - list($response) = $this->apiProvisioningSubscriptionsIdSetSitePostWithHttpInfo($body, $id); - return $response; - } - - /** - * Operation apiProvisioningSubscriptionsIdSetSitePostWithHttpInfo - * - * 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 apiProvisioningSubscriptionsIdSetSitePostWithHttpInfo($body, $id) - { - $returnType = '\Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto'; - $request = $this->apiProvisioningSubscriptionsIdSetSitePostRequest($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 apiProvisioningSubscriptionsIdSetSitePostAsync - * - * 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 apiProvisioningSubscriptionsIdSetSitePostAsync($body, $id) - { - return $this->apiProvisioningSubscriptionsIdSetSitePostAsyncWithHttpInfo($body, $id) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiProvisioningSubscriptionsIdSetSitePostAsyncWithHttpInfo - * - * 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 apiProvisioningSubscriptionsIdSetSitePostAsyncWithHttpInfo($body, $id) - { - $returnType = '\Yoast\MyYoastApiClient\Model\SubscriptionProvisioningResponseDto'; - $request = $this->apiProvisioningSubscriptionsIdSetSitePostRequest($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 'apiProvisioningSubscriptionsIdSetSitePost' - * - * @param \Yoast\MyYoastApiClient\Model\SetProvisionedSiteDto $body (required) - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiProvisioningSubscriptionsIdSetSitePostRequest($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 apiProvisioningSubscriptionsIdSetSitePost' - ); - } - // 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 apiProvisioningSubscriptionsIdSetSitePost' - ); - } - - $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); - } - } - - - $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 deleted file mode 100644 index 134a258..0000000 --- a/src/Api/WorkerApi.php +++ /dev/null @@ -1,1439 +0,0 @@ -client = $client ?: new Client(); - $this->config = $config ?: new Configuration(); - $this->headerSelector = $selector ?: new HeaderSelector(); - } - - /** - * @return Configuration - */ - public function getConfig() - { - return $this->config; - } - - /** - * Operation apiWorkerGetRecurringJobsGet - * - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function apiWorkerGetRecurringJobsGet() - { - $this->apiWorkerGetRecurringJobsGetWithHttpInfo(); - } - - /** - * Operation apiWorkerGetRecurringJobsGetWithHttpInfo - * - * - * @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 apiWorkerGetRecurringJobsGetWithHttpInfo() - { - $returnType = ''; - $request = $this->apiWorkerGetRecurringJobsGetRequest(); - - 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 apiWorkerGetRecurringJobsGetAsync - * - * - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiWorkerGetRecurringJobsGetAsync() - { - return $this->apiWorkerGetRecurringJobsGetAsyncWithHttpInfo() - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiWorkerGetRecurringJobsGetAsyncWithHttpInfo - * - * - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiWorkerGetRecurringJobsGetAsyncWithHttpInfo() - { - $returnType = ''; - $request = $this->apiWorkerGetRecurringJobsGetRequest(); - - 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 'apiWorkerGetRecurringJobsGet' - * - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiWorkerGetRecurringJobsGetRequest() - { - - $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) { - $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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiWorkerGetRecurringJobsNameGet - * - * @param string $name name (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function apiWorkerGetRecurringJobsNameGet($name) - { - $this->apiWorkerGetRecurringJobsNameGetWithHttpInfo($name); - } - - /** - * Operation apiWorkerGetRecurringJobsNameGetWithHttpInfo - * - * @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 apiWorkerGetRecurringJobsNameGetWithHttpInfo($name) - { - $returnType = ''; - $request = $this->apiWorkerGetRecurringJobsNameGetRequest($name); - - 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 apiWorkerGetRecurringJobsNameGetAsync - * - * - * - * @param string $name (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiWorkerGetRecurringJobsNameGetAsync($name) - { - return $this->apiWorkerGetRecurringJobsNameGetAsyncWithHttpInfo($name) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiWorkerGetRecurringJobsNameGetAsyncWithHttpInfo - * - * - * - * @param string $name (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiWorkerGetRecurringJobsNameGetAsyncWithHttpInfo($name) - { - $returnType = ''; - $request = $this->apiWorkerGetRecurringJobsNameGetRequest($name); - - 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 'apiWorkerGetRecurringJobsNameGet' - * - * @param string $name (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiWorkerGetRecurringJobsNameGetRequest($name) - { - // 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 apiWorkerGetRecurringJobsNameGet' - ); - } - - $resourcePath = '/api/Worker/getRecurringJobs/{name}'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - // path params - if ($name !== null) { - $resourcePath = str_replace( - '{' . 'name' . '}', - ObjectSerializer::toPathValue($name), - $resourcePath - ); - } - - // 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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiWorkerGetScheduledJobsNameGet - * - * @param string $name name (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function apiWorkerGetScheduledJobsNameGet($name) - { - $this->apiWorkerGetScheduledJobsNameGetWithHttpInfo($name); - } - - /** - * Operation apiWorkerGetScheduledJobsNameGetWithHttpInfo - * - * @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 apiWorkerGetScheduledJobsNameGetWithHttpInfo($name) - { - $returnType = ''; - $request = $this->apiWorkerGetScheduledJobsNameGetRequest($name); - - 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 apiWorkerGetScheduledJobsNameGetAsync - * - * - * - * @param string $name (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiWorkerGetScheduledJobsNameGetAsync($name) - { - return $this->apiWorkerGetScheduledJobsNameGetAsyncWithHttpInfo($name) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiWorkerGetScheduledJobsNameGetAsyncWithHttpInfo - * - * - * - * @param string $name (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiWorkerGetScheduledJobsNameGetAsyncWithHttpInfo($name) - { - $returnType = ''; - $request = $this->apiWorkerGetScheduledJobsNameGetRequest($name); - - 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 'apiWorkerGetScheduledJobsNameGet' - * - * @param string $name (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiWorkerGetScheduledJobsNameGetRequest($name) - { - // 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 apiWorkerGetScheduledJobsNameGet' - ); - } - - $resourcePath = '/api/Worker/getScheduledJobs/{name}'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - // path params - if ($name !== null) { - $resourcePath = str_replace( - '{' . 'name' . '}', - ObjectSerializer::toPathValue($name), - $resourcePath - ); - } - - // 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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiWorkerJobIdDelete - * - * @param string $id id (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function apiWorkerJobIdDelete($id) - { - $this->apiWorkerJobIdDeleteWithHttpInfo($id); - } - - /** - * Operation apiWorkerJobIdDeleteWithHttpInfo - * - * @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 apiWorkerJobIdDeleteWithHttpInfo($id) - { - $returnType = ''; - $request = $this->apiWorkerJobIdDeleteRequest($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() - ); - } - - return [null, $statusCode, $response->getHeaders()]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - } - throw $e; - } - } - - /** - * Operation apiWorkerJobIdDeleteAsync - * - * - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiWorkerJobIdDeleteAsync($id) - { - return $this->apiWorkerJobIdDeleteAsyncWithHttpInfo($id) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiWorkerJobIdDeleteAsyncWithHttpInfo - * - * - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiWorkerJobIdDeleteAsyncWithHttpInfo($id) - { - $returnType = ''; - $request = $this->apiWorkerJobIdDeleteRequest($id); - - 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 'apiWorkerJobIdDelete' - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiWorkerJobIdDeleteRequest($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 apiWorkerJobIdDelete' - ); - } - - $resourcePath = '/api/Worker/job/{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( - [] - ); - } 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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiWorkerJobIdGet - * - * @param string $id id (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function apiWorkerJobIdGet($id) - { - $this->apiWorkerJobIdGetWithHttpInfo($id); - } - - /** - * Operation apiWorkerJobIdGetWithHttpInfo - * - * @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 apiWorkerJobIdGetWithHttpInfo($id) - { - $returnType = ''; - $request = $this->apiWorkerJobIdGetRequest($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() - ); - } - - return [null, $statusCode, $response->getHeaders()]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - } - throw $e; - } - } - - /** - * Operation apiWorkerJobIdGetAsync - * - * - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiWorkerJobIdGetAsync($id) - { - return $this->apiWorkerJobIdGetAsyncWithHttpInfo($id) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiWorkerJobIdGetAsyncWithHttpInfo - * - * - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiWorkerJobIdGetAsyncWithHttpInfo($id) - { - $returnType = ''; - $request = $this->apiWorkerJobIdGetRequest($id); - - 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 'apiWorkerJobIdGet' - * - * @param string $id (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiWorkerJobIdGetRequest($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 apiWorkerJobIdGet' - ); - } - - $resourcePath = '/api/Worker/job/{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( - [] - ); - } 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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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 apiWorkerJobPost - * - * @param \Yoast\MyYoastApiClient\Model\AddJobDto $body body (required) - * - * @throws \Yoast\MyYoastApiClient\ApiException on non-2xx response - * @throws \InvalidArgumentException - * @return void - */ - public function apiWorkerJobPost($body) - { - $this->apiWorkerJobPostWithHttpInfo($body); - } - - /** - * Operation apiWorkerJobPostWithHttpInfo - * - * @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 apiWorkerJobPostWithHttpInfo($body) - { - $returnType = ''; - $request = $this->apiWorkerJobPostRequest($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() - ); - } - - return [null, $statusCode, $response->getHeaders()]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - } - throw $e; - } - } - - /** - * Operation apiWorkerJobPostAsync - * - * - * - * @param \Yoast\MyYoastApiClient\Model\AddJobDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiWorkerJobPostAsync($body) - { - return $this->apiWorkerJobPostAsyncWithHttpInfo($body) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation apiWorkerJobPostAsyncWithHttpInfo - * - * - * - * @param \Yoast\MyYoastApiClient\Model\AddJobDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function apiWorkerJobPostAsyncWithHttpInfo($body) - { - $returnType = ''; - $request = $this->apiWorkerJobPostRequest($body); - - 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 'apiWorkerJobPost' - * - * @param \Yoast\MyYoastApiClient\Model\AddJobDto $body (required) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function apiWorkerJobPostRequest($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 apiWorkerJobPost' - ); - } - - $resourcePath = '/api/Worker/job'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - - // body params - $_tempBody = null; - if (isset($body)) { - $_tempBody = $body; - } - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); - } 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 API key authentication - $apiKey = $this->config->getApiKeyWithPrefix('access_token'); - if ($apiKey !== null) { - $queryParams['access_token'] = $apiKey; - } - - $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/ApiException.php b/src/ApiException.php deleted file mode 100644 index cdd6aac..0000000 --- a/src/ApiException.php +++ /dev/null @@ -1,120 +0,0 @@ -responseHeaders = $responseHeaders; - $this->responseBody = $responseBody; - } - - /** - * Gets the HTTP response header - * - * @return string[]|null HTTP response header - */ - public function getResponseHeaders() - { - return $this->responseHeaders; - } - - /** - * Gets the HTTP body of the server response either as Json or string - * - * @return mixed HTTP body of the server response either as \stdClass or string - */ - public function getResponseBody() - { - return $this->responseBody; - } - - /** - * Sets the deseralized response object (during deserialization) - * - * @param mixed $obj Deserialized response object - * - * @return void - */ - public function setResponseObject($obj) - { - $this->responseObject = $obj; - } - - /** - * Gets the deseralized response object (during deserialization) - * - * @return mixed the deserialized response object - */ - public function getResponseObject() - { - return $this->responseObject; - } -} diff --git a/src/Configuration.php b/src/Configuration.php deleted file mode 100644 index c94aa91..0000000 --- a/src/Configuration.php +++ /dev/null @@ -1,428 +0,0 @@ -tempFolderPath = sys_get_temp_dir(); - } - - /** - * Sets API key - * - * @param string $apiKeyIdentifier API key identifier (authentication scheme) - * @param string $key API key or token - * - * @return $this - */ - public function setApiKey($apiKeyIdentifier, $key) - { - $this->apiKeys[$apiKeyIdentifier] = $key; - return $this; - } - - /** - * Gets API key - * - * @param string $apiKeyIdentifier API key identifier (authentication scheme) - * - * @return string API key or token - */ - public function getApiKey($apiKeyIdentifier) - { - return isset($this->apiKeys[$apiKeyIdentifier]) ? $this->apiKeys[$apiKeyIdentifier] : null; - } - - /** - * Sets the prefix for API key (e.g. Bearer) - * - * @param string $apiKeyIdentifier API key identifier (authentication scheme) - * @param string $prefix API key prefix, e.g. Bearer - * - * @return $this - */ - public function setApiKeyPrefix($apiKeyIdentifier, $prefix) - { - $this->apiKeyPrefixes[$apiKeyIdentifier] = $prefix; - return $this; - } - - /** - * Gets API key prefix - * - * @param string $apiKeyIdentifier API key identifier (authentication scheme) - * - * @return string - */ - public function getApiKeyPrefix($apiKeyIdentifier) - { - return isset($this->apiKeyPrefixes[$apiKeyIdentifier]) ? $this->apiKeyPrefixes[$apiKeyIdentifier] : null; - } - - /** - * Sets the access token for OAuth - * - * @param string $accessToken Token for OAuth - * - * @return $this - */ - public function setAccessToken($accessToken) - { - $this->accessToken = $accessToken; - return $this; - } - - /** - * Gets the access token for OAuth - * - * @return string Access token for OAuth - */ - public function getAccessToken() - { - return $this->accessToken; - } - - /** - * Sets the username for HTTP basic authentication - * - * @param string $username Username for HTTP basic authentication - * - * @return $this - */ - public function setUsername($username) - { - $this->username = $username; - return $this; - } - - /** - * Gets the username for HTTP basic authentication - * - * @return string Username for HTTP basic authentication - */ - public function getUsername() - { - return $this->username; - } - - /** - * Sets the password for HTTP basic authentication - * - * @param string $password Password for HTTP basic authentication - * - * @return $this - */ - public function setPassword($password) - { - $this->password = $password; - return $this; - } - - /** - * Gets the password for HTTP basic authentication - * - * @return string Password for HTTP basic authentication - */ - public function getPassword() - { - return $this->password; - } - - /** - * Sets the host - * - * @param string $host Host - * - * @return $this - */ - public function setHost($host) - { - $this->host = $host; - return $this; - } - - /** - * Gets the host - * - * @return string Host - */ - public function getHost() - { - return $this->host; - } - - /** - * Sets the user agent of the api client - * - * @param string $userAgent the user agent of the api client - * - * @throws \InvalidArgumentException - * @return $this - */ - public function setUserAgent($userAgent) - { - if (!is_string($userAgent)) { - throw new \InvalidArgumentException('User-agent must be a string.'); - } - - $this->userAgent = $userAgent; - return $this; - } - - /** - * Gets the user agent of the api client - * - * @return string user agent - */ - public function getUserAgent() - { - return $this->userAgent; - } - - /** - * Sets debug flag - * - * @param bool $debug Debug flag - * - * @return $this - */ - public function setDebug($debug) - { - $this->debug = $debug; - return $this; - } - - /** - * Gets the debug flag - * - * @return bool - */ - public function getDebug() - { - return $this->debug; - } - - /** - * Sets the debug file - * - * @param string $debugFile Debug file - * - * @return $this - */ - public function setDebugFile($debugFile) - { - $this->debugFile = $debugFile; - return $this; - } - - /** - * Gets the debug file - * - * @return string - */ - public function getDebugFile() - { - return $this->debugFile; - } - - /** - * Sets the temp folder path - * - * @param string $tempFolderPath Temp folder path - * - * @return $this - */ - public function setTempFolderPath($tempFolderPath) - { - $this->tempFolderPath = $tempFolderPath; - return $this; - } - - /** - * Gets the temp folder path - * - * @return string Temp folder path - */ - public function getTempFolderPath() - { - return $this->tempFolderPath; - } - - /** - * Gets the default configuration instance - * - * @return Configuration - */ - public static function getDefaultConfiguration() - { - if (self::$defaultConfiguration === null) { - self::$defaultConfiguration = new Configuration(); - } - - return self::$defaultConfiguration; - } - - /** - * Sets the detault configuration instance - * - * @param Configuration $config An instance of the Configuration Object - * - * @return void - */ - public static function setDefaultConfiguration(Configuration $config) - { - self::$defaultConfiguration = $config; - } - - /** - * Gets the essential information for debugging - * - * @return string The report for debugging - */ - public static function toDebugReport() - { - $report = 'PHP SDK (Yoast\MyYoastApiClient) Debug Report:' . PHP_EOL; - $report .= ' OS: ' . php_uname() . PHP_EOL; - $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; - $report .= ' OpenAPI Spec Version: 1.0.0' . PHP_EOL; - $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; - - return $report; - } - - /** - * Get API key (with prefix if set) - * - * @param string $apiKeyIdentifier name of apikey - * - * @return string API key with the prefix - */ - public function getApiKeyWithPrefix($apiKeyIdentifier) - { - $prefix = $this->getApiKeyPrefix($apiKeyIdentifier); - $apiKey = $this->getApiKey($apiKeyIdentifier); - - if ($apiKey === null) { - return null; - } - - if ($prefix === null) { - $keyWithPrefix = $apiKey; - } else { - $keyWithPrefix = $prefix . ' ' . $apiKey; - } - - return $keyWithPrefix; - } -} diff --git a/src/HeaderSelector.php b/src/HeaderSelector.php deleted file mode 100644 index 6f52757..0000000 --- a/src/HeaderSelector.php +++ /dev/null @@ -1,109 +0,0 @@ -selectAcceptHeader($accept); - if ($accept !== null) { - $headers['Accept'] = $accept; - } - - $headers['Content-Type'] = $this->selectContentTypeHeader($contentTypes); - return $headers; - } - - /** - * @param string[] $accept - * @return array - */ - public function selectHeadersForMultipart($accept) - { - $headers = $this->selectHeaders($accept, []); - - unset($headers['Content-Type']); - return $headers; - } - - /** - * Return the header 'Accept' based on an array of Accept provided - * - * @param string[] $accept Array of header - * - * @return string Accept (e.g. application/json) - */ - private function selectAcceptHeader($accept) - { - if (count($accept) === 0 || (count($accept) === 1 && $accept[0] === '')) { - return null; - } elseif (preg_grep("/application\/json/i", $accept)) { - return 'application/json'; - } else { - return implode(',', $accept); - } - } - - /** - * Return the content type based on an array of content-type provided - * - * @param string[] $contentType Array fo content-type - * - * @return string Content-Type (e.g. application/json) - */ - private function selectContentTypeHeader($contentType) - { - if (count($contentType) === 0 || (count($contentType) === 1 && $contentType[0] === '')) { - return 'application/json'; - } elseif (preg_grep("/application\/json/i", $contentType)) { - return 'application/json'; - } else { - return implode(',', $contentType); - } - } -} - diff --git a/src/Model/AcademyCourseAccessListDto.php b/src/Model/AcademyCourseAccessListDto.php deleted file mode 100644 index e03a0d4..0000000 --- a/src/Model/AcademyCourseAccessListDto.php +++ /dev/null @@ -1,294 +0,0 @@ - 'string[]' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'courseIds' => 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 = [ - 'courseIds' => 'courseIds' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'courseIds' => 'setCourseIds' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'courseIds' => 'getCourseIds' ]; - - /** - * 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['courseIds'] = isset($data['courseIds']) ? $data['courseIds'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['courseIds'] === null) { - $invalidProperties[] = "'courseIds' 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 courseIds - * - * @return string[] - */ - public function getCourseIds() - { - return $this->container['courseIds']; - } - - /** - * Sets courseIds - * - * @param string[] $courseIds courseIds - * - * @return $this - */ - public function setCourseIds($courseIds) - { - $this->container['courseIds'] = $courseIds; - - 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/AccessToken.php b/src/Model/AccessToken.php deleted file mode 100644 index cdb5ca7..0000000 --- a/src/Model/AccessToken.php +++ /dev/null @@ -1,459 +0,0 @@ - 'string', -'ttl' => 'int', -'created' => '\DateTime', -'createdAt' => '\DateTime', -'modifiedAt' => '\DateTime', -'userId' => 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'id' => null, -'ttl' => null, -'created' => 'date-time', -'createdAt' => 'date-time', -'modifiedAt' => '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', -'ttl' => 'ttl', -'created' => 'created', -'createdAt' => 'createdAt', -'modifiedAt' => 'modifiedAt', -'userId' => 'userId' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'id' => 'setId', -'ttl' => 'setTtl', -'created' => 'setCreated', -'createdAt' => 'setCreatedAt', -'modifiedAt' => 'setModifiedAt', -'userId' => 'setUserId' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'id' => 'getId', -'ttl' => 'getTtl', -'created' => 'getCreated', -'createdAt' => 'getCreatedAt', -'modifiedAt' => 'getModifiedAt', -'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['ttl'] = isset($data['ttl']) ? $data['ttl'] : null; - $this->container['created'] = isset($data['created']) ? $data['created'] : null; - $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null; - $this->container['modifiedAt'] = isset($data['modifiedAt']) ? $data['modifiedAt'] : 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['ttl'] === null) { - $invalidProperties[] = "'ttl' can't be null"; - } - if ($this->container['created'] === null) { - $invalidProperties[] = "'created' 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['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 ttl - * - * @return int - */ - public function getTtl() - { - return $this->container['ttl']; - } - - /** - * Sets ttl - * - * @param int $ttl ttl - * - * @return $this - */ - public function setTtl($ttl) - { - $this->container['ttl'] = $ttl; - - 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 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 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/ActivateAccountDto.php b/src/Model/ActivateAccountDto.php deleted file mode 100644 index bbde36b..0000000 --- a/src/Model/ActivateAccountDto.php +++ /dev/null @@ -1,294 +0,0 @@ - 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'key' => 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 = [ - 'key' => 'key' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'key' => 'setKey' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'key' => 'getKey' ]; - - /** - * 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['key'] = isset($data['key']) ? $data['key'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['key'] === null) { - $invalidProperties[] = "'key' 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 key - * - * @return string - */ - public function getKey() - { - return $this->container['key']; - } - - /** - * Sets key - * - * @param string $key key - * - * @return $this - */ - public function setKey($key) - { - $this->container['key'] = $key; - - 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/AddJobDto.php b/src/Model/AddJobDto.php deleted file mode 100644 index 15286e6..0000000 --- a/src/Model/AddJobDto.php +++ /dev/null @@ -1,354 +0,0 @@ - 'string', -'data' => 'object', -'options' => '\Yoast\MyYoastApiClient\Model\JobOptionsDto' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'name' => null, -'data' => null, -'options' => 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 = [ - 'name' => 'name', -'data' => 'data', -'options' => 'options' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'name' => 'setName', -'data' => 'setData', -'options' => 'setOptions' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'name' => 'getName', -'data' => 'getData', -'options' => 'getOptions' ]; - - /** - * 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['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['data'] = isset($data['data']) ? $data['data'] : null; - $this->container['options'] = isset($data['options']) ? $data['options'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['name'] === null) { - $invalidProperties[] = "'name' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets 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 data - * - * @return object - */ - public function getData() - { - return $this->container['data']; - } - - /** - * Sets data - * - * @param object $data data - * - * @return $this - */ - public function setData($data) - { - $this->container['data'] = $data; - - return $this; - } - - /** - * Gets options - * - * @return \Yoast\MyYoastApiClient\Model\JobOptionsDto - */ - public function getOptions() - { - return $this->container['options']; - } - - /** - * Sets options - * - * @param \Yoast\MyYoastApiClient\Model\JobOptionsDto $options options - * - * @return $this - */ - public function setOptions($options) - { - $this->container['options'] = $options; - - 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/AddSubscriptionDto.php b/src/Model/AddSubscriptionDto.php deleted file mode 100644 index e84c1d3..0000000 --- a/src/Model/AddSubscriptionDto.php +++ /dev/null @@ -1,294 +0,0 @@ - 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'subscriptionId' => 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 = [ - 'subscriptionId' => 'subscriptionId' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'subscriptionId' => 'setSubscriptionId' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - '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['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['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 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/Admission.php b/src/Model/Admission.php deleted file mode 100644 index 17d188c..0000000 --- a/src/Model/Admission.php +++ /dev/null @@ -1,459 +0,0 @@ - '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 deleted file mode 100644 index d1bdc12..0000000 --- a/src/Model/AutoRenewalCountResponseDto.php +++ /dev/null @@ -1,294 +0,0 @@ - 'int' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'amount' => 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 = [ - 'amount' => 'amount' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'amount' => 'setAmount' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'amount' => 'getAmount' ]; - - /** - * 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['amount'] = isset($data['amount']) ? $data['amount'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['amount'] === null) { - $invalidProperties[] = "'amount' 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 amount - * - * @return int - */ - public function getAmount() - { - return $this->container['amount']; - } - - /** - * Sets amount - * - * @param int $amount amount - * - * @return $this - */ - public function setAmount($amount) - { - $this->container['amount'] = $amount; - - 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/BillingDto.php b/src/Model/BillingDto.php deleted file mode 100644 index 3d6059e..0000000 --- a/src/Model/BillingDto.php +++ /dev/null @@ -1,624 +0,0 @@ - '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 - * - * @var string[] - */ - 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 ]; - - /** - * 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 = [ - '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' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - 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' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - 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' ]; - - /** - * 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['firstName'] = isset($data['firstName']) ? $data['firstName'] : null; - $this->container['lastName'] = isset($data['lastName']) ? $data['lastName'] : null; - $this->container['company'] = isset($data['company']) ? $data['company'] : null; - $this->container['address1'] = isset($data['address1']) ? $data['address1'] : null; - $this->container['address2'] = isset($data['address2']) ? $data['address2'] : null; - $this->container['city'] = isset($data['city']) ? $data['city'] : null; - $this->container['state'] = isset($data['state']) ? $data['state'] : null; - $this->container['postcode'] = isset($data['postcode']) ? $data['postcode'] : null; - $this->container['country'] = isset($data['country']) ? $data['country'] : null; - $this->container['email'] = isset($data['email']) ? $data['email'] : null; - $this->container['phone'] = isset($data['phone']) ? $data['phone'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['firstName'] === null) { - $invalidProperties[] = "'firstName' can't be null"; - } - if ($this->container['lastName'] === null) { - $invalidProperties[] = "'lastName' can't be null"; - } - if ($this->container['company'] === null) { - $invalidProperties[] = "'company' can't be null"; - } - if ($this->container['address1'] === null) { - $invalidProperties[] = "'address1' can't be null"; - } - if ($this->container['address2'] === null) { - $invalidProperties[] = "'address2' can't be null"; - } - if ($this->container['city'] === null) { - $invalidProperties[] = "'city' can't be null"; - } - if ($this->container['state'] === null) { - $invalidProperties[] = "'state' can't be null"; - } - if ($this->container['postcode'] === null) { - $invalidProperties[] = "'postcode' can't be null"; - } - if ($this->container['country'] === null) { - $invalidProperties[] = "'country' can't be null"; - } - if ($this->container['email'] === null) { - $invalidProperties[] = "'email' can't be null"; - } - if ($this->container['phone'] === null) { - $invalidProperties[] = "'phone' 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 firstName - * - * @return string - */ - public function getFirstName() - { - return $this->container['firstName']; - } - - /** - * Sets firstName - * - * @param string $firstName firstName - * - * @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 lastName - * - * @return $this - */ - public function setLastName($lastName) - { - $this->container['lastName'] = $lastName; - - return $this; - } - - /** - * Gets company - * - * @return string - */ - public function getCompany() - { - return $this->container['company']; - } - - /** - * Sets company - * - * @param string $company company - * - * @return $this - */ - public function setCompany($company) - { - $this->container['company'] = $company; - - return $this; - } - - /** - * Gets address1 - * - * @return string - */ - public function getAddress1() - { - return $this->container['address1']; - } - - /** - * Sets address1 - * - * @param string $address1 address1 - * - * @return $this - */ - public function setAddress1($address1) - { - $this->container['address1'] = $address1; - - return $this; - } - - /** - * Gets address2 - * - * @return string - */ - public function getAddress2() - { - return $this->container['address2']; - } - - /** - * Sets address2 - * - * @param string $address2 address2 - * - * @return $this - */ - public function setAddress2($address2) - { - $this->container['address2'] = $address2; - - return $this; - } - - /** - * Gets city - * - * @return string - */ - public function getCity() - { - return $this->container['city']; - } - - /** - * Sets city - * - * @param string $city city - * - * @return $this - */ - public function setCity($city) - { - $this->container['city'] = $city; - - return $this; - } - - /** - * Gets state - * - * @return string - */ - public function getState() - { - return $this->container['state']; - } - - /** - * Sets state - * - * @param string $state state - * - * @return $this - */ - public function setState($state) - { - $this->container['state'] = $state; - - return $this; - } - - /** - * Gets postcode - * - * @return string - */ - public function getPostcode() - { - return $this->container['postcode']; - } - - /** - * Sets postcode - * - * @param string $postcode postcode - * - * @return $this - */ - public function setPostcode($postcode) - { - $this->container['postcode'] = $postcode; - - return $this; - } - - /** - * Gets country - * - * @return string - */ - public function getCountry() - { - return $this->container['country']; - } - - /** - * Sets country - * - * @param string $country country - * - * @return $this - */ - public function setCountry($country) - { - $this->container['country'] = $country; - - return $this; - } - - /** - * 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 phone - * - * @return string - */ - public function getPhone() - { - return $this->container['phone']; - } - - /** - * Sets phone - * - * @param string $phone phone - * - * @return $this - */ - public function setPhone($phone) - { - $this->container['phone'] = $phone; - - 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/Blacklist.php b/src/Model/Blacklist.php deleted file mode 100644 index e3e85d7..0000000 --- a/src/Model/Blacklist.php +++ /dev/null @@ -1,360 +0,0 @@ - 'string', -'url' => 'string', -'dateAdded' => '\DateTime' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'id' => null, -'url' => null, -'dateAdded' => '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', -'url' => 'url', -'dateAdded' => 'dateAdded' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'id' => 'setId', -'url' => 'setUrl', -'dateAdded' => 'setDateAdded' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'id' => 'getId', -'url' => 'getUrl', -'dateAdded' => 'getDateAdded' ]; - - /** - * 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['url'] = isset($data['url']) ? $data['url'] : null; - $this->container['dateAdded'] = isset($data['dateAdded']) ? $data['dateAdded'] : 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['url'] === null) { - $invalidProperties[] = "'url' can't be null"; - } - if ($this->container['dateAdded'] === null) { - $invalidProperties[] = "'dateAdded' 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 url - * - * @return string - */ - public function getUrl() - { - return $this->container['url']; - } - - /** - * Sets url - * - * @param string $url url - * - * @return $this - */ - public function setUrl($url) - { - $this->container['url'] = $url; - - return $this; - } - - /** - * Gets dateAdded - * - * @return \DateTime - */ - public function getDateAdded() - { - return $this->container['dateAdded']; - } - - /** - * Sets dateAdded - * - * @param \DateTime $dateAdded dateAdded - * - * @return $this - */ - public function setDateAdded($dateAdded) - { - $this->container['dateAdded'] = $dateAdded; - - 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/BulkInviteDto.php b/src/Model/BulkInviteDto.php deleted file mode 100644 index c3d90f9..0000000 --- a/src/Model/BulkInviteDto.php +++ /dev/null @@ -1,360 +0,0 @@ - 'string', -'lineItemNumber' => 'string', -'email' => 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'lineItemId' => null, -'lineItemNumber' => null, -'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 = [ - 'lineItemId' => 'lineItemId', -'lineItemNumber' => 'lineItemNumber', -'email' => 'email' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'lineItemId' => 'setLineItemId', -'lineItemNumber' => 'setLineItemNumber', -'email' => 'setEmail' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'lineItemId' => 'getLineItemId', -'lineItemNumber' => 'getLineItemNumber', -'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['lineItemId'] = isset($data['lineItemId']) ? $data['lineItemId'] : null; - $this->container['lineItemNumber'] = isset($data['lineItemNumber']) ? $data['lineItemNumber'] : 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['lineItemId'] === null) { - $invalidProperties[] = "'lineItemId' can't be null"; - } - if ($this->container['lineItemNumber'] === null) { - $invalidProperties[] = "'lineItemNumber' can't be null"; - } - 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 lineItemId - * - * @return string - */ - public function getLineItemId() - { - return $this->container['lineItemId']; - } - - /** - * Sets lineItemId - * - * @param string $lineItemId lineItemId - * - * @return $this - */ - public function setLineItemId($lineItemId) - { - $this->container['lineItemId'] = $lineItemId; - - return $this; - } - - /** - * Gets lineItemNumber - * - * @return string - */ - public function getLineItemNumber() - { - return $this->container['lineItemNumber']; - } - - /** - * Sets lineItemNumber - * - * @param string $lineItemNumber lineItemNumber - * - * @return $this - */ - public function setLineItemNumber($lineItemNumber) - { - $this->container['lineItemNumber'] = $lineItemNumber; - - return $this; - } - - /** - * 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/BulkSendEmailDto.php b/src/Model/BulkSendEmailDto.php deleted file mode 100644 index 1d33920..0000000 --- a/src/Model/BulkSendEmailDto.php +++ /dev/null @@ -1,327 +0,0 @@ - '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 deleted file mode 100644 index f31fde7..0000000 --- a/src/Model/CancelProvisionedSubscriptionDto.php +++ /dev/null @@ -1,291 +0,0 @@ - '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'] : false; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets 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 deleted file mode 100644 index eaddc53..0000000 --- a/src/Model/CancelSubscriptionBodyDto.php +++ /dev/null @@ -1,294 +0,0 @@ - 'int' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'amount' => 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 = [ - 'amount' => 'amount' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'amount' => 'setAmount' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'amount' => 'getAmount' ]; - - /** - * 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['amount'] = isset($data['amount']) ? $data['amount'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['amount'] === null) { - $invalidProperties[] = "'amount' 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 amount - * - * @return int - */ - public function getAmount() - { - return $this->container['amount']; - } - - /** - * Sets amount - * - * @param int $amount amount - * - * @return $this - */ - public function setAmount($amount) - { - $this->container['amount'] = $amount; - - 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/ChangePasswordDto.php b/src/Model/ChangePasswordDto.php deleted file mode 100644 index 23cfbd0..0000000 --- a/src/Model/ChangePasswordDto.php +++ /dev/null @@ -1,360 +0,0 @@ - 'string', -'passwordConfirmation' => 'string', -'oldPassword' => 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'password' => null, -'passwordConfirmation' => null, -'oldPassword' => 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 = [ - 'password' => 'password', -'passwordConfirmation' => 'password_confirmation', -'oldPassword' => 'old_password' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'password' => 'setPassword', -'passwordConfirmation' => 'setPasswordConfirmation', -'oldPassword' => 'setOldPassword' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'password' => 'getPassword', -'passwordConfirmation' => 'getPasswordConfirmation', -'oldPassword' => 'getOldPassword' ]; - - /** - * 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['password'] = isset($data['password']) ? $data['password'] : null; - $this->container['passwordConfirmation'] = isset($data['passwordConfirmation']) ? $data['passwordConfirmation'] : null; - $this->container['oldPassword'] = isset($data['oldPassword']) ? $data['oldPassword'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['password'] === null) { - $invalidProperties[] = "'password' can't be null"; - } - if ($this->container['passwordConfirmation'] === null) { - $invalidProperties[] = "'passwordConfirmation' can't be null"; - } - if ($this->container['oldPassword'] === null) { - $invalidProperties[] = "'oldPassword' 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 password - * - * @return string - */ - public function getPassword() - { - return $this->container['password']; - } - - /** - * Sets password - * - * @param string $password password - * - * @return $this - */ - public function setPassword($password) - { - $this->container['password'] = $password; - - return $this; - } - - /** - * Gets passwordConfirmation - * - * @return string - */ - public function getPasswordConfirmation() - { - return $this->container['passwordConfirmation']; - } - - /** - * Sets passwordConfirmation - * - * @param string $passwordConfirmation passwordConfirmation - * - * @return $this - */ - public function setPasswordConfirmation($passwordConfirmation) - { - $this->container['passwordConfirmation'] = $passwordConfirmation; - - return $this; - } - - /** - * Gets oldPassword - * - * @return string - */ - public function getOldPassword() - { - return $this->container['oldPassword']; - } - - /** - * Sets oldPassword - * - * @param string $oldPassword oldPassword - * - * @return $this - */ - public function setOldPassword($oldPassword) - { - $this->container['oldPassword'] = $oldPassword; - - 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/Changelog.php b/src/Model/Changelog.php deleted file mode 100644 index 2b17e11..0000000 --- a/src/Model/Changelog.php +++ /dev/null @@ -1,426 +0,0 @@ - 'string', -'sourceId' => 'int', -'content' => 'string', -'createdAt' => '\DateTime', -'modifiedAt' => '\DateTime' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'id' => null, -'sourceId' => null, -'content' => null, -'createdAt' => 'date-time', -'modifiedAt' => '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', -'sourceId' => 'sourceId', -'content' => 'content', -'createdAt' => 'createdAt', -'modifiedAt' => 'modifiedAt' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'id' => 'setId', -'sourceId' => 'setSourceId', -'content' => 'setContent', -'createdAt' => 'setCreatedAt', -'modifiedAt' => 'setModifiedAt' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'id' => 'getId', -'sourceId' => 'getSourceId', -'content' => 'getContent', -'createdAt' => 'getCreatedAt', -'modifiedAt' => 'getModifiedAt' ]; - - /** - * 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['sourceId'] = isset($data['sourceId']) ? $data['sourceId'] : null; - $this->container['content'] = isset($data['content']) ? $data['content'] : null; - $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null; - $this->container['modifiedAt'] = isset($data['modifiedAt']) ? $data['modifiedAt'] : 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['sourceId'] === null) { - $invalidProperties[] = "'sourceId' can't be null"; - } - if ($this->container['content'] === null) { - $invalidProperties[] = "'content' 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"; - } - 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 sourceId - * - * @return int - */ - public function getSourceId() - { - return $this->container['sourceId']; - } - - /** - * Sets sourceId - * - * @param int $sourceId sourceId - * - * @return $this - */ - public function setSourceId($sourceId) - { - $this->container['sourceId'] = $sourceId; - - return $this; - } - - /** - * Gets content - * - * @return string - */ - public function getContent() - { - return $this->container['content']; - } - - /** - * Sets content - * - * @param string $content content - * - * @return $this - */ - public function setContent($content) - { - $this->container['content'] = $content; - - 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; - } - /** - * 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/ComposerToken.php b/src/Model/ComposerToken.php deleted file mode 100644 index 670adfa..0000000 --- a/src/Model/ComposerToken.php +++ /dev/null @@ -1,459 +0,0 @@ - 'string', -'name' => 'string', -'enabled' => 'bool', -'createdAt' => '\DateTime', -'modifiedAt' => '\DateTime', -'userId' => 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'id' => null, -'name' => null, -'enabled' => null, -'createdAt' => 'date-time', -'modifiedAt' => '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', -'name' => 'name', -'enabled' => 'enabled', -'createdAt' => 'createdAt', -'modifiedAt' => 'modifiedAt', -'userId' => 'userId' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'id' => 'setId', -'name' => 'setName', -'enabled' => 'setEnabled', -'createdAt' => 'setCreatedAt', -'modifiedAt' => 'setModifiedAt', -'userId' => 'setUserId' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'id' => 'getId', -'name' => 'getName', -'enabled' => 'getEnabled', -'createdAt' => 'getCreatedAt', -'modifiedAt' => 'getModifiedAt', -'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['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['enabled'] = isset($data['enabled']) ? $data['enabled'] : null; - $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null; - $this->container['modifiedAt'] = isset($data['modifiedAt']) ? $data['modifiedAt'] : 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['name'] === null) { - $invalidProperties[] = "'name' can't be null"; - } - if ($this->container['enabled'] === null) { - $invalidProperties[] = "'enabled' 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['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 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 enabled - * - * @return bool - */ - public function getEnabled() - { - return $this->container['enabled']; - } - - /** - * Sets enabled - * - * @param bool $enabled enabled - * - * @return $this - */ - public function setEnabled($enabled) - { - $this->container['enabled'] = $enabled; - - 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 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/CouponLineDto.php b/src/Model/CouponLineDto.php deleted file mode 100644 index 1909fe9..0000000 --- a/src/Model/CouponLineDto.php +++ /dev/null @@ -1,426 +0,0 @@ - 'int', -'code' => 'string', -'discount' => 'string', -'discountTax' => 'string', -'metaData' => '\Yoast\MyYoastApiClient\Model\MetaDataDto[]' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'id' => null, -'code' => null, -'discount' => null, -'discountTax' => 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', -'code' => 'code', -'discount' => 'discount', -'discountTax' => 'discount_tax', -'metaData' => 'meta_data' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'id' => 'setId', -'code' => 'setCode', -'discount' => 'setDiscount', -'discountTax' => 'setDiscountTax', -'metaData' => 'setMetaData' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'id' => 'getId', -'code' => 'getCode', -'discount' => 'getDiscount', -'discountTax' => 'getDiscountTax', -'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['code'] = isset($data['code']) ? $data['code'] : null; - $this->container['discount'] = isset($data['discount']) ? $data['discount'] : null; - $this->container['discountTax'] = isset($data['discountTax']) ? $data['discountTax'] : 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['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - if ($this->container['discount'] === null) { - $invalidProperties[] = "'discount' can't be null"; - } - if ($this->container['discountTax'] === null) { - $invalidProperties[] = "'discountTax' can't be null"; - } - if ($this->container['metaData'] === null) { - $invalidProperties[] = "'metaData' 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 code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return $this - */ - public function setCode($code) - { - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets discount - * - * @return string - */ - public function getDiscount() - { - return $this->container['discount']; - } - - /** - * Sets discount - * - * @param string $discount discount - * - * @return $this - */ - public function setDiscount($discount) - { - $this->container['discount'] = $discount; - - return $this; - } - - /** - * Gets discountTax - * - * @return string - */ - public function getDiscountTax() - { - return $this->container['discountTax']; - } - - /** - * Sets discountTax - * - * @param string $discountTax discountTax - * - * @return $this - */ - public function setDiscountTax($discountTax) - { - $this->container['discountTax'] = $discountTax; - - 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/Course.php b/src/Model/Course.php deleted file mode 100644 index ee1474b..0000000 --- a/src/Model/Course.php +++ /dev/null @@ -1,756 +0,0 @@ - '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 - * - * @var string[] - */ - 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 ]; - - /** - * 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', -'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) - * - * @var string[] - */ - 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' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - 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' ]; - - /** - * 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['courseUrl'] = isset($data['courseUrl']) ? $data['courseUrl'] : null; - $this->container['certificateUrl'] = isset($data['certificateUrl']) ? $data['certificateUrl'] : null; - $this->container['sourceId'] = isset($data['sourceId']) ? $data['sourceId'] : null; - $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null; - $this->container['modifiedAt'] = isset($data['modifiedAt']) ? $data['modifiedAt'] : null; - $this->container['iconUrl'] = isset($data['iconUrl']) ? $data['iconUrl'] : null; - $this->container['complimentary'] = isset($data['complimentary']) ? $data['complimentary'] : null; - $this->container['open'] = isset($data['open']) ? $data['open'] : null; - $this->container['hasTrial'] = isset($data['hasTrial']) ? $data['hasTrial'] : null; - $this->container['deprecated'] = isset($data['deprecated']) ? $data['deprecated'] : null; - $this->container['sale'] = isset($data['sale']) ? $data['sale'] : null; - $this->container['saleLabel'] = isset($data['saleLabel']) ? $data['saleLabel'] : 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['courseUrl'] === null) { - $invalidProperties[] = "'courseUrl' can't be null"; - } - if ($this->container['certificateUrl'] === null) { - $invalidProperties[] = "'certificateUrl' can't be null"; - } - if ($this->container['sourceId'] === null) { - $invalidProperties[] = "'sourceId' 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['iconUrl'] === null) { - $invalidProperties[] = "'iconUrl' can't be null"; - } - if ($this->container['complimentary'] === null) { - $invalidProperties[] = "'complimentary' can't be null"; - } - if ($this->container['open'] === null) { - $invalidProperties[] = "'open' can't be null"; - } - if ($this->container['hasTrial'] === null) { - $invalidProperties[] = "'hasTrial' can't be null"; - } - if ($this->container['deprecated'] === null) { - $invalidProperties[] = "'deprecated' can't be null"; - } - if ($this->container['sale'] === null) { - $invalidProperties[] = "'sale' can't be null"; - } - if ($this->container['saleLabel'] === null) { - $invalidProperties[] = "'saleLabel' 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 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 courseUrl - * - * @return string - */ - public function getCourseUrl() - { - return $this->container['courseUrl']; - } - - /** - * Sets courseUrl - * - * @param string $courseUrl courseUrl - * - * @return $this - */ - public function setCourseUrl($courseUrl) - { - $this->container['courseUrl'] = $courseUrl; - - return $this; - } - - /** - * Gets certificateUrl - * - * @return string - */ - public function getCertificateUrl() - { - return $this->container['certificateUrl']; - } - - /** - * Sets certificateUrl - * - * @param string $certificateUrl certificateUrl - * - * @return $this - */ - public function setCertificateUrl($certificateUrl) - { - $this->container['certificateUrl'] = $certificateUrl; - - return $this; - } - - /** - * Gets sourceId - * - * @return int - */ - public function getSourceId() - { - return $this->container['sourceId']; - } - - /** - * Sets sourceId - * - * @param int $sourceId sourceId - * - * @return $this - */ - public function setSourceId($sourceId) - { - $this->container['sourceId'] = $sourceId; - - 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 iconUrl - * - * @return string - */ - public function getIconUrl() - { - return $this->container['iconUrl']; - } - - /** - * Sets iconUrl - * - * @param string $iconUrl iconUrl - * - * @return $this - */ - public function setIconUrl($iconUrl) - { - $this->container['iconUrl'] = $iconUrl; - - return $this; - } - - /** - * Gets complimentary - * - * @return bool - */ - public function getComplimentary() - { - return $this->container['complimentary']; - } - - /** - * Sets complimentary - * - * @param bool $complimentary complimentary - * - * @return $this - */ - public function setComplimentary($complimentary) - { - $this->container['complimentary'] = $complimentary; - - return $this; - } - - /** - * Gets open - * - * @return bool - */ - public function getOpen() - { - return $this->container['open']; - } - - /** - * Sets open - * - * @param bool $open open - * - * @return $this - */ - public function setOpen($open) - { - $this->container['open'] = $open; - - return $this; - } - - /** - * Gets hasTrial - * - * @return bool - */ - public function getHasTrial() - { - return $this->container['hasTrial']; - } - - /** - * Sets hasTrial - * - * @param bool $hasTrial hasTrial - * - * @return $this - */ - public function setHasTrial($hasTrial) - { - $this->container['hasTrial'] = $hasTrial; - - return $this; - } - - /** - * Gets deprecated - * - * @return bool - */ - public function getDeprecated() - { - return $this->container['deprecated']; - } - - /** - * Sets deprecated - * - * @param bool $deprecated deprecated - * - * @return $this - */ - public function setDeprecated($deprecated) - { - $this->container['deprecated'] = $deprecated; - - return $this; - } - - /** - * Gets sale - * - * @return bool - */ - public function getSale() - { - return $this->container['sale']; - } - - /** - * Sets sale - * - * @param bool $sale sale - * - * @return $this - */ - public function setSale($sale) - { - $this->container['sale'] = $sale; - - return $this; - } - - /** - * Gets saleLabel - * - * @return string - */ - public function getSaleLabel() - { - return $this->container['saleLabel']; - } - - /** - * Sets saleLabel - * - * @param string $saleLabel saleLabel - * - * @return $this - */ - public function setSaleLabel($saleLabel) - { - $this->container['saleLabel'] = $saleLabel; - - 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/CourseDataDto.php b/src/Model/CourseDataDto.php deleted file mode 100644 index 4c744ea..0000000 --- a/src/Model/CourseDataDto.php +++ /dev/null @@ -1,327 +0,0 @@ - 'string', -'iD' => 'int' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'postTitle' => null, -'iD' => 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 = [ - 'postTitle' => 'post_title', -'iD' => 'ID' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'postTitle' => 'setPostTitle', -'iD' => 'setID' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'postTitle' => 'getPostTitle', -'iD' => 'getID' ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$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['postTitle'] = isset($data['postTitle']) ? $data['postTitle'] : null; - $this->container['iD'] = isset($data['iD']) ? $data['iD'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['postTitle'] === null) { - $invalidProperties[] = "'postTitle' can't be null"; - } - if ($this->container['iD'] === null) { - $invalidProperties[] = "'iD' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets postTitle - * - * @return string - */ - public function getPostTitle() - { - return $this->container['postTitle']; - } - - /** - * Sets postTitle - * - * @param string $postTitle postTitle - * - * @return $this - */ - public function setPostTitle($postTitle) - { - $this->container['postTitle'] = $postTitle; - - return $this; - } - - /** - * 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; - } - /** - * 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/CourseEnrollment.php b/src/Model/CourseEnrollment.php deleted file mode 100644 index dbd7598..0000000 --- a/src/Model/CourseEnrollment.php +++ /dev/null @@ -1,822 +0,0 @@ - '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 - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'id' => null, -'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 - * - * @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', -'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) - * - * @var string[] - */ - protected static $setters = [ - 'id' => 'setId', -'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) - * - * @var string[] - */ - protected static $getters = [ - 'id' => 'getId', -'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, - * 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['status'] = isset($data['status']) ? $data['status'] : null; - $this->container['progress'] = isset($data['progress']) ? $data['progress'] : null; - $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null; - $this->container['modifiedAt'] = isset($data['modifiedAt']) ? $data['modifiedAt'] : 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; - $this->container['studentId'] = isset($data['studentId']) ? $data['studentId'] : null; - $this->container['buyerId'] = isset($data['buyerId']) ? $data['buyerId'] : null; - $this->container['orderId'] = isset($data['orderId']) ? $data['orderId'] : null; - $this->container['courseId'] = isset($data['courseId']) ? $data['courseId'] : null; - $this->container['productId'] = isset($data['productId']) ? $data['productId'] : 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['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['progress'] === null) { - $invalidProperties[] = "'progress' 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['isTrial'] === null) { - $invalidProperties[] = "'isTrial' can't be null"; - } - if ($this->container['outsideTrialProgress'] === null) { - $invalidProperties[] = "'outsideTrialProgress' can't be null"; - } - 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"; - } - if ($this->container['lineItemNumber'] === null) { - $invalidProperties[] = "'lineItemNumber' can't be null"; - } - if ($this->container['expiryDate'] === null) { - $invalidProperties[] = "'expiryDate' 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['orderId'] === null) { - $invalidProperties[] = "'orderId' can't be null"; - } - if ($this->container['courseId'] === null) { - $invalidProperties[] = "'courseId' can't be null"; - } - if ($this->container['productId'] === null) { - $invalidProperties[] = "'productId' 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 status - * - * @return string - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param string $status status - * - * @return $this - */ - public function setStatus($status) - { - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets progress - * - * @return int - */ - public function getProgress() - { - return $this->container['progress']; - } - - /** - * Sets progress - * - * @param int $progress progress - * - * @return $this - */ - public function setProgress($progress) - { - $this->container['progress'] = $progress; - - 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 isTrial - * - * @return bool - */ - public function getIsTrial() - { - return $this->container['isTrial']; - } - - /** - * Sets isTrial - * - * @param bool $isTrial isTrial - * - * @return $this - */ - public function setIsTrial($isTrial) - { - $this->container['isTrial'] = $isTrial; - - return $this; - } - - /** - * Gets outsideTrialProgress - * - * @return bool - */ - public function getOutsideTrialProgress() - { - return $this->container['outsideTrialProgress']; - } - - /** - * Sets outsideTrialProgress - * - * @param bool $outsideTrialProgress outsideTrialProgress - * - * @return $this - */ - public function setOutsideTrialProgress($outsideTrialProgress) - { - $this->container['outsideTrialProgress'] = $outsideTrialProgress; - - return $this; - } - - /** - * Gets trialCompleted - * - * @return bool - */ - public function getTrialCompleted() - { - return $this->container['trialCompleted']; - } - - /** - * Sets trialCompleted - * - * @param bool $trialCompleted trialCompleted - * - * @return $this - */ - public function setTrialCompleted($trialCompleted) - { - $this->container['trialCompleted'] = $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 - * - * @return string - */ - public function getLineItemId() - { - return $this->container['lineItemId']; - } - - /** - * Sets lineItemId - * - * @param string $lineItemId lineItemId - * - * @return $this - */ - public function setLineItemId($lineItemId) - { - $this->container['lineItemId'] = $lineItemId; - - return $this; - } - - /** - * Gets lineItemNumber - * - * @return int - */ - public function getLineItemNumber() - { - return $this->container['lineItemNumber']; - } - - /** - * Sets lineItemNumber - * - * @param int $lineItemNumber lineItemNumber - * - * @return $this - */ - public function setLineItemNumber($lineItemNumber) - { - $this->container['lineItemNumber'] = $lineItemNumber; - - return $this; - } - - /** - * Gets expiryDate - * - * @return \DateTime - */ - public function getExpiryDate() - { - return $this->container['expiryDate']; - } - - /** - * Sets expiryDate - * - * @param \DateTime $expiryDate expiryDate - * - * @return $this - */ - public function setExpiryDate($expiryDate) - { - $this->container['expiryDate'] = $expiryDate; - - 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 orderId - * - * @return string - */ - public function getOrderId() - { - return $this->container['orderId']; - } - - /** - * Sets orderId - * - * @param string $orderId orderId - * - * @return $this - */ - public function setOrderId($orderId) - { - $this->container['orderId'] = $orderId; - - return $this; - } - - /** - * Gets courseId - * - * @return string - */ - public function getCourseId() - { - return $this->container['courseId']; - } - - /** - * Sets courseId - * - * @param string $courseId courseId - * - * @return $this - */ - public function setCourseId($courseId) - { - $this->container['courseId'] = $courseId; - - return $this; - } - - /** - * Gets productId - * - * @return string - */ - public function getProductId() - { - return $this->container['productId']; - } - - /** - * Sets productId - * - * @param string $productId productId - * - * @return $this - */ - public function setProductId($productId) - { - $this->container['productId'] = $productId; - - 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/CourseEnrollmentFromAcademyDto.php b/src/Model/CourseEnrollmentFromAcademyDto.php deleted file mode 100644 index 0a34740..0000000 --- a/src/Model/CourseEnrollmentFromAcademyDto.php +++ /dev/null @@ -1,294 +0,0 @@ - '\Yoast\MyYoastApiClient\Model\ProgressData' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'progressData' => 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 = [ - 'progressData' => 'progressData' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'progressData' => 'setProgressData' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'progressData' => 'getProgressData' ]; - - /** - * 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['progressData'] = isset($data['progressData']) ? $data['progressData'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['progressData'] === null) { - $invalidProperties[] = "'progressData' 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 progressData - * - * @return \Yoast\MyYoastApiClient\Model\ProgressData - */ - public function getProgressData() - { - return $this->container['progressData']; - } - - /** - * Sets progressData - * - * @param \Yoast\MyYoastApiClient\Model\ProgressData $progressData progressData - * - * @return $this - */ - public function setProgressData($progressData) - { - $this->container['progressData'] = $progressData; - - 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/CreateAccountDto.php b/src/Model/CreateAccountDto.php deleted file mode 100644 index 8c8778b..0000000 --- a/src/Model/CreateAccountDto.php +++ /dev/null @@ -1,354 +0,0 @@ - 'string', -'firstName' => 'string', -'lastName' => 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'userEmail' => 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 = [ - 'userEmail' => 'userEmail', -'firstName' => 'firstName', -'lastName' => 'lastName' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'userEmail' => 'setUserEmail', -'firstName' => 'setFirstName', -'lastName' => 'setLastName' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'userEmail' => 'getUserEmail', -'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['userEmail'] = isset($data['userEmail']) ? $data['userEmail'] : 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['userEmail'] === null) { - $invalidProperties[] = "'userEmail' 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 userEmail - * - * @return string - */ - public function getUserEmail() - { - return $this->container['userEmail']; - } - - /** - * Sets userEmail - * - * @param string $userEmail userEmail - * - * @return $this - */ - public function setUserEmail($userEmail) - { - $this->container['userEmail'] = $userEmail; - - return $this; - } - - /** - * Gets firstName - * - * @return string - */ - public function getFirstName() - { - return $this->container['firstName']; - } - - /** - * Sets firstName - * - * @param string $firstName firstName - * - * @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 lastName - * - * @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/CreateBlacklistSiteDto.php b/src/Model/CreateBlacklistSiteDto.php deleted file mode 100644 index 17cc2dd..0000000 --- a/src/Model/CreateBlacklistSiteDto.php +++ /dev/null @@ -1,266 +0,0 @@ -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/CreateCustomerNoteDto.php b/src/Model/CreateCustomerNoteDto.php deleted file mode 100644 index ff87ecc..0000000 --- a/src/Model/CreateCustomerNoteDto.php +++ /dev/null @@ -1,393 +0,0 @@ - 'string', -'authorId' => 'string', -'content' => 'string', -'nextContactDate' => '\DateTime' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'customerId' => null, -'authorId' => null, -'content' => null, -'nextContactDate' => '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 = [ - 'customerId' => 'customerId', -'authorId' => 'authorId', -'content' => 'content', -'nextContactDate' => 'nextContactDate' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'customerId' => 'setCustomerId', -'authorId' => 'setAuthorId', -'content' => 'setContent', -'nextContactDate' => 'setNextContactDate' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'customerId' => 'getCustomerId', -'authorId' => 'getAuthorId', -'content' => 'getContent', -'nextContactDate' => 'getNextContactDate' ]; - - /** - * 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['customerId'] = isset($data['customerId']) ? $data['customerId'] : null; - $this->container['authorId'] = isset($data['authorId']) ? $data['authorId'] : null; - $this->container['content'] = isset($data['content']) ? $data['content'] : null; - $this->container['nextContactDate'] = isset($data['nextContactDate']) ? $data['nextContactDate'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['customerId'] === null) { - $invalidProperties[] = "'customerId' can't be null"; - } - if ($this->container['authorId'] === null) { - $invalidProperties[] = "'authorId' can't be null"; - } - if ($this->container['content'] === null) { - $invalidProperties[] = "'content' can't be null"; - } - if ($this->container['nextContactDate'] === null) { - $invalidProperties[] = "'nextContactDate' 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 customerId - * - * @return string - */ - public function getCustomerId() - { - return $this->container['customerId']; - } - - /** - * Sets customerId - * - * @param string $customerId customerId - * - * @return $this - */ - public function setCustomerId($customerId) - { - $this->container['customerId'] = $customerId; - - return $this; - } - - /** - * Gets authorId - * - * @return string - */ - public function getAuthorId() - { - return $this->container['authorId']; - } - - /** - * Sets authorId - * - * @param string $authorId authorId - * - * @return $this - */ - public function setAuthorId($authorId) - { - $this->container['authorId'] = $authorId; - - return $this; - } - - /** - * Gets content - * - * @return string - */ - public function getContent() - { - return $this->container['content']; - } - - /** - * Sets content - * - * @param string $content content - * - * @return $this - */ - public function setContent($content) - { - $this->container['content'] = $content; - - return $this; - } - - /** - * Gets nextContactDate - * - * @return \DateTime - */ - public function getNextContactDate() - { - return $this->container['nextContactDate']; - } - - /** - * Sets nextContactDate - * - * @param \DateTime $nextContactDate nextContactDate - * - * @return $this - */ - public function setNextContactDate($nextContactDate) - { - $this->container['nextContactDate'] = $nextContactDate; - - 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/CreateDto.php b/src/Model/CreateDto.php deleted file mode 100644 index 4e05727..0000000 --- a/src/Model/CreateDto.php +++ /dev/null @@ -1,324 +0,0 @@ - '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 deleted file mode 100644 index 071eac0..0000000 --- a/src/Model/CreateProvisionedSubscriptionDto.php +++ /dev/null @@ -1,417 +0,0 @@ - '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"; - } - 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 connected 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 deleted file mode 100644 index 44f179a..0000000 --- a/src/Model/CreateSiteBodyDto.php +++ /dev/null @@ -1,357 +0,0 @@ - 'string', -'type' => 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'url' => 'url', -'type' => 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 = [ - 'url' => 'url', -'type' => 'type' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'url' => 'setUrl', -'type' => 'setType' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'url' => 'getUrl', -'type' => 'getType' ]; - - /** - * 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; - } - - const TYPE_WORDPRESS = 'wordpress'; -const TYPE_TYPO3 = 'typo3'; - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getTypeAllowableValues() - { - return [ - self::TYPE_WORDPRESS, -self::TYPE_TYPO3, ]; - } - - /** - * 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['url'] = isset($data['url']) ? $data['url'] : null; - $this->container['type'] = isset($data['type']) ? $data['type'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['url'] === null) { - $invalidProperties[] = "'url' can't be null"; - } - if ($this->container['type'] === null) { - $invalidProperties[] = "'type' can't be null"; - } - $allowedValues = $this->getTypeAllowableValues(); - if (!is_null($this->container['type']) && !in_array($this->container['type'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value for 'type', must be one of '%s'", - implode("', '", $allowedValues) - ); - } - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets url - * - * @return string - */ - public function getUrl() - { - return $this->container['url']; - } - - /** - * Sets url - * - * @param string $url url - * - * @return $this - */ - public function setUrl($url) - { - $this->container['url'] = $url; - - return $this; - } - - /** - * Gets type - * - * @return string - */ - public function getType() - { - return $this->container['type']; - } - - /** - * Sets type - * - * @param string $type type - * - * @return $this - */ - public function setType($type) - { - $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value for 'type', must be one of '%s'", - implode("', '", $allowedValues) - ) - ); - } - $this->container['type'] = $type; - - 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/Customer.php b/src/Model/Customer.php deleted file mode 100644 index 7f64f87..0000000 --- a/src/Model/Customer.php +++ /dev/null @@ -1,987 +0,0 @@ - '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 - * - * @var string[] - */ - 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 ]; - - /** - * 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', -'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) - * - * @var string[] - */ - 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' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - 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' ]; - - /** - * 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['sourceId'] = isset($data['sourceId']) ? $data['sourceId'] : null; - $this->container['enabled'] = isset($data['enabled']) ? $data['enabled'] : null; - $this->container['realm'] = isset($data['realm']) ? $data['realm'] : null; - $this->container['username'] = isset($data['username']) ? $data['username'] : null; - $this->container['email'] = isset($data['email']) ? $data['email'] : null; - $this->container['emailVerified'] = isset($data['emailVerified']) ? $data['emailVerified'] : null; - $this->container['verificationToken'] = isset($data['verificationToken']) ? $data['verificationToken'] : null; - $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null; - $this->container['modifiedAt'] = isset($data['modifiedAt']) ? $data['modifiedAt'] : null; - $this->container['userEmail'] = isset($data['userEmail']) ? $data['userEmail'] : null; - $this->container['userFirstName'] = isset($data['userFirstName']) ? $data['userFirstName'] : null; - $this->container['userLastName'] = isset($data['userLastName']) ? $data['userLastName'] : null; - $this->container['userCompany'] = isset($data['userCompany']) ? $data['userCompany'] : null; - $this->container['userAddress1'] = isset($data['userAddress1']) ? $data['userAddress1'] : null; - $this->container['userAddress2'] = isset($data['userAddress2']) ? $data['userAddress2'] : null; - $this->container['userCity'] = isset($data['userCity']) ? $data['userCity'] : null; - $this->container['userState'] = isset($data['userState']) ? $data['userState'] : null; - $this->container['userPostCode'] = isset($data['userPostCode']) ? $data['userPostCode'] : null; - $this->container['userCountry'] = isset($data['userCountry']) ? $data['userCountry'] : null; - $this->container['userPhone'] = isset($data['userPhone']) ? $data['userPhone'] : null; - $this->container['userAvatarUrl'] = isset($data['userAvatarUrl']) ? $data['userAvatarUrl'] : 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['sourceId'] === null) { - $invalidProperties[] = "'sourceId' can't be null"; - } - if ($this->container['enabled'] === null) { - $invalidProperties[] = "'enabled' can't be null"; - } - if ($this->container['realm'] === null) { - $invalidProperties[] = "'realm' can't be null"; - } - if ($this->container['username'] === null) { - $invalidProperties[] = "'username' can't be null"; - } - if ($this->container['email'] === null) { - $invalidProperties[] = "'email' can't be null"; - } - if ($this->container['emailVerified'] === null) { - $invalidProperties[] = "'emailVerified' can't be null"; - } - if ($this->container['verificationToken'] === null) { - $invalidProperties[] = "'verificationToken' 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['userEmail'] === null) { - $invalidProperties[] = "'userEmail' can't be null"; - } - if ($this->container['userFirstName'] === null) { - $invalidProperties[] = "'userFirstName' can't be null"; - } - if ($this->container['userLastName'] === null) { - $invalidProperties[] = "'userLastName' can't be null"; - } - if ($this->container['userCompany'] === null) { - $invalidProperties[] = "'userCompany' can't be null"; - } - if ($this->container['userAddress1'] === null) { - $invalidProperties[] = "'userAddress1' can't be null"; - } - if ($this->container['userAddress2'] === null) { - $invalidProperties[] = "'userAddress2' can't be null"; - } - if ($this->container['userCity'] === null) { - $invalidProperties[] = "'userCity' can't be null"; - } - if ($this->container['userState'] === null) { - $invalidProperties[] = "'userState' can't be null"; - } - if ($this->container['userPostCode'] === null) { - $invalidProperties[] = "'userPostCode' can't be null"; - } - if ($this->container['userCountry'] === null) { - $invalidProperties[] = "'userCountry' can't be null"; - } - if ($this->container['userPhone'] === null) { - $invalidProperties[] = "'userPhone' can't be null"; - } - if ($this->container['userAvatarUrl'] === null) { - $invalidProperties[] = "'userAvatarUrl' 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 sourceId - * - * @return int - */ - public function getSourceId() - { - return $this->container['sourceId']; - } - - /** - * Sets sourceId - * - * @param int $sourceId sourceId - * - * @return $this - */ - public function setSourceId($sourceId) - { - $this->container['sourceId'] = $sourceId; - - return $this; - } - - /** - * Gets enabled - * - * @return bool - */ - public function getEnabled() - { - return $this->container['enabled']; - } - - /** - * Sets enabled - * - * @param bool $enabled enabled - * - * @return $this - */ - public function setEnabled($enabled) - { - $this->container['enabled'] = $enabled; - - return $this; - } - - /** - * Gets realm - * - * @return string - */ - public function getRealm() - { - return $this->container['realm']; - } - - /** - * Sets realm - * - * @param string $realm realm - * - * @return $this - */ - public function setRealm($realm) - { - $this->container['realm'] = $realm; - - return $this; - } - - /** - * Gets username - * - * @return string - */ - public function getUsername() - { - return $this->container['username']; - } - - /** - * Sets username - * - * @param string $username username - * - * @return $this - */ - public function setUsername($username) - { - $this->container['username'] = $username; - - return $this; - } - - /** - * 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 emailVerified - * - * @return bool - */ - public function getEmailVerified() - { - return $this->container['emailVerified']; - } - - /** - * Sets emailVerified - * - * @param bool $emailVerified emailVerified - * - * @return $this - */ - public function setEmailVerified($emailVerified) - { - $this->container['emailVerified'] = $emailVerified; - - return $this; - } - - /** - * Gets verificationToken - * - * @return string - */ - public function getVerificationToken() - { - return $this->container['verificationToken']; - } - - /** - * Sets verificationToken - * - * @param string $verificationToken verificationToken - * - * @return $this - */ - public function setVerificationToken($verificationToken) - { - $this->container['verificationToken'] = $verificationToken; - - 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 userEmail - * - * @return string - */ - public function getUserEmail() - { - return $this->container['userEmail']; - } - - /** - * Sets userEmail - * - * @param string $userEmail userEmail - * - * @return $this - */ - public function setUserEmail($userEmail) - { - $this->container['userEmail'] = $userEmail; - - return $this; - } - - /** - * Gets userFirstName - * - * @return string - */ - public function getUserFirstName() - { - return $this->container['userFirstName']; - } - - /** - * Sets userFirstName - * - * @param string $userFirstName userFirstName - * - * @return $this - */ - public function setUserFirstName($userFirstName) - { - $this->container['userFirstName'] = $userFirstName; - - return $this; - } - - /** - * Gets userLastName - * - * @return string - */ - public function getUserLastName() - { - return $this->container['userLastName']; - } - - /** - * Sets userLastName - * - * @param string $userLastName userLastName - * - * @return $this - */ - public function setUserLastName($userLastName) - { - $this->container['userLastName'] = $userLastName; - - return $this; - } - - /** - * Gets userCompany - * - * @return string - */ - public function getUserCompany() - { - return $this->container['userCompany']; - } - - /** - * Sets userCompany - * - * @param string $userCompany userCompany - * - * @return $this - */ - public function setUserCompany($userCompany) - { - $this->container['userCompany'] = $userCompany; - - return $this; - } - - /** - * Gets userAddress1 - * - * @return string - */ - public function getUserAddress1() - { - return $this->container['userAddress1']; - } - - /** - * Sets userAddress1 - * - * @param string $userAddress1 userAddress1 - * - * @return $this - */ - public function setUserAddress1($userAddress1) - { - $this->container['userAddress1'] = $userAddress1; - - return $this; - } - - /** - * Gets userAddress2 - * - * @return string - */ - public function getUserAddress2() - { - return $this->container['userAddress2']; - } - - /** - * Sets userAddress2 - * - * @param string $userAddress2 userAddress2 - * - * @return $this - */ - public function setUserAddress2($userAddress2) - { - $this->container['userAddress2'] = $userAddress2; - - return $this; - } - - /** - * Gets userCity - * - * @return string - */ - public function getUserCity() - { - return $this->container['userCity']; - } - - /** - * Sets userCity - * - * @param string $userCity userCity - * - * @return $this - */ - public function setUserCity($userCity) - { - $this->container['userCity'] = $userCity; - - return $this; - } - - /** - * Gets userState - * - * @return string - */ - public function getUserState() - { - return $this->container['userState']; - } - - /** - * Sets userState - * - * @param string $userState userState - * - * @return $this - */ - public function setUserState($userState) - { - $this->container['userState'] = $userState; - - return $this; - } - - /** - * Gets userPostCode - * - * @return string - */ - public function getUserPostCode() - { - return $this->container['userPostCode']; - } - - /** - * Sets userPostCode - * - * @param string $userPostCode userPostCode - * - * @return $this - */ - public function setUserPostCode($userPostCode) - { - $this->container['userPostCode'] = $userPostCode; - - return $this; - } - - /** - * Gets userCountry - * - * @return string - */ - public function getUserCountry() - { - return $this->container['userCountry']; - } - - /** - * Sets userCountry - * - * @param string $userCountry userCountry - * - * @return $this - */ - public function setUserCountry($userCountry) - { - $this->container['userCountry'] = $userCountry; - - return $this; - } - - /** - * Gets userPhone - * - * @return string - */ - public function getUserPhone() - { - return $this->container['userPhone']; - } - - /** - * Sets userPhone - * - * @param string $userPhone userPhone - * - * @return $this - */ - public function setUserPhone($userPhone) - { - $this->container['userPhone'] = $userPhone; - - return $this; - } - - /** - * Gets userAvatarUrl - * - * @return string - */ - public function getUserAvatarUrl() - { - return $this->container['userAvatarUrl']; - } - - /** - * Sets userAvatarUrl - * - * @param string $userAvatarUrl userAvatarUrl - * - * @return $this - */ - public function setUserAvatarUrl($userAvatarUrl) - { - $this->container['userAvatarUrl'] = $userAvatarUrl; - - 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/CustomerData.php b/src/Model/CustomerData.php deleted file mode 100644 index f79bf69..0000000 --- a/src/Model/CustomerData.php +++ /dev/null @@ -1,747 +0,0 @@ - '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' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - 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 ]; - - /** - * 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', -'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) - * - * @var string[] - */ - 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' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - 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' ]; - - /** - * 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['avatarUrl'] = isset($data['avatarUrl']) ? $data['avatarUrl'] : null; - $this->container['billing'] = isset($data['billing']) ? $data['billing'] : null; - $this->container['dateCreated'] = isset($data['dateCreated']) ? $data['dateCreated'] : null; - $this->container['dateCreatedGmt'] = isset($data['dateCreatedGmt']) ? $data['dateCreatedGmt'] : null; - $this->container['dateModified'] = isset($data['dateModified']) ? $data['dateModified'] : null; - $this->container['dateModifiedGmt'] = isset($data['dateModifiedGmt']) ? $data['dateModifiedGmt'] : null; - $this->container['email'] = isset($data['email']) ? $data['email'] : null; - $this->container['firstName'] = isset($data['firstName']) ? $data['firstName'] : null; - $this->container['lastName'] = isset($data['lastName']) ? $data['lastName'] : null; - $this->container['isPayingCustomer'] = isset($data['isPayingCustomer']) ? $data['isPayingCustomer'] : null; - $this->container['metaData'] = isset($data['metaData']) ? $data['metaData'] : null; - $this->container['role'] = isset($data['role']) ? $data['role'] : null; - $this->container['shipping'] = isset($data['shipping']) ? $data['shipping'] : null; - $this->container['username'] = isset($data['username']) ? $data['username'] : 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['billing'] === null) { - $invalidProperties[] = "'billing' can't be null"; - } - if ($this->container['dateCreated'] === null) { - $invalidProperties[] = "'dateCreated' can't be null"; - } - if ($this->container['dateCreatedGmt'] === null) { - $invalidProperties[] = "'dateCreatedGmt' can't be null"; - } - if ($this->container['email'] === null) { - $invalidProperties[] = "'email' 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"; - } - if ($this->container['isPayingCustomer'] === null) { - $invalidProperties[] = "'isPayingCustomer' can't be null"; - } - if ($this->container['metaData'] === null) { - $invalidProperties[] = "'metaData' can't be null"; - } - if ($this->container['role'] === null) { - $invalidProperties[] = "'role' can't be null"; - } - if ($this->container['shipping'] === null) { - $invalidProperties[] = "'shipping' can't be null"; - } - if ($this->container['username'] === null) { - $invalidProperties[] = "'username' 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 avatarUrl - * - * @return string - */ - public function getAvatarUrl() - { - return $this->container['avatarUrl']; - } - - /** - * Sets avatarUrl - * - * @param string $avatarUrl avatarUrl - * - * @return $this - */ - public function setAvatarUrl($avatarUrl) - { - $this->container['avatarUrl'] = $avatarUrl; - - return $this; - } - - /** - * Gets billing - * - * @return \Yoast\MyYoastApiClient\Model\BillingDto - */ - public function getBilling() - { - return $this->container['billing']; - } - - /** - * Sets billing - * - * @param \Yoast\MyYoastApiClient\Model\BillingDto $billing billing - * - * @return $this - */ - public function setBilling($billing) - { - $this->container['billing'] = $billing; - - return $this; - } - - /** - * Gets dateCreated - * - * @return \DateTime - */ - public function getDateCreated() - { - return $this->container['dateCreated']; - } - - /** - * Sets dateCreated - * - * @param \DateTime $dateCreated dateCreated - * - * @return $this - */ - public function setDateCreated($dateCreated) - { - $this->container['dateCreated'] = $dateCreated; - - return $this; - } - - /** - * Gets dateCreatedGmt - * - * @return \DateTime - */ - public function getDateCreatedGmt() - { - return $this->container['dateCreatedGmt']; - } - - /** - * Sets dateCreatedGmt - * - * @param \DateTime $dateCreatedGmt dateCreatedGmt - * - * @return $this - */ - public function setDateCreatedGmt($dateCreatedGmt) - { - $this->container['dateCreatedGmt'] = $dateCreatedGmt; - - return $this; - } - - /** - * Gets dateModified - * - * @return \DateTime - */ - public function getDateModified() - { - return $this->container['dateModified']; - } - - /** - * Sets dateModified - * - * @param \DateTime $dateModified dateModified - * - * @return $this - */ - public function setDateModified($dateModified) - { - $this->container['dateModified'] = $dateModified; - - return $this; - } - - /** - * Gets dateModifiedGmt - * - * @return \DateTime - */ - public function getDateModifiedGmt() - { - return $this->container['dateModifiedGmt']; - } - - /** - * Sets dateModifiedGmt - * - * @param \DateTime $dateModifiedGmt dateModifiedGmt - * - * @return $this - */ - public function setDateModifiedGmt($dateModifiedGmt) - { - $this->container['dateModifiedGmt'] = $dateModifiedGmt; - - return $this; - } - - /** - * 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 firstName - * - * @return string - */ - public function getFirstName() - { - return $this->container['firstName']; - } - - /** - * Sets firstName - * - * @param string $firstName firstName - * - * @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 lastName - * - * @return $this - */ - public function setLastName($lastName) - { - $this->container['lastName'] = $lastName; - - return $this; - } - - /** - * Gets isPayingCustomer - * - * @return bool - */ - public function getIsPayingCustomer() - { - return $this->container['isPayingCustomer']; - } - - /** - * Sets isPayingCustomer - * - * @param bool $isPayingCustomer isPayingCustomer - * - * @return $this - */ - public function setIsPayingCustomer($isPayingCustomer) - { - $this->container['isPayingCustomer'] = $isPayingCustomer; - - 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; - } - - /** - * Gets role - * - * @return string - */ - public function getRole() - { - return $this->container['role']; - } - - /** - * Sets role - * - * @param string $role role - * - * @return $this - */ - public function setRole($role) - { - $this->container['role'] = $role; - - return $this; - } - - /** - * Gets shipping - * - * @return \Yoast\MyYoastApiClient\Model\ShippingDto - */ - public function getShipping() - { - return $this->container['shipping']; - } - - /** - * Sets shipping - * - * @param \Yoast\MyYoastApiClient\Model\ShippingDto $shipping shipping - * - * @return $this - */ - public function setShipping($shipping) - { - $this->container['shipping'] = $shipping; - - return $this; - } - - /** - * Gets username - * - * @return string - */ - public function getUsername() - { - return $this->container['username']; - } - - /** - * Sets username - * - * @param string $username username - * - * @return $this - */ - public function setUsername($username) - { - $this->container['username'] = $username; - - 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/CustomerDetails.php b/src/Model/CustomerDetails.php deleted file mode 100644 index 10375f2..0000000 --- a/src/Model/CustomerDetails.php +++ /dev/null @@ -1,384 +0,0 @@ - 'string', -'firstName' => 'string', -'lastName' => 'string', -'phone' => 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'email' => null, -'firstName' => null, -'lastName' => null, -'phone' => 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', -'firstName' => 'firstName', -'lastName' => 'lastName', -'phone' => 'phone' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'email' => 'setEmail', -'firstName' => 'setFirstName', -'lastName' => 'setLastName', -'phone' => 'setPhone' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'email' => 'getEmail', -'firstName' => 'getFirstName', -'lastName' => 'getLastName', -'phone' => 'getPhone' ]; - - /** - * 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['firstName'] = isset($data['firstName']) ? $data['firstName'] : null; - $this->container['lastName'] = isset($data['lastName']) ? $data['lastName'] : null; - $this->container['phone'] = isset($data['phone']) ? $data['phone'] : 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 firstName - * - * @return string - */ - public function getFirstName() - { - return $this->container['firstName']; - } - - /** - * Sets firstName - * - * @param string $firstName firstName - * - * @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 lastName - * - * @return $this - */ - public function setLastName($lastName) - { - $this->container['lastName'] = $lastName; - - return $this; - } - - /** - * Gets phone - * - * @return string - */ - public function getPhone() - { - return $this->container['phone']; - } - - /** - * Sets phone - * - * @param string $phone phone - * - * @return $this - */ - public function setPhone($phone) - { - $this->container['phone'] = $phone; - - 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/CustomerFromWooDto.php b/src/Model/CustomerFromWooDto.php deleted file mode 100644 index e97fb49..0000000 --- a/src/Model/CustomerFromWooDto.php +++ /dev/null @@ -1,294 +0,0 @@ - '\Yoast\MyYoastApiClient\Model\CustomerData' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'customerData' => 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 = [ - 'customerData' => 'customerData' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'customerData' => 'setCustomerData' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'customerData' => 'getCustomerData' ]; - - /** - * 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['customerData'] = isset($data['customerData']) ? $data['customerData'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['customerData'] === null) { - $invalidProperties[] = "'customerData' 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 customerData - * - * @return \Yoast\MyYoastApiClient\Model\CustomerData - */ - public function getCustomerData() - { - return $this->container['customerData']; - } - - /** - * Sets customerData - * - * @param \Yoast\MyYoastApiClient\Model\CustomerData $customerData customerData - * - * @return $this - */ - public function setCustomerData($customerData) - { - $this->container['customerData'] = $customerData; - - 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/CustomerNote.php b/src/Model/CustomerNote.php deleted file mode 100644 index b381287..0000000 --- a/src/Model/CustomerNote.php +++ /dev/null @@ -1,492 +0,0 @@ - 'string', -'updatedAt' => '\DateTime', -'createdAt' => '\DateTime', -'content' => 'string', -'nextContactDate' => '\DateTime', -'customerId' => 'string', -'authorId' => 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - '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 - * - * @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', -'content' => 'content', -'nextContactDate' => 'nextContactDate', -'customerId' => 'customerId', -'authorId' => 'authorId' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'id' => 'setId', -'updatedAt' => 'setUpdatedAt', -'createdAt' => 'setCreatedAt', -'content' => 'setContent', -'nextContactDate' => 'setNextContactDate', -'customerId' => 'setCustomerId', -'authorId' => 'setAuthorId' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'id' => 'getId', -'updatedAt' => 'getUpdatedAt', -'createdAt' => 'getCreatedAt', -'content' => 'getContent', -'nextContactDate' => 'getNextContactDate', -'customerId' => 'getCustomerId', -'authorId' => 'getAuthorId' ]; - - /** - * 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['content'] = isset($data['content']) ? $data['content'] : null; - $this->container['nextContactDate'] = isset($data['nextContactDate']) ? $data['nextContactDate'] : null; - $this->container['customerId'] = isset($data['customerId']) ? $data['customerId'] : null; - $this->container['authorId'] = isset($data['authorId']) ? $data['authorId'] : 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['content'] === null) { - $invalidProperties[] = "'content' can't be null"; - } - if ($this->container['nextContactDate'] === null) { - $invalidProperties[] = "'nextContactDate' can't be null"; - } - if ($this->container['customerId'] === null) { - $invalidProperties[] = "'customerId' can't be null"; - } - if ($this->container['authorId'] === null) { - $invalidProperties[] = "'authorId' 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 content - * - * @return string - */ - public function getContent() - { - return $this->container['content']; - } - - /** - * Sets content - * - * @param string $content content - * - * @return $this - */ - public function setContent($content) - { - $this->container['content'] = $content; - - return $this; - } - - /** - * Gets nextContactDate - * - * @return \DateTime - */ - public function getNextContactDate() - { - return $this->container['nextContactDate']; - } - - /** - * Sets nextContactDate - * - * @param \DateTime $nextContactDate nextContactDate - * - * @return $this - */ - public function setNextContactDate($nextContactDate) - { - $this->container['nextContactDate'] = $nextContactDate; - - return $this; - } - - /** - * Gets customerId - * - * @return string - */ - public function getCustomerId() - { - return $this->container['customerId']; - } - - /** - * Sets customerId - * - * @param string $customerId customerId - * - * @return $this - */ - public function setCustomerId($customerId) - { - $this->container['customerId'] = $customerId; - - return $this; - } - - /** - * Gets authorId - * - * @return string - */ - public function getAuthorId() - { - return $this->container['authorId']; - } - - /** - * Sets authorId - * - * @param string $authorId authorId - * - * @return $this - */ - public function setAuthorId($authorId) - { - $this->container['authorId'] = $authorId; - - 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/EddDTO.php b/src/Model/EddDTO.php deleted file mode 100644 index 3115474..0000000 --- a/src/Model/EddDTO.php +++ /dev/null @@ -1,360 +0,0 @@ - 'string', -'url' => 'string', -'itemName' => 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'eddAction' => null, -'url' => null, -'itemName' => 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 = [ - 'eddAction' => 'edd_action', -'url' => 'url', -'itemName' => 'item_name' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'eddAction' => 'setEddAction', -'url' => 'setUrl', -'itemName' => 'setItemName' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'eddAction' => 'getEddAction', -'url' => 'getUrl', -'itemName' => 'getItemName' ]; - - /** - * 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['eddAction'] = isset($data['eddAction']) ? $data['eddAction'] : null; - $this->container['url'] = isset($data['url']) ? $data['url'] : null; - $this->container['itemName'] = isset($data['itemName']) ? $data['itemName'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['eddAction'] === null) { - $invalidProperties[] = "'eddAction' can't be null"; - } - if ($this->container['url'] === null) { - $invalidProperties[] = "'url' can't be null"; - } - if ($this->container['itemName'] === null) { - $invalidProperties[] = "'itemName' 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 eddAction - * - * @return string - */ - public function getEddAction() - { - return $this->container['eddAction']; - } - - /** - * Sets eddAction - * - * @param string $eddAction eddAction - * - * @return $this - */ - public function setEddAction($eddAction) - { - $this->container['eddAction'] = $eddAction; - - return $this; - } - - /** - * Gets url - * - * @return string - */ - public function getUrl() - { - return $this->container['url']; - } - - /** - * Sets url - * - * @param string $url url - * - * @return $this - */ - public function setUrl($url) - { - $this->container['url'] = $url; - - return $this; - } - - /** - * Gets itemName - * - * @return string - */ - public function getItemName() - { - return $this->container['itemName']; - } - - /** - * Sets itemName - * - * @param string $itemName itemName - * - * @return $this - */ - public function setItemName($itemName) - { - $this->container['itemName'] = $itemName; - - 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/ExtraCourseDataDto.php b/src/Model/ExtraCourseDataDto.php deleted file mode 100644 index 0d3a807..0000000 --- a/src/Model/ExtraCourseDataDto.php +++ /dev/null @@ -1,591 +0,0 @@ - '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 - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'overviewSnippet' => 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 - * - * @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 = [ - 'overviewSnippet' => 'overview_snippet', -'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) - * - * @var string[] - */ - protected static $setters = [ - 'overviewSnippet' => 'setOverviewSnippet', -'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) - * - * @var string[] - */ - protected static $getters = [ - 'overviewSnippet' => 'getOverviewSnippet', -'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, - * 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['overviewSnippet'] = isset($data['overviewSnippet']) ? $data['overviewSnippet'] : null; - $this->container['permalink'] = isset($data['permalink']) ? $data['permalink'] : null; - $this->container['certificateUrl'] = isset($data['certificateUrl']) ? $data['certificateUrl'] : null; - $this->container['iconUrl'] = isset($data['iconUrl']) ? $data['iconUrl'] : null; - $this->container['complimentary'] = isset($data['complimentary']) ? $data['complimentary'] : null; - $this->container['open'] = isset($data['open']) ? $data['open'] : null; - $this->container['hasTrial'] = isset($data['hasTrial']) ? $data['hasTrial'] : null; - $this->container['deprecated'] = isset($data['deprecated']) ? $data['deprecated'] : null; - $this->container['sale'] = isset($data['sale']) ? $data['sale'] : null; - $this->container['saleLabel'] = isset($data['saleLabel']) ? $data['saleLabel'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['overviewSnippet'] === null) { - $invalidProperties[] = "'overviewSnippet' can't be null"; - } - if ($this->container['permalink'] === null) { - $invalidProperties[] = "'permalink' can't be null"; - } - if ($this->container['certificateUrl'] === null) { - $invalidProperties[] = "'certificateUrl' can't be null"; - } - if ($this->container['iconUrl'] === null) { - $invalidProperties[] = "'iconUrl' can't be null"; - } - if ($this->container['complimentary'] === null) { - $invalidProperties[] = "'complimentary' can't be null"; - } - if ($this->container['open'] === null) { - $invalidProperties[] = "'open' can't be null"; - } - if ($this->container['hasTrial'] === null) { - $invalidProperties[] = "'hasTrial' can't be null"; - } - if ($this->container['deprecated'] === null) { - $invalidProperties[] = "'deprecated' can't be null"; - } - if ($this->container['sale'] === null) { - $invalidProperties[] = "'sale' can't be null"; - } - if ($this->container['saleLabel'] === null) { - $invalidProperties[] = "'saleLabel' 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 overviewSnippet - * - * @return string - */ - public function getOverviewSnippet() - { - return $this->container['overviewSnippet']; - } - - /** - * Sets overviewSnippet - * - * @param string $overviewSnippet overviewSnippet - * - * @return $this - */ - public function setOverviewSnippet($overviewSnippet) - { - $this->container['overviewSnippet'] = $overviewSnippet; - - return $this; - } - - /** - * Gets permalink - * - * @return string - */ - public function getPermalink() - { - return $this->container['permalink']; - } - - /** - * Sets permalink - * - * @param string $permalink permalink - * - * @return $this - */ - public function setPermalink($permalink) - { - $this->container['permalink'] = $permalink; - - return $this; - } - - /** - * Gets certificateUrl - * - * @return string - */ - public function getCertificateUrl() - { - return $this->container['certificateUrl']; - } - - /** - * Sets certificateUrl - * - * @param string $certificateUrl certificateUrl - * - * @return $this - */ - public function setCertificateUrl($certificateUrl) - { - $this->container['certificateUrl'] = $certificateUrl; - - return $this; - } - - /** - * Gets iconUrl - * - * @return string - */ - public function getIconUrl() - { - return $this->container['iconUrl']; - } - - /** - * Sets iconUrl - * - * @param string $iconUrl iconUrl - * - * @return $this - */ - public function setIconUrl($iconUrl) - { - $this->container['iconUrl'] = $iconUrl; - - return $this; - } - - /** - * Gets complimentary - * - * @return bool - */ - public function getComplimentary() - { - return $this->container['complimentary']; - } - - /** - * Sets complimentary - * - * @param bool $complimentary complimentary - * - * @return $this - */ - public function setComplimentary($complimentary) - { - $this->container['complimentary'] = $complimentary; - - return $this; - } - - /** - * Gets open - * - * @return bool - */ - public function getOpen() - { - return $this->container['open']; - } - - /** - * Sets open - * - * @param bool $open open - * - * @return $this - */ - public function setOpen($open) - { - $this->container['open'] = $open; - - return $this; - } - - /** - * Gets hasTrial - * - * @return bool - */ - public function getHasTrial() - { - return $this->container['hasTrial']; - } - - /** - * Sets hasTrial - * - * @param bool $hasTrial hasTrial - * - * @return $this - */ - public function setHasTrial($hasTrial) - { - $this->container['hasTrial'] = $hasTrial; - - return $this; - } - - /** - * Gets deprecated - * - * @return bool - */ - public function getDeprecated() - { - return $this->container['deprecated']; - } - - /** - * Sets deprecated - * - * @param bool $deprecated deprecated - * - * @return $this - */ - public function setDeprecated($deprecated) - { - $this->container['deprecated'] = $deprecated; - - return $this; - } - - /** - * Gets sale - * - * @return bool - */ - public function getSale() - { - return $this->container['sale']; - } - - /** - * Sets sale - * - * @param bool $sale sale - * - * @return $this - */ - public function setSale($sale) - { - $this->container['sale'] = $sale; - - return $this; - } - - /** - * Gets saleLabel - * - * @return string - */ - public function getSaleLabel() - { - return $this->container['saleLabel']; - } - - /** - * Sets saleLabel - * - * @param string $saleLabel saleLabel - * - * @return $this - */ - public function setSaleLabel($saleLabel) - { - $this->container['saleLabel'] = $saleLabel; - - 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/ExtraOrderData.php b/src/Model/ExtraOrderData.php deleted file mode 100644 index 0d650cb..0000000 --- a/src/Model/ExtraOrderData.php +++ /dev/null @@ -1,552 +0,0 @@ - '\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[]' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'customer' => 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 - * - * @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 = [ - 'customer' => 'customer', -'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) - * - * @var string[] - */ - protected static $setters = [ - 'customer' => 'setCustomer', -'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) - * - * @var string[] - */ - protected static $getters = [ - 'customer' => 'getCustomer', -'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, - * 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['customer'] = isset($data['customer']) ? $data['customer'] : null; - $this->container['shopId'] = isset($data['shopId']) ? $data['shopId'] : null; - $this->container['paymentReference'] = isset($data['paymentReference']) ? $data['paymentReference'] : null; - $this->container['automatic'] = isset($data['automatic']) ? $data['automatic'] : null; - $this->container['billingType'] = isset($data['billingType']) ? $data['billingType'] : null; - $this->container['vatNumber'] = isset($data['vatNumber']) ? $data['vatNumber'] : null; - $this->container['renewalKey'] = isset($data['renewalKey']) ? $data['renewalKey'] : null; - $this->container['transactions'] = isset($data['transactions']) ? $data['transactions'] : null; - $this->container['wooRefunds'] = isset($data['wooRefunds']) ? $data['wooRefunds'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['customer'] === null) { - $invalidProperties[] = "'customer' can't be null"; - } - if ($this->container['shopId'] === null) { - $invalidProperties[] = "'shopId' can't be null"; - } - if ($this->container['paymentReference'] === null) { - $invalidProperties[] = "'paymentReference' can't be null"; - } - if ($this->container['automatic'] === null) { - $invalidProperties[] = "'automatic' can't be null"; - } - if ($this->container['billingType'] === null) { - $invalidProperties[] = "'billingType' can't be null"; - } - if ($this->container['transactions'] === null) { - $invalidProperties[] = "'transactions' can't be null"; - } - if ($this->container['wooRefunds'] === null) { - $invalidProperties[] = "'wooRefunds' 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 customer - * - * @return \Yoast\MyYoastApiClient\Model\CustomerData - */ - public function getCustomer() - { - return $this->container['customer']; - } - - /** - * Sets customer - * - * @param \Yoast\MyYoastApiClient\Model\CustomerData $customer customer - * - * @return $this - */ - public function setCustomer($customer) - { - $this->container['customer'] = $customer; - - return $this; - } - - /** - * Gets shopId - * - * @return int - */ - public function getShopId() - { - return $this->container['shopId']; - } - - /** - * Sets shopId - * - * @param int $shopId shopId - * - * @return $this - */ - public function setShopId($shopId) - { - $this->container['shopId'] = $shopId; - - return $this; - } - - /** - * Gets paymentReference - * - * @return string - */ - public function getPaymentReference() - { - return $this->container['paymentReference']; - } - - /** - * Sets paymentReference - * - * @param string $paymentReference paymentReference - * - * @return $this - */ - public function setPaymentReference($paymentReference) - { - $this->container['paymentReference'] = $paymentReference; - - return $this; - } - - /** - * Gets automatic - * - * @return bool - */ - public function getAutomatic() - { - return $this->container['automatic']; - } - - /** - * Sets automatic - * - * @param bool $automatic automatic - * - * @return $this - */ - public function setAutomatic($automatic) - { - $this->container['automatic'] = $automatic; - - return $this; - } - - /** - * Gets billingType - * - * @return string - */ - public function getBillingType() - { - return $this->container['billingType']; - } - - /** - * Sets billingType - * - * @param string $billingType billingType - * - * @return $this - */ - public function setBillingType($billingType) - { - $this->container['billingType'] = $billingType; - - return $this; - } - - /** - * Gets vatNumber - * - * @return string - */ - public function getVatNumber() - { - return $this->container['vatNumber']; - } - - /** - * Sets vatNumber - * - * @param string $vatNumber vatNumber - * - * @return $this - */ - public function setVatNumber($vatNumber) - { - $this->container['vatNumber'] = $vatNumber; - - return $this; - } - - /** - * Gets renewalKey - * - * @return string - */ - public function getRenewalKey() - { - return $this->container['renewalKey']; - } - - /** - * Sets renewalKey - * - * @param string $renewalKey renewalKey - * - * @return $this - */ - public function setRenewalKey($renewalKey) - { - $this->container['renewalKey'] = $renewalKey; - - return $this; - } - - /** - * Gets transactions - * - * @return \Yoast\MyYoastApiClient\Model\TransactionDataDto[] - */ - public function getTransactions() - { - return $this->container['transactions']; - } - - /** - * Sets transactions - * - * @param \Yoast\MyYoastApiClient\Model\TransactionDataDto[] $transactions transactions - * - * @return $this - */ - public function setTransactions($transactions) - { - $this->container['transactions'] = $transactions; - - return $this; - } - - /** - * Gets wooRefunds - * - * @return \Yoast\MyYoastApiClient\Model\RefundDataDto[] - */ - public function getWooRefunds() - { - return $this->container['wooRefunds']; - } - - /** - * Sets wooRefunds - * - * @param \Yoast\MyYoastApiClient\Model\RefundDataDto[] $wooRefunds wooRefunds - * - * @return $this - */ - public function setWooRefunds($wooRefunds) - { - $this->container['wooRefunds'] = $wooRefunds; - - 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/ExtraProductData.php b/src/Model/ExtraProductData.php deleted file mode 100644 index 2d364e8..0000000 --- a/src/Model/ExtraProductData.php +++ /dev/null @@ -1,453 +0,0 @@ - 'int', -'changelog' => 'string', -'productGroupSlugs' => 'string[]', -'billingType' => 'string', -'billingTerm' => 'string', -'activationLimit' => 'int' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'shopId' => null, -'changelog' => null, -'productGroupSlugs' => null, -'billingType' => null, -'billingTerm' => null, -'activationLimit' => 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 = [ - 'shopId' => 'shop_id', -'changelog' => 'changelog', -'productGroupSlugs' => 'product_group_slugs', -'billingType' => 'billingType', -'billingTerm' => 'billingTerm', -'activationLimit' => 'activationLimit' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'shopId' => 'setShopId', -'changelog' => 'setChangelog', -'productGroupSlugs' => 'setProductGroupSlugs', -'billingType' => 'setBillingType', -'billingTerm' => 'setBillingTerm', -'activationLimit' => 'setActivationLimit' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'shopId' => 'getShopId', -'changelog' => 'getChangelog', -'productGroupSlugs' => 'getProductGroupSlugs', -'billingType' => 'getBillingType', -'billingTerm' => 'getBillingTerm', -'activationLimit' => 'getActivationLimit' ]; - - /** - * 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['shopId'] = isset($data['shopId']) ? $data['shopId'] : null; - $this->container['changelog'] = isset($data['changelog']) ? $data['changelog'] : null; - $this->container['productGroupSlugs'] = isset($data['productGroupSlugs']) ? $data['productGroupSlugs'] : null; - $this->container['billingType'] = isset($data['billingType']) ? $data['billingType'] : null; - $this->container['billingTerm'] = isset($data['billingTerm']) ? $data['billingTerm'] : null; - $this->container['activationLimit'] = isset($data['activationLimit']) ? $data['activationLimit'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['shopId'] === null) { - $invalidProperties[] = "'shopId' can't be null"; - } - if ($this->container['changelog'] === null) { - $invalidProperties[] = "'changelog' can't be null"; - } - if ($this->container['productGroupSlugs'] === null) { - $invalidProperties[] = "'productGroupSlugs' can't be null"; - } - if ($this->container['billingType'] === null) { - $invalidProperties[] = "'billingType' 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 shopId - * - * @return int - */ - public function getShopId() - { - return $this->container['shopId']; - } - - /** - * Sets shopId - * - * @param int $shopId shopId - * - * @return $this - */ - public function setShopId($shopId) - { - $this->container['shopId'] = $shopId; - - return $this; - } - - /** - * Gets changelog - * - * @return string - */ - public function getChangelog() - { - return $this->container['changelog']; - } - - /** - * Sets changelog - * - * @param string $changelog changelog - * - * @return $this - */ - public function setChangelog($changelog) - { - $this->container['changelog'] = $changelog; - - return $this; - } - - /** - * Gets productGroupSlugs - * - * @return string[] - */ - public function getProductGroupSlugs() - { - return $this->container['productGroupSlugs']; - } - - /** - * Sets productGroupSlugs - * - * @param string[] $productGroupSlugs productGroupSlugs - * - * @return $this - */ - public function setProductGroupSlugs($productGroupSlugs) - { - $this->container['productGroupSlugs'] = $productGroupSlugs; - - return $this; - } - - /** - * Gets billingType - * - * @return string - */ - public function getBillingType() - { - return $this->container['billingType']; - } - - /** - * Sets billingType - * - * @param string $billingType billingType - * - * @return $this - */ - public function setBillingType($billingType) - { - $this->container['billingType'] = $billingType; - - return $this; - } - - /** - * Gets billingTerm - * - * @return string - */ - public function getBillingTerm() - { - return $this->container['billingTerm']; - } - - /** - * Sets billingTerm - * - * @param string $billingTerm billingTerm - * - * @return $this - */ - public function setBillingTerm($billingTerm) - { - $this->container['billingTerm'] = $billingTerm; - - return $this; - } - - /** - * Gets activationLimit - * - * @return int - */ - public function getActivationLimit() - { - return $this->container['activationLimit']; - } - - /** - * Sets activationLimit - * - * @param int $activationLimit activationLimit - * - * @return $this - */ - public function setActivationLimit($activationLimit) - { - $this->container['activationLimit'] = $activationLimit; - - 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/FeeLineDto.php b/src/Model/FeeLineDto.php deleted file mode 100644 index 43a1fc6..0000000 --- a/src/Model/FeeLineDto.php +++ /dev/null @@ -1,555 +0,0 @@ - '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 deleted file mode 100644 index d2631a0..0000000 --- a/src/Model/FromAcademyDto.php +++ /dev/null @@ -1,327 +0,0 @@ - '\Yoast\MyYoastApiClient\Model\CourseDataDto', -'extraData' => '\Yoast\MyYoastApiClient\Model\ExtraCourseDataDto' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'courseData' => null, -'extraData' => 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 = [ - 'courseData' => 'courseData', -'extraData' => 'extraData' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'courseData' => 'setCourseData', -'extraData' => 'setExtraData' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'courseData' => 'getCourseData', -'extraData' => 'getExtraData' ]; - - /** - * 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['courseData'] = isset($data['courseData']) ? $data['courseData'] : null; - $this->container['extraData'] = isset($data['extraData']) ? $data['extraData'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['courseData'] === null) { - $invalidProperties[] = "'courseData' can't be null"; - } - if ($this->container['extraData'] === null) { - $invalidProperties[] = "'extraData' 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 courseData - * - * @return \Yoast\MyYoastApiClient\Model\CourseDataDto - */ - public function getCourseData() - { - return $this->container['courseData']; - } - - /** - * Sets courseData - * - * @param \Yoast\MyYoastApiClient\Model\CourseDataDto $courseData courseData - * - * @return $this - */ - public function setCourseData($courseData) - { - $this->container['courseData'] = $courseData; - - return $this; - } - - /** - * Gets extraData - * - * @return \Yoast\MyYoastApiClient\Model\ExtraCourseDataDto - */ - public function getExtraData() - { - return $this->container['extraData']; - } - - /** - * Sets extraData - * - * @param \Yoast\MyYoastApiClient\Model\ExtraCourseDataDto $extraData extraData - * - * @return $this - */ - public function setExtraData($extraData) - { - $this->container['extraData'] = $extraData; - - 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/GenerateDto.php b/src/Model/GenerateDto.php deleted file mode 100644 index e487e86..0000000 --- a/src/Model/GenerateDto.php +++ /dev/null @@ -1,294 +0,0 @@ - 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'name' => 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 = [ - 'name' => 'name' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'name' => 'setName' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'name' => 'getName' ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$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['name'] = isset($data['name']) ? $data['name'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['name'] === null) { - $invalidProperties[] = "'name' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets 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; - } - /** - * 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/HelpScoutDto.php b/src/Model/HelpScoutDto.php deleted file mode 100644 index bbf5a52..0000000 --- a/src/Model/HelpScoutDto.php +++ /dev/null @@ -1,381 +0,0 @@ - 'object', -'customer' => 'object', -'user' => 'object', -'mailbox' => 'object' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'ticket' => null, -'customer' => null, -'user' => null, -'mailbox' => 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 = [ - 'ticket' => 'ticket', -'customer' => 'customer', -'user' => 'user', -'mailbox' => 'mailbox' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'ticket' => 'setTicket', -'customer' => 'setCustomer', -'user' => 'setUser', -'mailbox' => 'setMailbox' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'ticket' => 'getTicket', -'customer' => 'getCustomer', -'user' => 'getUser', -'mailbox' => 'getMailbox' ]; - - /** - * 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['ticket'] = isset($data['ticket']) ? $data['ticket'] : null; - $this->container['customer'] = isset($data['customer']) ? $data['customer'] : null; - $this->container['user'] = isset($data['user']) ? $data['user'] : null; - $this->container['mailbox'] = isset($data['mailbox']) ? $data['mailbox'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets ticket - * - * @return object - */ - public function getTicket() - { - return $this->container['ticket']; - } - - /** - * Sets ticket - * - * @param object $ticket ticket - * - * @return $this - */ - public function setTicket($ticket) - { - $this->container['ticket'] = $ticket; - - return $this; - } - - /** - * Gets customer - * - * @return object - */ - public function getCustomer() - { - return $this->container['customer']; - } - - /** - * Sets customer - * - * @param object $customer customer - * - * @return $this - */ - public function setCustomer($customer) - { - $this->container['customer'] = $customer; - - return $this; - } - - /** - * Gets user - * - * @return object - */ - public function getUser() - { - return $this->container['user']; - } - - /** - * Sets user - * - * @param object $user user - * - * @return $this - */ - public function setUser($user) - { - $this->container['user'] = $user; - - return $this; - } - - /** - * Gets mailbox - * - * @return object - */ - public function getMailbox() - { - return $this->container['mailbox']; - } - - /** - * Sets mailbox - * - * @param object $mailbox mailbox - * - * @return $this - */ - public function setMailbox($mailbox) - { - $this->container['mailbox'] = $mailbox; - - 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/InviteDto.php b/src/Model/InviteDto.php deleted file mode 100644 index 704bbfd..0000000 --- a/src/Model/InviteDto.php +++ /dev/null @@ -1,294 +0,0 @@ - '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/JSZip.php b/src/Model/JSZip.php deleted file mode 100644 index 8227061..0000000 --- a/src/Model/JSZip.php +++ /dev/null @@ -1,266 +0,0 @@ -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/JobOptionsDto.php b/src/Model/JobOptionsDto.php deleted file mode 100644 index 7ad8a69..0000000 --- a/src/Model/JobOptionsDto.php +++ /dev/null @@ -1,591 +0,0 @@ - '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 - * - * @var string[] - */ - 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 ]; - - /** - * 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 = [ - 'priority' => 'priority', -'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) - * - * @var string[] - */ - 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' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - 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' ]; - - /** - * 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['priority'] = isset($data['priority']) ? $data['priority'] : null; - $this->container['delay'] = isset($data['delay']) ? $data['delay'] : null; - $this->container['attempts'] = isset($data['attempts']) ? $data['attempts'] : null; - $this->container['repeat'] = isset($data['repeat']) ? $data['repeat'] : null; - $this->container['backoff'] = isset($data['backoff']) ? $data['backoff'] : null; - $this->container['lifo'] = isset($data['lifo']) ? $data['lifo'] : null; - $this->container['timeout'] = isset($data['timeout']) ? $data['timeout'] : null; - $this->container['jobId'] = isset($data['jobId']) ? $data['jobId'] : null; - $this->container['removeOnComplete'] = isset($data['removeOnComplete']) ? $data['removeOnComplete'] : null; - $this->container['removeOnFail'] = isset($data['removeOnFail']) ? $data['removeOnFail'] : null; - $this->container['stackTraceLimit'] = isset($data['stackTraceLimit']) ? $data['stackTraceLimit'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets priority - * - * @return int - */ - public function getPriority() - { - return $this->container['priority']; - } - - /** - * Sets priority - * - * @param int $priority priority - * - * @return $this - */ - public function setPriority($priority) - { - $this->container['priority'] = $priority; - - return $this; - } - - /** - * Gets delay - * - * @return int - */ - public function getDelay() - { - return $this->container['delay']; - } - - /** - * Sets delay - * - * @param int $delay delay - * - * @return $this - */ - public function setDelay($delay) - { - $this->container['delay'] = $delay; - - return $this; - } - - /** - * Gets attempts - * - * @return int - */ - public function getAttempts() - { - return $this->container['attempts']; - } - - /** - * Sets attempts - * - * @param int $attempts attempts - * - * @return $this - */ - public function setAttempts($attempts) - { - $this->container['attempts'] = $attempts; - - return $this; - } - - /** - * Gets repeat - * - * @return object - */ - public function getRepeat() - { - return $this->container['repeat']; - } - - /** - * Sets repeat - * - * @param object $repeat repeat - * - * @return $this - */ - public function setRepeat($repeat) - { - $this->container['repeat'] = $repeat; - - return $this; - } - - /** - * Gets backoff - * - * @return object - */ - public function getBackoff() - { - return $this->container['backoff']; - } - - /** - * Sets backoff - * - * @param object $backoff backoff - * - * @return $this - */ - public function setBackoff($backoff) - { - $this->container['backoff'] = $backoff; - - return $this; - } - - /** - * Gets lifo - * - * @return bool - */ - public function getLifo() - { - return $this->container['lifo']; - } - - /** - * Sets lifo - * - * @param bool $lifo lifo - * - * @return $this - */ - public function setLifo($lifo) - { - $this->container['lifo'] = $lifo; - - return $this; - } - - /** - * Gets timeout - * - * @return int - */ - public function getTimeout() - { - return $this->container['timeout']; - } - - /** - * Sets timeout - * - * @param int $timeout timeout - * - * @return $this - */ - public function setTimeout($timeout) - { - $this->container['timeout'] = $timeout; - - return $this; - } - - /** - * Gets jobId - * - * @return object - */ - public function getJobId() - { - return $this->container['jobId']; - } - - /** - * Sets jobId - * - * @param object $jobId jobId - * - * @return $this - */ - public function setJobId($jobId) - { - $this->container['jobId'] = $jobId; - - return $this; - } - - /** - * Gets removeOnComplete - * - * @return object - */ - public function getRemoveOnComplete() - { - return $this->container['removeOnComplete']; - } - - /** - * Sets removeOnComplete - * - * @param object $removeOnComplete removeOnComplete - * - * @return $this - */ - public function setRemoveOnComplete($removeOnComplete) - { - $this->container['removeOnComplete'] = $removeOnComplete; - - return $this; - } - - /** - * Gets removeOnFail - * - * @return object - */ - public function getRemoveOnFail() - { - return $this->container['removeOnFail']; - } - - /** - * Sets removeOnFail - * - * @param object $removeOnFail removeOnFail - * - * @return $this - */ - public function setRemoveOnFail($removeOnFail) - { - $this->container['removeOnFail'] = $removeOnFail; - - return $this; - } - - /** - * Gets stackTraceLimit - * - * @return int - */ - public function getStackTraceLimit() - { - return $this->container['stackTraceLimit']; - } - - /** - * Sets stackTraceLimit - * - * @param int $stackTraceLimit stackTraceLimit - * - * @return $this - */ - public function setStackTraceLimit($stackTraceLimit) - { - $this->container['stackTraceLimit'] = $stackTraceLimit; - - 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/LineItemDto.php b/src/Model/LineItemDto.php deleted file mode 100644 index 6c016d4..0000000 --- a/src/Model/LineItemDto.php +++ /dev/null @@ -1,840 +0,0 @@ - 'string', -'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[]', -'parentName' => 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - 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, -'parentName' => 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 = [ - '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', -'parentName' => 'parent_name' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - 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', -'parentName' => 'setParentName' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - 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', -'parentName' => 'getParentName' ]; - - /** - * 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['bundledItemTitle'] = isset($data['bundledItemTitle']) ? $data['bundledItemTitle'] : null; - $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['price'] = isset($data['price']) ? $data['price'] : null; - $this->container['productId'] = isset($data['productId']) ? $data['productId'] : null; - $this->container['quantity'] = isset($data['quantity']) ? $data['quantity'] : null; - $this->container['sku'] = isset($data['sku']) ? $data['sku'] : null; - $this->container['subtotal'] = isset($data['subtotal']) ? $data['subtotal'] : null; - $this->container['subtotalTax'] = isset($data['subtotalTax']) ? $data['subtotalTax'] : null; - $this->container['taxes'] = isset($data['taxes']) ? $data['taxes'] : null; - $this->container['taxClass'] = isset($data['taxClass']) ? $data['taxClass'] : null; - $this->container['total'] = isset($data['total']) ? $data['total'] : null; - $this->container['totalTax'] = isset($data['totalTax']) ? $data['totalTax'] : null; - $this->container['variationId'] = isset($data['variationId']) ? $data['variationId'] : null; - $this->container['bundledBy'] = isset($data['bundledBy']) ? $data['bundledBy'] : null; - $this->container['bundledItems'] = isset($data['bundledItems']) ? $data['bundledItems'] : null; - $this->container['metaData'] = isset($data['metaData']) ? $data['metaData'] : null; - $this->container['parentName'] = isset($data['parentName']) ? $data['parentName'] : 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['price'] === null) { - $invalidProperties[] = "'price' can't be null"; - } - if ($this->container['productId'] === null) { - $invalidProperties[] = "'productId' can't be null"; - } - if ($this->container['quantity'] === null) { - $invalidProperties[] = "'quantity' can't be null"; - } - if ($this->container['sku'] === null) { - $invalidProperties[] = "'sku' can't be null"; - } - if ($this->container['subtotal'] === null) { - $invalidProperties[] = "'subtotal' can't be null"; - } - if ($this->container['subtotalTax'] === null) { - $invalidProperties[] = "'subtotalTax' can't be null"; - } - if ($this->container['taxes'] === null) { - $invalidProperties[] = "'taxes' can't be null"; - } - if ($this->container['taxClass'] === null) { - $invalidProperties[] = "'taxClass' 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['variationId'] === null) { - $invalidProperties[] = "'variationId' 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 bundledItemTitle - * - * @return string - */ - public function getBundledItemTitle() - { - return $this->container['bundledItemTitle']; - } - - /** - * Sets bundledItemTitle - * - * @param string $bundledItemTitle bundledItemTitle - * - * @return $this - */ - public function setBundledItemTitle($bundledItemTitle) - { - $this->container['bundledItemTitle'] = $bundledItemTitle; - - return $this; - } - - /** - * 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 price - * - * @return int - */ - public function getPrice() - { - return $this->container['price']; - } - - /** - * Sets price - * - * @param int $price price - * - * @return $this - */ - public function setPrice($price) - { - $this->container['price'] = $price; - - return $this; - } - - /** - * Gets productId - * - * @return int - */ - public function getProductId() - { - return $this->container['productId']; - } - - /** - * Sets productId - * - * @param int $productId productId - * - * @return $this - */ - public function setProductId($productId) - { - $this->container['productId'] = $productId; - - return $this; - } - - /** - * Gets quantity - * - * @return int - */ - public function getQuantity() - { - return $this->container['quantity']; - } - - /** - * Sets quantity - * - * @param int $quantity quantity - * - * @return $this - */ - public function setQuantity($quantity) - { - $this->container['quantity'] = $quantity; - - return $this; - } - - /** - * Gets sku - * - * @return string - */ - public function getSku() - { - return $this->container['sku']; - } - - /** - * Sets sku - * - * @param string $sku sku - * - * @return $this - */ - public function setSku($sku) - { - $this->container['sku'] = $sku; - - return $this; - } - - /** - * Gets subtotal - * - * @return string - */ - public function getSubtotal() - { - return $this->container['subtotal']; - } - - /** - * Sets subtotal - * - * @param string $subtotal subtotal - * - * @return $this - */ - public function setSubtotal($subtotal) - { - $this->container['subtotal'] = $subtotal; - - return $this; - } - - /** - * Gets subtotalTax - * - * @return string - */ - public function getSubtotalTax() - { - return $this->container['subtotalTax']; - } - - /** - * Sets subtotalTax - * - * @param string $subtotalTax subtotalTax - * - * @return $this - */ - public function setSubtotalTax($subtotalTax) - { - $this->container['subtotalTax'] = $subtotalTax; - - 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 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 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 variationId - * - * @return int - */ - public function getVariationId() - { - return $this->container['variationId']; - } - - /** - * Sets variationId - * - * @param int $variationId variationId - * - * @return $this - */ - public function setVariationId($variationId) - { - $this->container['variationId'] = $variationId; - - return $this; - } - - /** - * Gets bundledBy - * - * @return int - */ - public function getBundledBy() - { - return $this->container['bundledBy']; - } - - /** - * Sets bundledBy - * - * @param int $bundledBy bundledBy - * - * @return $this - */ - public function setBundledBy($bundledBy) - { - $this->container['bundledBy'] = $bundledBy; - - return $this; - } - - /** - * Gets bundledItems - * - * @return string[] - */ - public function getBundledItems() - { - return $this->container['bundledItems']; - } - - /** - * Sets bundledItems - * - * @param string[] $bundledItems bundledItems - * - * @return $this - */ - public function setBundledItems($bundledItems) - { - $this->container['bundledItems'] = $bundledItems; - - 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; - } - - /** - * Gets parentName - * - * @return string - */ - public function getParentName() - { - return $this->container['parentName']; - } - - /** - * Sets parentName - * - * @param string $parentName parentName - * - * @return $this - */ - public function setParentName($parentName) - { - $this->container['parentName'] = $parentName; - - 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/LineItemTax.php b/src/Model/LineItemTax.php deleted file mode 100644 index 76ee36c..0000000 --- a/src/Model/LineItemTax.php +++ /dev/null @@ -1,360 +0,0 @@ - 'int', -'subtotal' => 'string', -'total' => 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'id' => null, -'subtotal' => null, -'total' => 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', -'subtotal' => 'subtotal', -'total' => 'total' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'id' => 'setId', -'subtotal' => 'setSubtotal', -'total' => 'setTotal' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'id' => 'getId', -'subtotal' => 'getSubtotal', -'total' => 'getTotal' ]; - - /** - * 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['subtotal'] = isset($data['subtotal']) ? $data['subtotal'] : null; - $this->container['total'] = isset($data['total']) ? $data['total'] : 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['subtotal'] === null) { - $invalidProperties[] = "'subtotal' can't be null"; - } - if ($this->container['total'] === null) { - $invalidProperties[] = "'total' 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 subtotal - * - * @return string - */ - public function getSubtotal() - { - return $this->container['subtotal']; - } - - /** - * Sets subtotal - * - * @param string $subtotal subtotal - * - * @return $this - */ - public function setSubtotal($subtotal) - { - $this->container['subtotal'] = $subtotal; - - 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; - } - /** - * 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/LinkSiteDto.php b/src/Model/LinkSiteDto.php deleted file mode 100644 index 4395860..0000000 --- a/src/Model/LinkSiteDto.php +++ /dev/null @@ -1,327 +0,0 @@ - 'string', -'invoiceNumber' => 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'url' => null, -'invoiceNumber' => 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 = [ - 'url' => 'url', -'invoiceNumber' => 'invoiceNumber' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'url' => 'setUrl', -'invoiceNumber' => 'setInvoiceNumber' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'url' => 'getUrl', -'invoiceNumber' => 'getInvoiceNumber' ]; - - /** - * 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['url'] = isset($data['url']) ? $data['url'] : null; - $this->container['invoiceNumber'] = isset($data['invoiceNumber']) ? $data['invoiceNumber'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['url'] === null) { - $invalidProperties[] = "'url' can't be null"; - } - if ($this->container['invoiceNumber'] === null) { - $invalidProperties[] = "'invoiceNumber' 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 url - * - * @return string - */ - public function getUrl() - { - return $this->container['url']; - } - - /** - * Sets url - * - * @param string $url url - * - * @return $this - */ - public function setUrl($url) - { - $this->container['url'] = $url; - - return $this; - } - - /** - * Gets invoiceNumber - * - * @return string - */ - public function getInvoiceNumber() - { - return $this->container['invoiceNumber']; - } - - /** - * Sets invoiceNumber - * - * @param string $invoiceNumber invoiceNumber - * - * @return $this - */ - public function setInvoiceNumber($invoiceNumber) - { - $this->container['invoiceNumber'] = $invoiceNumber; - - 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/LoginDto.php b/src/Model/LoginDto.php deleted file mode 100644 index a23122a..0000000 --- a/src/Model/LoginDto.php +++ /dev/null @@ -1,327 +0,0 @@ - 'string', -'password' => 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'username' => null, -'password' => 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 = [ - 'username' => 'username', -'password' => 'password' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'username' => 'setUsername', -'password' => 'setPassword' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'username' => 'getUsername', -'password' => 'getPassword' ]; - - /** - * 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['username'] = isset($data['username']) ? $data['username'] : null; - $this->container['password'] = isset($data['password']) ? $data['password'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['username'] === null) { - $invalidProperties[] = "'username' can't be null"; - } - if ($this->container['password'] === null) { - $invalidProperties[] = "'password' 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 username - * - * @return string - */ - public function getUsername() - { - return $this->container['username']; - } - - /** - * Sets username - * - * @param string $username username - * - * @return $this - */ - public function setUsername($username) - { - $this->container['username'] = $username; - - return $this; - } - - /** - * Gets password - * - * @return string - */ - public function getPassword() - { - return $this->container['password']; - } - - /** - * Sets password - * - * @param string $password The password of the MyYoast user to login. - * - * @return $this - */ - public function setPassword($password) - { - $this->container['password'] = $password; - - 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/LoginUserDto.php b/src/Model/LoginUserDto.php deleted file mode 100644 index 8455f85..0000000 --- a/src/Model/LoginUserDto.php +++ /dev/null @@ -1,387 +0,0 @@ - 'string', -'password' => 'string', -'rememberMe' => 'bool', -'otp' => 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'email' => null, -'password' => null, -'rememberMe' => null, -'otp' => 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', -'password' => 'password', -'rememberMe' => 'rememberMe', -'otp' => 'otp' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'email' => 'setEmail', -'password' => 'setPassword', -'rememberMe' => 'setRememberMe', -'otp' => 'setOtp' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'email' => 'getEmail', -'password' => 'getPassword', -'rememberMe' => 'getRememberMe', -'otp' => 'getOtp' ]; - - /** - * 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['password'] = isset($data['password']) ? $data['password'] : null; - $this->container['rememberMe'] = isset($data['rememberMe']) ? $data['rememberMe'] : null; - $this->container['otp'] = isset($data['otp']) ? $data['otp'] : 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"; - } - if ($this->container['password'] === null) { - $invalidProperties[] = "'password' 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 The username of the user to login. - * - * @return $this - */ - public function setEmail($email) - { - $this->container['email'] = $email; - - return $this; - } - - /** - * Gets password - * - * @return string - */ - public function getPassword() - { - return $this->container['password']; - } - - /** - * Sets password - * - * @param string $password The password of the user to login. - * - * @return $this - */ - public function setPassword($password) - { - $this->container['password'] = $password; - - return $this; - } - - /** - * Gets rememberMe - * - * @return bool - */ - public function getRememberMe() - { - return $this->container['rememberMe']; - } - - /** - * Sets rememberMe - * - * @param bool $rememberMe Whether or not the user wants to remain logged in after closing their browser. - * - * @return $this - */ - public function setRememberMe($rememberMe) - { - $this->container['rememberMe'] = $rememberMe; - - return $this; - } - - /** - * Gets otp - * - * @return string - */ - public function getOtp() - { - return $this->container['otp']; - } - - /** - * Sets otp - * - * @param string $otp A one time password AKA 2 factor authentication key. - * - * @return $this - */ - public function setOtp($otp) - { - $this->container['otp'] = $otp; - - 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/MetaDataDto.php b/src/Model/MetaDataDto.php deleted file mode 100644 index 44e9753..0000000 --- a/src/Model/MetaDataDto.php +++ /dev/null @@ -1,420 +0,0 @@ - 'int', -'key' => 'string', -'value' => 'object', -'displayKey' => 'string', -'displayValue' => 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'id' => null, -'key' => null, -'value' => null, -'displayKey' => null, -'displayValue' => 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', -'key' => 'key', -'value' => 'value', -'displayKey' => 'display_key', -'displayValue' => 'display_value' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'id' => 'setId', -'key' => 'setKey', -'value' => 'setValue', -'displayKey' => 'setDisplayKey', -'displayValue' => 'setDisplayValue' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'id' => 'getId', -'key' => 'getKey', -'value' => 'getValue', -'displayKey' => 'getDisplayKey', -'displayValue' => 'getDisplayValue' ]; - - /** - * 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['key'] = isset($data['key']) ? $data['key'] : null; - $this->container['value'] = isset($data['value']) ? $data['value'] : null; - $this->container['displayKey'] = isset($data['displayKey']) ? $data['displayKey'] : null; - $this->container['displayValue'] = isset($data['displayValue']) ? $data['displayValue'] : 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['key'] === null) { - $invalidProperties[] = "'key' can't be null"; - } - if ($this->container['value'] === null) { - $invalidProperties[] = "'value' 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 key - * - * @return string - */ - public function getKey() - { - return $this->container['key']; - } - - /** - * Sets key - * - * @param string $key key - * - * @return $this - */ - public function setKey($key) - { - $this->container['key'] = $key; - - return $this; - } - - /** - * Gets value - * - * @return object - */ - public function getValue() - { - return $this->container['value']; - } - - /** - * Sets value - * - * @param object $value value - * - * @return $this - */ - public function setValue($value) - { - $this->container['value'] = $value; - - return $this; - } - - /** - * Gets displayKey - * - * @return string - */ - public function getDisplayKey() - { - return $this->container['displayKey']; - } - - /** - * Sets displayKey - * - * @param string $displayKey displayKey - * - * @return $this - */ - public function setDisplayKey($displayKey) - { - $this->container['displayKey'] = $displayKey; - - return $this; - } - - /** - * Gets displayValue - * - * @return string - */ - public function getDisplayValue() - { - return $this->container['displayValue']; - } - - /** - * Sets displayValue - * - * @param string $displayValue displayValue - * - * @return $this - */ - public function setDisplayValue($displayValue) - { - $this->container['displayValue'] = $displayValue; - - 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/ModelInterface.php b/src/Model/ModelInterface.php deleted file mode 100644 index 676caa9..0000000 --- a/src/Model/ModelInterface.php +++ /dev/null @@ -1,95 +0,0 @@ - '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 - * - * @var string[] - */ - 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, -'vatNumberValid' => 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 = [ - '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', -'vatNumberValid' => 'vatNumberValid' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - 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', -'vatNumberValid' => 'setVatNumberValid' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - 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', -'vatNumberValid' => 'getVatNumberValid' ]; - - /** - * 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['countryOfOrigin'] = isset($data['countryOfOrigin']) ? $data['countryOfOrigin'] : null; - $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['totalAmount'] = isset($data['totalAmount']) ? $data['totalAmount'] : null; - $this->container['subtotalAmount'] = isset($data['subtotalAmount']) ? $data['subtotalAmount'] : null; - $this->container['date'] = isset($data['date']) ? $data['date'] : null; - $this->container['vatNumber'] = isset($data['vatNumber']) ? $data['vatNumber'] : null; - $this->container['paymentProvider'] = isset($data['paymentProvider']) ? $data['paymentProvider'] : null; - $this->container['paymentGateway'] = isset($data['paymentGateway']) ? $data['paymentGateway'] : null; - $this->container['paymentReference'] = isset($data['paymentReference']) ? $data['paymentReference'] : null; - $this->container['vatTotal'] = isset($data['vatTotal']) ? $data['vatTotal'] : null; - $this->container['discountTotal'] = isset($data['discountTotal']) ? $data['discountTotal'] : null; - $this->container['glNumber'] = isset($data['glNumber']) ? $data['glNumber'] : null; - $this->container['status'] = isset($data['status']) ? $data['status'] : null; - $this->container['sourceId'] = isset($data['sourceId']) ? $data['sourceId'] : null; - $this->container['sourceShopId'] = isset($data['sourceShopId']) ? $data['sourceShopId'] : null; - $this->container['invoiceNumber'] = isset($data['invoiceNumber']) ? $data['invoiceNumber'] : null; - $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; - $this->container['customerEmail'] = isset($data['customerEmail']) ? $data['customerEmail'] : null; - $this->container['customerFirstName'] = isset($data['customerFirstName']) ? $data['customerFirstName'] : null; - $this->container['customerLastName'] = isset($data['customerLastName']) ? $data['customerLastName'] : null; - $this->container['customerCompany'] = isset($data['customerCompany']) ? $data['customerCompany'] : null; - $this->container['customerPhone'] = isset($data['customerPhone']) ? $data['customerPhone'] : null; - $this->container['addressLine1'] = isset($data['addressLine1']) ? $data['addressLine1'] : null; - $this->container['addressLine2'] = isset($data['addressLine2']) ? $data['addressLine2'] : null; - $this->container['addressCity'] = isset($data['addressCity']) ? $data['addressCity'] : null; - $this->container['addressState'] = isset($data['addressState']) ? $data['addressState'] : null; - $this->container['addressZipcode'] = isset($data['addressZipcode']) ? $data['addressZipcode'] : null; - $this->container['addressCountry'] = isset($data['addressCountry']) ? $data['addressCountry'] : null; - $this->container['excludeFromRevenue'] = isset($data['excludeFromRevenue']) ? $data['excludeFromRevenue'] : null; - $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null; - $this->container['modifiedAt'] = isset($data['modifiedAt']) ? $data['modifiedAt'] : null; - $this->container['renewal'] = isset($data['renewal']) ? $data['renewal'] : null; - $this->container['automatic'] = isset($data['automatic']) ? $data['automatic'] : null; - $this->container['billingType'] = isset($data['billingType']) ? $data['billingType'] : null; - $this->container['ipAddress'] = isset($data['ipAddress']) ? $data['ipAddress'] : 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; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['countryOfOrigin'] === null) { - $invalidProperties[] = "'countryOfOrigin' can't be null"; - } - if ($this->container['id'] === null) { - $invalidProperties[] = "'id' can't be null"; - } - if ($this->container['totalAmount'] === null) { - $invalidProperties[] = "'totalAmount' can't be null"; - } - if ($this->container['subtotalAmount'] === null) { - $invalidProperties[] = "'subtotalAmount' can't be null"; - } - if ($this->container['date'] === null) { - $invalidProperties[] = "'date' can't be null"; - } - if ($this->container['vatNumber'] === null) { - $invalidProperties[] = "'vatNumber' can't be null"; - } - if ($this->container['paymentProvider'] === null) { - $invalidProperties[] = "'paymentProvider' can't be null"; - } - if ($this->container['paymentGateway'] === null) { - $invalidProperties[] = "'paymentGateway' can't be null"; - } - if ($this->container['paymentReference'] === null) { - $invalidProperties[] = "'paymentReference' can't be null"; - } - if ($this->container['vatTotal'] === null) { - $invalidProperties[] = "'vatTotal' can't be null"; - } - if ($this->container['discountTotal'] === null) { - $invalidProperties[] = "'discountTotal' can't be null"; - } - if ($this->container['glNumber'] === null) { - $invalidProperties[] = "'glNumber' can't be null"; - } - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['sourceId'] === null) { - $invalidProperties[] = "'sourceId' can't be null"; - } - if ($this->container['sourceShopId'] === null) { - $invalidProperties[] = "'sourceShopId' can't be null"; - } - if ($this->container['invoiceNumber'] === null) { - $invalidProperties[] = "'invoiceNumber' can't be null"; - } - if ($this->container['currency'] === null) { - $invalidProperties[] = "'currency' can't be null"; - } - if ($this->container['customerEmail'] === null) { - $invalidProperties[] = "'customerEmail' can't be null"; - } - if ($this->container['customerFirstName'] === null) { - $invalidProperties[] = "'customerFirstName' can't be null"; - } - if ($this->container['customerLastName'] === null) { - $invalidProperties[] = "'customerLastName' can't be null"; - } - if ($this->container['customerCompany'] === null) { - $invalidProperties[] = "'customerCompany' can't be null"; - } - if ($this->container['customerPhone'] === null) { - $invalidProperties[] = "'customerPhone' can't be null"; - } - if ($this->container['addressLine1'] === null) { - $invalidProperties[] = "'addressLine1' can't be null"; - } - if ($this->container['addressLine2'] === null) { - $invalidProperties[] = "'addressLine2' can't be null"; - } - if ($this->container['addressCity'] === null) { - $invalidProperties[] = "'addressCity' can't be null"; - } - if ($this->container['addressState'] === null) { - $invalidProperties[] = "'addressState' can't be null"; - } - if ($this->container['addressZipcode'] === null) { - $invalidProperties[] = "'addressZipcode' can't be null"; - } - if ($this->container['addressCountry'] === null) { - $invalidProperties[] = "'addressCountry' can't be null"; - } - if ($this->container['excludeFromRevenue'] === null) { - $invalidProperties[] = "'excludeFromRevenue' 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['renewal'] === null) { - $invalidProperties[] = "'renewal' can't be null"; - } - if ($this->container['automatic'] === null) { - $invalidProperties[] = "'automatic' can't be null"; - } - if ($this->container['billingType'] === null) { - $invalidProperties[] = "'billingType' can't be null"; - } - if ($this->container['ipAddress'] === null) { - $invalidProperties[] = "'ipAddress' can't be null"; - } - if ($this->container['customerId'] === null) { - $invalidProperties[] = "'customerId' can't be null"; - } - if ($this->container['processedCompletionAt'] === null) { - $invalidProperties[] = "'processedCompletionAt' can't be null"; - } - if ($this->container['renewalKey'] === null) { - $invalidProperties[] = "'renewalKey' can't be null"; - } - if ($this->container['vatNumberValid'] === null) { - $invalidProperties[] = "'vatNumberValid' 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 countryOfOrigin - * - * @return string - */ - public function getCountryOfOrigin() - { - return $this->container['countryOfOrigin']; - } - - /** - * Sets countryOfOrigin - * - * @param string $countryOfOrigin countryOfOrigin - * - * @return $this - */ - public function setCountryOfOrigin($countryOfOrigin) - { - $this->container['countryOfOrigin'] = $countryOfOrigin; - - return $this; - } - - /** - * 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 totalAmount - * - * @return int - */ - public function getTotalAmount() - { - return $this->container['totalAmount']; - } - - /** - * Sets totalAmount - * - * @param int $totalAmount totalAmount - * - * @return $this - */ - public function setTotalAmount($totalAmount) - { - $this->container['totalAmount'] = $totalAmount; - - return $this; - } - - /** - * Gets subtotalAmount - * - * @return int - */ - public function getSubtotalAmount() - { - return $this->container['subtotalAmount']; - } - - /** - * Sets subtotalAmount - * - * @param int $subtotalAmount subtotalAmount - * - * @return $this - */ - public function setSubtotalAmount($subtotalAmount) - { - $this->container['subtotalAmount'] = $subtotalAmount; - - return $this; - } - - /** - * Gets date - * - * @return \DateTime - */ - public function getDate() - { - return $this->container['date']; - } - - /** - * Sets date - * - * @param \DateTime $date date - * - * @return $this - */ - public function setDate($date) - { - $this->container['date'] = $date; - - return $this; - } - - /** - * Gets vatNumber - * - * @return string - */ - public function getVatNumber() - { - return $this->container['vatNumber']; - } - - /** - * Sets vatNumber - * - * @param string $vatNumber vatNumber - * - * @return $this - */ - public function setVatNumber($vatNumber) - { - $this->container['vatNumber'] = $vatNumber; - - return $this; - } - - /** - * Gets paymentProvider - * - * @return string - */ - public function getPaymentProvider() - { - return $this->container['paymentProvider']; - } - - /** - * Sets paymentProvider - * - * @param string $paymentProvider paymentProvider - * - * @return $this - */ - public function setPaymentProvider($paymentProvider) - { - $this->container['paymentProvider'] = $paymentProvider; - - return $this; - } - - /** - * Gets paymentGateway - * - * @return string - */ - public function getPaymentGateway() - { - return $this->container['paymentGateway']; - } - - /** - * Sets paymentGateway - * - * @param string $paymentGateway paymentGateway - * - * @return $this - */ - public function setPaymentGateway($paymentGateway) - { - $this->container['paymentGateway'] = $paymentGateway; - - return $this; - } - - /** - * Gets paymentReference - * - * @return string - */ - public function getPaymentReference() - { - return $this->container['paymentReference']; - } - - /** - * Sets paymentReference - * - * @param string $paymentReference paymentReference - * - * @return $this - */ - public function setPaymentReference($paymentReference) - { - $this->container['paymentReference'] = $paymentReference; - - return $this; - } - - /** - * Gets vatTotal - * - * @return int - */ - public function getVatTotal() - { - return $this->container['vatTotal']; - } - - /** - * Sets vatTotal - * - * @param int $vatTotal vatTotal - * - * @return $this - */ - public function setVatTotal($vatTotal) - { - $this->container['vatTotal'] = $vatTotal; - - return $this; - } - - /** - * Gets discountTotal - * - * @return int - */ - public function getDiscountTotal() - { - return $this->container['discountTotal']; - } - - /** - * Sets discountTotal - * - * @param int $discountTotal discountTotal - * - * @return $this - */ - public function setDiscountTotal($discountTotal) - { - $this->container['discountTotal'] = $discountTotal; - - return $this; - } - - /** - * Gets glNumber - * - * @return string - */ - public function getGlNumber() - { - return $this->container['glNumber']; - } - - /** - * Sets glNumber - * - * @param string $glNumber glNumber - * - * @return $this - */ - public function setGlNumber($glNumber) - { - $this->container['glNumber'] = $glNumber; - - return $this; - } - - /** - * Gets status - * - * @return string - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param string $status status - * - * @return $this - */ - public function setStatus($status) - { - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets sourceId - * - * @return int - */ - public function getSourceId() - { - return $this->container['sourceId']; - } - - /** - * Sets sourceId - * - * @param int $sourceId sourceId - * - * @return $this - */ - public function setSourceId($sourceId) - { - $this->container['sourceId'] = $sourceId; - - return $this; - } - - /** - * Gets sourceShopId - * - * @return int - */ - public function getSourceShopId() - { - return $this->container['sourceShopId']; - } - - /** - * Sets sourceShopId - * - * @param int $sourceShopId sourceShopId - * - * @return $this - */ - public function setSourceShopId($sourceShopId) - { - $this->container['sourceShopId'] = $sourceShopId; - - return $this; - } - - /** - * Gets invoiceNumber - * - * @return string - */ - public function getInvoiceNumber() - { - return $this->container['invoiceNumber']; - } - - /** - * Sets invoiceNumber - * - * @param string $invoiceNumber invoiceNumber - * - * @return $this - */ - public function setInvoiceNumber($invoiceNumber) - { - $this->container['invoiceNumber'] = $invoiceNumber; - - return $this; - } - - /** - * Gets currency - * - * @return string - */ - public function getCurrency() - { - return $this->container['currency']; - } - - /** - * Sets currency - * - * @param string $currency currency - * - * @return $this - */ - public function setCurrency($currency) - { - $this->container['currency'] = $currency; - - return $this; - } - - /** - * Gets customerEmail - * - * @return string - */ - public function getCustomerEmail() - { - return $this->container['customerEmail']; - } - - /** - * Sets customerEmail - * - * @param string $customerEmail customerEmail - * - * @return $this - */ - public function setCustomerEmail($customerEmail) - { - $this->container['customerEmail'] = $customerEmail; - - return $this; - } - - /** - * Gets customerFirstName - * - * @return string - */ - public function getCustomerFirstName() - { - return $this->container['customerFirstName']; - } - - /** - * Sets customerFirstName - * - * @param string $customerFirstName customerFirstName - * - * @return $this - */ - public function setCustomerFirstName($customerFirstName) - { - $this->container['customerFirstName'] = $customerFirstName; - - return $this; - } - - /** - * Gets customerLastName - * - * @return string - */ - public function getCustomerLastName() - { - return $this->container['customerLastName']; - } - - /** - * Sets customerLastName - * - * @param string $customerLastName customerLastName - * - * @return $this - */ - public function setCustomerLastName($customerLastName) - { - $this->container['customerLastName'] = $customerLastName; - - return $this; - } - - /** - * Gets customerCompany - * - * @return string - */ - public function getCustomerCompany() - { - return $this->container['customerCompany']; - } - - /** - * Sets customerCompany - * - * @param string $customerCompany customerCompany - * - * @return $this - */ - public function setCustomerCompany($customerCompany) - { - $this->container['customerCompany'] = $customerCompany; - - return $this; - } - - /** - * Gets customerPhone - * - * @return string - */ - public function getCustomerPhone() - { - return $this->container['customerPhone']; - } - - /** - * Sets customerPhone - * - * @param string $customerPhone customerPhone - * - * @return $this - */ - public function setCustomerPhone($customerPhone) - { - $this->container['customerPhone'] = $customerPhone; - - return $this; - } - - /** - * Gets addressLine1 - * - * @return string - */ - public function getAddressLine1() - { - return $this->container['addressLine1']; - } - - /** - * Sets addressLine1 - * - * @param string $addressLine1 addressLine1 - * - * @return $this - */ - public function setAddressLine1($addressLine1) - { - $this->container['addressLine1'] = $addressLine1; - - return $this; - } - - /** - * Gets addressLine2 - * - * @return string - */ - public function getAddressLine2() - { - return $this->container['addressLine2']; - } - - /** - * Sets addressLine2 - * - * @param string $addressLine2 addressLine2 - * - * @return $this - */ - public function setAddressLine2($addressLine2) - { - $this->container['addressLine2'] = $addressLine2; - - return $this; - } - - /** - * Gets addressCity - * - * @return string - */ - public function getAddressCity() - { - return $this->container['addressCity']; - } - - /** - * Sets addressCity - * - * @param string $addressCity addressCity - * - * @return $this - */ - public function setAddressCity($addressCity) - { - $this->container['addressCity'] = $addressCity; - - return $this; - } - - /** - * Gets addressState - * - * @return string - */ - public function getAddressState() - { - return $this->container['addressState']; - } - - /** - * Sets addressState - * - * @param string $addressState addressState - * - * @return $this - */ - public function setAddressState($addressState) - { - $this->container['addressState'] = $addressState; - - return $this; - } - - /** - * Gets addressZipcode - * - * @return string - */ - public function getAddressZipcode() - { - return $this->container['addressZipcode']; - } - - /** - * Sets addressZipcode - * - * @param string $addressZipcode addressZipcode - * - * @return $this - */ - public function setAddressZipcode($addressZipcode) - { - $this->container['addressZipcode'] = $addressZipcode; - - return $this; - } - - /** - * Gets addressCountry - * - * @return string - */ - public function getAddressCountry() - { - return $this->container['addressCountry']; - } - - /** - * Sets addressCountry - * - * @param string $addressCountry addressCountry - * - * @return $this - */ - public function setAddressCountry($addressCountry) - { - $this->container['addressCountry'] = $addressCountry; - - return $this; - } - - /** - * Gets excludeFromRevenue - * - * @return bool - */ - public function getExcludeFromRevenue() - { - return $this->container['excludeFromRevenue']; - } - - /** - * Sets excludeFromRevenue - * - * @param bool $excludeFromRevenue excludeFromRevenue - * - * @return $this - */ - public function setExcludeFromRevenue($excludeFromRevenue) - { - $this->container['excludeFromRevenue'] = $excludeFromRevenue; - - 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 renewal - * - * @return bool - */ - public function getRenewal() - { - return $this->container['renewal']; - } - - /** - * Sets renewal - * - * @param bool $renewal renewal - * - * @return $this - */ - public function setRenewal($renewal) - { - $this->container['renewal'] = $renewal; - - return $this; - } - - /** - * Gets automatic - * - * @return bool - */ - public function getAutomatic() - { - return $this->container['automatic']; - } - - /** - * Sets automatic - * - * @param bool $automatic automatic - * - * @return $this - */ - public function setAutomatic($automatic) - { - $this->container['automatic'] = $automatic; - - return $this; - } - - /** - * Gets billingType - * - * @return string - */ - public function getBillingType() - { - return $this->container['billingType']; - } - - /** - * Sets billingType - * - * @param string $billingType billingType - * - * @return $this - */ - public function setBillingType($billingType) - { - $this->container['billingType'] = $billingType; - - return $this; - } - - /** - * Gets ipAddress - * - * @return string - */ - public function getIpAddress() - { - return $this->container['ipAddress']; - } - - /** - * Sets ipAddress - * - * @param string $ipAddress ipAddress - * - * @return $this - */ - public function setIpAddress($ipAddress) - { - $this->container['ipAddress'] = $ipAddress; - - return $this; - } - - /** - * Gets customerId - * - * @return string - */ - public function getCustomerId() - { - return $this->container['customerId']; - } - - /** - * Sets customerId - * - * @param string $customerId customerId - * - * @return $this - */ - public function setCustomerId($customerId) - { - $this->container['customerId'] = $customerId; - - return $this; - } - - /** - * Gets processedCompletionAt - * - * @return \DateTime - */ - public function getProcessedCompletionAt() - { - return $this->container['processedCompletionAt']; - } - - /** - * Sets processedCompletionAt - * - * @param \DateTime $processedCompletionAt processedCompletionAt - * - * @return $this - */ - public function setProcessedCompletionAt($processedCompletionAt) - { - $this->container['processedCompletionAt'] = $processedCompletionAt; - - return $this; - } - - /** - * Gets renewalKey - * - * @return string - */ - public function getRenewalKey() - { - return $this->container['renewalKey']; - } - - /** - * Sets renewalKey - * - * @param string $renewalKey renewalKey - * - * @return $this - */ - public function setRenewalKey($renewalKey) - { - $this->container['renewalKey'] = $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. - * - * @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/OrderData.php b/src/Model/OrderData.php deleted file mode 100644 index 4562995..0000000 --- a/src/Model/OrderData.php +++ /dev/null @@ -1,1593 +0,0 @@ - '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' => '\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' => '\Yoast\MyYoastApiClient\Model\OrderRefundDto[]', -'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 - * - * @var string[] - */ - 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 ]; - - /** - * 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', -'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) - * - * @var string[] - */ - 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' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - 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' ]; - - /** - * 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['billing'] = isset($data['billing']) ? $data['billing'] : null; - $this->container['cartHash'] = isset($data['cartHash']) ? $data['cartHash'] : null; - $this->container['cartTax'] = isset($data['cartTax']) ? $data['cartTax'] : null; - $this->container['createdVia'] = isset($data['createdVia']) ? $data['createdVia'] : null; - $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; - $this->container['customerId'] = isset($data['customerId']) ? $data['customerId'] : null; - $this->container['customerIpAddress'] = isset($data['customerIpAddress']) ? $data['customerIpAddress'] : null; - $this->container['customerNote'] = isset($data['customerNote']) ? $data['customerNote'] : null; - $this->container['customerUserAgent'] = isset($data['customerUserAgent']) ? $data['customerUserAgent'] : null; - $this->container['dateCompleted'] = isset($data['dateCompleted']) ? $data['dateCompleted'] : null; - $this->container['dateCompletedGmt'] = isset($data['dateCompletedGmt']) ? $data['dateCompletedGmt'] : null; - $this->container['dateCreated'] = isset($data['dateCreated']) ? $data['dateCreated'] : null; - $this->container['dateCreatedGmt'] = isset($data['dateCreatedGmt']) ? $data['dateCreatedGmt'] : null; - $this->container['dateModified'] = isset($data['dateModified']) ? $data['dateModified'] : null; - $this->container['dateModifiedGmt'] = isset($data['dateModifiedGmt']) ? $data['dateModifiedGmt'] : null; - $this->container['datePaid'] = isset($data['datePaid']) ? $data['datePaid'] : null; - $this->container['datePaidGmt'] = isset($data['datePaidGmt']) ? $data['datePaidGmt'] : null; - $this->container['discountTax'] = isset($data['discountTax']) ? $data['discountTax'] : null; - $this->container['discountTotal'] = isset($data['discountTotal']) ? $data['discountTotal'] : null; - $this->container['couponLines'] = isset($data['couponLines']) ? $data['couponLines'] : null; - $this->container['feeLines'] = isset($data['feeLines']) ? $data['feeLines'] : null; - $this->container['lineItems'] = isset($data['lineItems']) ? $data['lineItems'] : null; - $this->container['metaData'] = isset($data['metaData']) ? $data['metaData'] : null; - $this->container['number'] = isset($data['number']) ? $data['number'] : null; - $this->container['orderKey'] = isset($data['orderKey']) ? $data['orderKey'] : null; - $this->container['parentId'] = isset($data['parentId']) ? $data['parentId'] : null; - $this->container['paymentMethod'] = isset($data['paymentMethod']) ? $data['paymentMethod'] : null; - $this->container['paymentMethodTitle'] = isset($data['paymentMethodTitle']) ? $data['paymentMethodTitle'] : null; - $this->container['pricesIncludeTax'] = isset($data['pricesIncludeTax']) ? $data['pricesIncludeTax'] : null; - $this->container['refunds'] = isset($data['refunds']) ? $data['refunds'] : null; - $this->container['shipping'] = isset($data['shipping']) ? $data['shipping'] : null; - $this->container['shippingLines'] = isset($data['shippingLines']) ? $data['shippingLines'] : null; - $this->container['shippingTax'] = isset($data['shippingTax']) ? $data['shippingTax'] : null; - $this->container['shippingTotal'] = isset($data['shippingTotal']) ? $data['shippingTotal'] : null; - $this->container['status'] = isset($data['status']) ? $data['status'] : null; - $this->container['taxLines'] = isset($data['taxLines']) ? $data['taxLines'] : null; - $this->container['total'] = isset($data['total']) ? $data['total'] : null; - $this->container['totalTax'] = isset($data['totalTax']) ? $data['totalTax'] : null; - $this->container['transactionId'] = isset($data['transactionId']) ? $data['transactionId'] : null; - $this->container['version'] = isset($data['version']) ? $data['version'] : 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['billing'] === null) { - $invalidProperties[] = "'billing' can't be null"; - } - if ($this->container['cartHash'] === null) { - $invalidProperties[] = "'cartHash' can't be null"; - } - if ($this->container['cartTax'] === null) { - $invalidProperties[] = "'cartTax' can't be null"; - } - if ($this->container['createdVia'] === null) { - $invalidProperties[] = "'createdVia' can't be null"; - } - if ($this->container['currency'] === null) { - $invalidProperties[] = "'currency' can't be null"; - } - if ($this->container['customerId'] === null) { - $invalidProperties[] = "'customerId' can't be null"; - } - if ($this->container['customerIpAddress'] === null) { - $invalidProperties[] = "'customerIpAddress' can't be null"; - } - if ($this->container['customerNote'] === null) { - $invalidProperties[] = "'customerNote' can't be null"; - } - if ($this->container['customerUserAgent'] === null) { - $invalidProperties[] = "'customerUserAgent' can't be null"; - } - if ($this->container['dateCreated'] === null) { - $invalidProperties[] = "'dateCreated' can't be null"; - } - if ($this->container['dateCreatedGmt'] === null) { - $invalidProperties[] = "'dateCreatedGmt' can't be null"; - } - if ($this->container['discountTax'] === null) { - $invalidProperties[] = "'discountTax' can't be null"; - } - if ($this->container['discountTotal'] === null) { - $invalidProperties[] = "'discountTotal' can't be null"; - } - if ($this->container['couponLines'] === null) { - $invalidProperties[] = "'couponLines' can't be null"; - } - if ($this->container['feeLines'] === null) { - $invalidProperties[] = "'feeLines' can't be null"; - } - if ($this->container['lineItems'] === null) { - $invalidProperties[] = "'lineItems' can't be null"; - } - if ($this->container['metaData'] === null) { - $invalidProperties[] = "'metaData' can't be null"; - } - if ($this->container['number'] === null) { - $invalidProperties[] = "'number' can't be null"; - } - if ($this->container['orderKey'] === null) { - $invalidProperties[] = "'orderKey' can't be null"; - } - if ($this->container['paymentMethod'] === null) { - $invalidProperties[] = "'paymentMethod' can't be null"; - } - if ($this->container['paymentMethodTitle'] === null) { - $invalidProperties[] = "'paymentMethodTitle' can't be null"; - } - if ($this->container['pricesIncludeTax'] === null) { - $invalidProperties[] = "'pricesIncludeTax' can't be null"; - } - if ($this->container['refunds'] === null) { - $invalidProperties[] = "'refunds' can't be null"; - } - if ($this->container['shipping'] === null) { - $invalidProperties[] = "'shipping' can't be null"; - } - if ($this->container['shippingLines'] === null) { - $invalidProperties[] = "'shippingLines' can't be null"; - } - if ($this->container['shippingTax'] === null) { - $invalidProperties[] = "'shippingTax' can't be null"; - } - if ($this->container['shippingTotal'] === null) { - $invalidProperties[] = "'shippingTotal' can't be null"; - } - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['taxLines'] === null) { - $invalidProperties[] = "'taxLines' 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['transactionId'] === null) { - $invalidProperties[] = "'transactionId' can't be null"; - } - if ($this->container['version'] === null) { - $invalidProperties[] = "'version' 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 billing - * - * @return \Yoast\MyYoastApiClient\Model\BillingDto - */ - public function getBilling() - { - return $this->container['billing']; - } - - /** - * Sets billing - * - * @param \Yoast\MyYoastApiClient\Model\BillingDto $billing billing - * - * @return $this - */ - public function setBilling($billing) - { - $this->container['billing'] = $billing; - - return $this; - } - - /** - * Gets cartHash - * - * @return string - */ - public function getCartHash() - { - return $this->container['cartHash']; - } - - /** - * Sets cartHash - * - * @param string $cartHash cartHash - * - * @return $this - */ - public function setCartHash($cartHash) - { - $this->container['cartHash'] = $cartHash; - - return $this; - } - - /** - * Gets cartTax - * - * @return string - */ - public function getCartTax() - { - return $this->container['cartTax']; - } - - /** - * Sets cartTax - * - * @param string $cartTax cartTax - * - * @return $this - */ - public function setCartTax($cartTax) - { - $this->container['cartTax'] = $cartTax; - - return $this; - } - - /** - * Gets createdVia - * - * @return string - */ - public function getCreatedVia() - { - return $this->container['createdVia']; - } - - /** - * Sets createdVia - * - * @param string $createdVia createdVia - * - * @return $this - */ - public function setCreatedVia($createdVia) - { - $this->container['createdVia'] = $createdVia; - - return $this; - } - - /** - * Gets currency - * - * @return string - */ - public function getCurrency() - { - return $this->container['currency']; - } - - /** - * Sets currency - * - * @param string $currency currency - * - * @return $this - */ - public function setCurrency($currency) - { - $this->container['currency'] = $currency; - - return $this; - } - - /** - * Gets customerId - * - * @return int - */ - public function getCustomerId() - { - return $this->container['customerId']; - } - - /** - * Sets customerId - * - * @param int $customerId customerId - * - * @return $this - */ - public function setCustomerId($customerId) - { - $this->container['customerId'] = $customerId; - - return $this; - } - - /** - * Gets customerIpAddress - * - * @return string - */ - public function getCustomerIpAddress() - { - return $this->container['customerIpAddress']; - } - - /** - * Sets customerIpAddress - * - * @param string $customerIpAddress customerIpAddress - * - * @return $this - */ - public function setCustomerIpAddress($customerIpAddress) - { - $this->container['customerIpAddress'] = $customerIpAddress; - - return $this; - } - - /** - * Gets customerNote - * - * @return string - */ - public function getCustomerNote() - { - return $this->container['customerNote']; - } - - /** - * Sets customerNote - * - * @param string $customerNote customerNote - * - * @return $this - */ - public function setCustomerNote($customerNote) - { - $this->container['customerNote'] = $customerNote; - - return $this; - } - - /** - * Gets customerUserAgent - * - * @return string - */ - public function getCustomerUserAgent() - { - return $this->container['customerUserAgent']; - } - - /** - * Sets customerUserAgent - * - * @param string $customerUserAgent customerUserAgent - * - * @return $this - */ - public function setCustomerUserAgent($customerUserAgent) - { - $this->container['customerUserAgent'] = $customerUserAgent; - - return $this; - } - - /** - * Gets dateCompleted - * - * @return \DateTime - */ - public function getDateCompleted() - { - return $this->container['dateCompleted']; - } - - /** - * Sets dateCompleted - * - * @param \DateTime $dateCompleted dateCompleted - * - * @return $this - */ - public function setDateCompleted($dateCompleted) - { - $this->container['dateCompleted'] = $dateCompleted; - - return $this; - } - - /** - * Gets dateCompletedGmt - * - * @return \DateTime - */ - public function getDateCompletedGmt() - { - return $this->container['dateCompletedGmt']; - } - - /** - * Sets dateCompletedGmt - * - * @param \DateTime $dateCompletedGmt dateCompletedGmt - * - * @return $this - */ - public function setDateCompletedGmt($dateCompletedGmt) - { - $this->container['dateCompletedGmt'] = $dateCompletedGmt; - - return $this; - } - - /** - * Gets dateCreated - * - * @return \DateTime - */ - public function getDateCreated() - { - return $this->container['dateCreated']; - } - - /** - * Sets dateCreated - * - * @param \DateTime $dateCreated dateCreated - * - * @return $this - */ - public function setDateCreated($dateCreated) - { - $this->container['dateCreated'] = $dateCreated; - - return $this; - } - - /** - * Gets dateCreatedGmt - * - * @return \DateTime - */ - public function getDateCreatedGmt() - { - return $this->container['dateCreatedGmt']; - } - - /** - * Sets dateCreatedGmt - * - * @param \DateTime $dateCreatedGmt dateCreatedGmt - * - * @return $this - */ - public function setDateCreatedGmt($dateCreatedGmt) - { - $this->container['dateCreatedGmt'] = $dateCreatedGmt; - - return $this; - } - - /** - * Gets dateModified - * - * @return \DateTime - */ - public function getDateModified() - { - return $this->container['dateModified']; - } - - /** - * Sets dateModified - * - * @param \DateTime $dateModified dateModified - * - * @return $this - */ - public function setDateModified($dateModified) - { - $this->container['dateModified'] = $dateModified; - - return $this; - } - - /** - * Gets dateModifiedGmt - * - * @return \DateTime - */ - public function getDateModifiedGmt() - { - return $this->container['dateModifiedGmt']; - } - - /** - * Sets dateModifiedGmt - * - * @param \DateTime $dateModifiedGmt dateModifiedGmt - * - * @return $this - */ - public function setDateModifiedGmt($dateModifiedGmt) - { - $this->container['dateModifiedGmt'] = $dateModifiedGmt; - - return $this; - } - - /** - * Gets datePaid - * - * @return \DateTime - */ - public function getDatePaid() - { - return $this->container['datePaid']; - } - - /** - * Sets datePaid - * - * @param \DateTime $datePaid datePaid - * - * @return $this - */ - public function setDatePaid($datePaid) - { - $this->container['datePaid'] = $datePaid; - - return $this; - } - - /** - * Gets datePaidGmt - * - * @return \DateTime - */ - public function getDatePaidGmt() - { - return $this->container['datePaidGmt']; - } - - /** - * Sets datePaidGmt - * - * @param \DateTime $datePaidGmt datePaidGmt - * - * @return $this - */ - public function setDatePaidGmt($datePaidGmt) - { - $this->container['datePaidGmt'] = $datePaidGmt; - - return $this; - } - - /** - * Gets discountTax - * - * @return string - */ - public function getDiscountTax() - { - return $this->container['discountTax']; - } - - /** - * Sets discountTax - * - * @param string $discountTax discountTax - * - * @return $this - */ - public function setDiscountTax($discountTax) - { - $this->container['discountTax'] = $discountTax; - - return $this; - } - - /** - * Gets discountTotal - * - * @return string - */ - public function getDiscountTotal() - { - return $this->container['discountTotal']; - } - - /** - * Sets discountTotal - * - * @param string $discountTotal discountTotal - * - * @return $this - */ - public function setDiscountTotal($discountTotal) - { - $this->container['discountTotal'] = $discountTotal; - - return $this; - } - - /** - * Gets couponLines - * - * @return \Yoast\MyYoastApiClient\Model\CouponLineDto[] - */ - public function getCouponLines() - { - return $this->container['couponLines']; - } - - /** - * Sets couponLines - * - * @param \Yoast\MyYoastApiClient\Model\CouponLineDto[] $couponLines couponLines - * - * @return $this - */ - public function setCouponLines($couponLines) - { - $this->container['couponLines'] = $couponLines; - - return $this; - } - - /** - * Gets feeLines - * - * @return \Yoast\MyYoastApiClient\Model\FeeLineDto[] - */ - public function getFeeLines() - { - return $this->container['feeLines']; - } - - /** - * Sets feeLines - * - * @param \Yoast\MyYoastApiClient\Model\FeeLineDto[] $feeLines feeLines - * - * @return $this - */ - public function setFeeLines($feeLines) - { - $this->container['feeLines'] = $feeLines; - - return $this; - } - - /** - * Gets lineItems - * - * @return \Yoast\MyYoastApiClient\Model\LineItemDto[] - */ - public function getLineItems() - { - return $this->container['lineItems']; - } - - /** - * Sets lineItems - * - * @param \Yoast\MyYoastApiClient\Model\LineItemDto[] $lineItems lineItems - * - * @return $this - */ - public function setLineItems($lineItems) - { - $this->container['lineItems'] = $lineItems; - - 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; - } - - /** - * Gets number - * - * @return string - */ - public function getNumber() - { - return $this->container['number']; - } - - /** - * Sets number - * - * @param string $number number - * - * @return $this - */ - public function setNumber($number) - { - $this->container['number'] = $number; - - return $this; - } - - /** - * Gets orderKey - * - * @return string - */ - public function getOrderKey() - { - return $this->container['orderKey']; - } - - /** - * Sets orderKey - * - * @param string $orderKey orderKey - * - * @return $this - */ - public function setOrderKey($orderKey) - { - $this->container['orderKey'] = $orderKey; - - return $this; - } - - /** - * Gets parentId - * - * @return int - */ - public function getParentId() - { - return $this->container['parentId']; - } - - /** - * Sets parentId - * - * @param int $parentId parentId - * - * @return $this - */ - public function setParentId($parentId) - { - $this->container['parentId'] = $parentId; - - return $this; - } - - /** - * Gets paymentMethod - * - * @return string - */ - public function getPaymentMethod() - { - return $this->container['paymentMethod']; - } - - /** - * Sets paymentMethod - * - * @param string $paymentMethod paymentMethod - * - * @return $this - */ - public function setPaymentMethod($paymentMethod) - { - $this->container['paymentMethod'] = $paymentMethod; - - return $this; - } - - /** - * Gets paymentMethodTitle - * - * @return string - */ - public function getPaymentMethodTitle() - { - return $this->container['paymentMethodTitle']; - } - - /** - * Sets paymentMethodTitle - * - * @param string $paymentMethodTitle paymentMethodTitle - * - * @return $this - */ - public function setPaymentMethodTitle($paymentMethodTitle) - { - $this->container['paymentMethodTitle'] = $paymentMethodTitle; - - return $this; - } - - /** - * Gets pricesIncludeTax - * - * @return bool - */ - public function getPricesIncludeTax() - { - return $this->container['pricesIncludeTax']; - } - - /** - * Sets pricesIncludeTax - * - * @param bool $pricesIncludeTax pricesIncludeTax - * - * @return $this - */ - public function setPricesIncludeTax($pricesIncludeTax) - { - $this->container['pricesIncludeTax'] = $pricesIncludeTax; - - return $this; - } - - /** - * Gets refunds - * - * @return \Yoast\MyYoastApiClient\Model\OrderRefundDto[] - */ - public function getRefunds() - { - return $this->container['refunds']; - } - - /** - * Sets refunds - * - * @param \Yoast\MyYoastApiClient\Model\OrderRefundDto[] $refunds refunds - * - * @return $this - */ - public function setRefunds($refunds) - { - $this->container['refunds'] = $refunds; - - return $this; - } - - /** - * Gets shipping - * - * @return \Yoast\MyYoastApiClient\Model\ShippingDto - */ - public function getShipping() - { - return $this->container['shipping']; - } - - /** - * Sets shipping - * - * @param \Yoast\MyYoastApiClient\Model\ShippingDto $shipping shipping - * - * @return $this - */ - public function setShipping($shipping) - { - $this->container['shipping'] = $shipping; - - return $this; - } - - /** - * Gets shippingLines - * - * @return string[] - */ - public function getShippingLines() - { - return $this->container['shippingLines']; - } - - /** - * Sets shippingLines - * - * @param string[] $shippingLines shippingLines - * - * @return $this - */ - public function setShippingLines($shippingLines) - { - $this->container['shippingLines'] = $shippingLines; - - return $this; - } - - /** - * Gets shippingTax - * - * @return string - */ - public function getShippingTax() - { - return $this->container['shippingTax']; - } - - /** - * Sets shippingTax - * - * @param string $shippingTax shippingTax - * - * @return $this - */ - public function setShippingTax($shippingTax) - { - $this->container['shippingTax'] = $shippingTax; - - return $this; - } - - /** - * Gets shippingTotal - * - * @return string - */ - public function getShippingTotal() - { - return $this->container['shippingTotal']; - } - - /** - * Sets shippingTotal - * - * @param string $shippingTotal shippingTotal - * - * @return $this - */ - public function setShippingTotal($shippingTotal) - { - $this->container['shippingTotal'] = $shippingTotal; - - return $this; - } - - /** - * Gets status - * - * @return string - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param string $status status - * - * @return $this - */ - public function setStatus($status) - { - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets taxLines - * - * @return \Yoast\MyYoastApiClient\Model\TaxLineItem[] - */ - public function getTaxLines() - { - return $this->container['taxLines']; - } - - /** - * Sets taxLines - * - * @param \Yoast\MyYoastApiClient\Model\TaxLineItem[] $taxLines taxLines - * - * @return $this - */ - public function setTaxLines($taxLines) - { - $this->container['taxLines'] = $taxLines; - - 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 transactionId - * - * @return string - */ - public function getTransactionId() - { - return $this->container['transactionId']; - } - - /** - * Sets transactionId - * - * @param string $transactionId transactionId - * - * @return $this - */ - public function setTransactionId($transactionId) - { - $this->container['transactionId'] = $transactionId; - - return $this; - } - - /** - * Gets version - * - * @return string - */ - public function getVersion() - { - return $this->container['version']; - } - - /** - * Sets version - * - * @param string $version version - * - * @return $this - */ - public function setVersion($version) - { - $this->container['version'] = $version; - - 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/OrderFromWooDto.php b/src/Model/OrderFromWooDto.php deleted file mode 100644 index 27c824f..0000000 --- a/src/Model/OrderFromWooDto.php +++ /dev/null @@ -1,327 +0,0 @@ - '\Yoast\MyYoastApiClient\Model\OrderData', -'extraData' => '\Yoast\MyYoastApiClient\Model\ExtraOrderData' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'orderData' => null, -'extraData' => 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 = [ - 'orderData' => 'orderData', -'extraData' => 'extraData' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'orderData' => 'setOrderData', -'extraData' => 'setExtraData' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'orderData' => 'getOrderData', -'extraData' => 'getExtraData' ]; - - /** - * 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['orderData'] = isset($data['orderData']) ? $data['orderData'] : null; - $this->container['extraData'] = isset($data['extraData']) ? $data['extraData'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['orderData'] === null) { - $invalidProperties[] = "'orderData' can't be null"; - } - if ($this->container['extraData'] === null) { - $invalidProperties[] = "'extraData' 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 orderData - * - * @return \Yoast\MyYoastApiClient\Model\OrderData - */ - public function getOrderData() - { - return $this->container['orderData']; - } - - /** - * Sets orderData - * - * @param \Yoast\MyYoastApiClient\Model\OrderData $orderData orderData - * - * @return $this - */ - public function setOrderData($orderData) - { - $this->container['orderData'] = $orderData; - - return $this; - } - - /** - * Gets extraData - * - * @return \Yoast\MyYoastApiClient\Model\ExtraOrderData - */ - public function getExtraData() - { - return $this->container['extraData']; - } - - /** - * Sets extraData - * - * @param \Yoast\MyYoastApiClient\Model\ExtraOrderData $extraData extraData - * - * @return $this - */ - public function setExtraData($extraData) - { - $this->container['extraData'] = $extraData; - - 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/OrderRefundDto.php b/src/Model/OrderRefundDto.php deleted file mode 100644 index 8f467e1..0000000 --- a/src/Model/OrderRefundDto.php +++ /dev/null @@ -1,360 +0,0 @@ - 'int', -'reason' => 'string', -'total' => 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'id' => null, -'reason' => null, -'total' => 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', -'reason' => 'reason', -'total' => 'total' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'id' => 'setId', -'reason' => 'setReason', -'total' => 'setTotal' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'id' => 'getId', -'reason' => 'getReason', -'total' => 'getTotal' ]; - - /** - * 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['reason'] = isset($data['reason']) ? $data['reason'] : null; - $this->container['total'] = isset($data['total']) ? $data['total'] : 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['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['total'] === null) { - $invalidProperties[] = "'total' 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 reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return $this - */ - public function setReason($reason) - { - $this->container['reason'] = $reason; - - 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; - } - /** - * 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/Product.php b/src/Model/Product.php deleted file mode 100644 index 445915a..0000000 --- a/src/Model/Product.php +++ /dev/null @@ -1,1083 +0,0 @@ - '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 - * - * @var string[] - */ - 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' ]; - - /** - * 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', -'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) - * - * @var string[] - */ - 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' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - 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' ]; - - /** - * 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['storeUrl'] = isset($data['storeUrl']) ? $data['storeUrl'] : null; - $this->container['downloads'] = isset($data['downloads']) ? $data['downloads'] : null; - $this->container['glNumber'] = isset($data['glNumber']) ? $data['glNumber'] : null; - $this->container['isDownloadOnly'] = isset($data['isDownloadOnly']) ? $data['isDownloadOnly'] : null; - $this->container['icon'] = isset($data['icon']) ? $data['icon'] : null; - $this->container['sourceId'] = isset($data['sourceId']) ? $data['sourceId'] : null; - $this->container['sourceShopId'] = isset($data['sourceShopId']) ? $data['sourceShopId'] : null; - $this->container['shopProductType'] = isset($data['shopProductType']) ? $data['shopProductType'] : null; - $this->container['shopStatus'] = isset($data['shopStatus']) ? $data['shopStatus'] : null; - $this->container['price'] = isset($data['price']) ? $data['price'] : null; - $this->container['shopRegularPrice'] = isset($data['shopRegularPrice']) ? $data['shopRegularPrice'] : null; - $this->container['shopTaxStatus'] = isset($data['shopTaxStatus']) ? $data['shopTaxStatus'] : null; - $this->container['shopTaxClass'] = isset($data['shopTaxClass']) ? $data['shopTaxClass'] : null; - $this->container['currentVersion'] = isset($data['currentVersion']) ? $data['currentVersion'] : null; - $this->container['changelog'] = isset($data['changelog']) ? $data['changelog'] : null; - $this->container['type'] = isset($data['type']) ? $data['type'] : null; - $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; - $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null; - $this->container['modifiedAt'] = isset($data['modifiedAt']) ? $data['modifiedAt'] : null; - $this->container['billingTerm'] = isset($data['billingTerm']) ? $data['billingTerm'] : null; - $this->container['billingType'] = isset($data['billingType']) ? $data['billingType'] : null; - $this->container['activationLimit'] = isset($data['activationLimit']) ? $data['activationLimit'] : null; - $this->container['courseId'] = isset($data['courseId']) ? $data['courseId'] : 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['storeUrl'] === null) { - $invalidProperties[] = "'storeUrl' can't be null"; - } - if ($this->container['glNumber'] === null) { - $invalidProperties[] = "'glNumber' can't be null"; - } - if ($this->container['isDownloadOnly'] === null) { - $invalidProperties[] = "'isDownloadOnly' can't be null"; - } - if ($this->container['icon'] === null) { - $invalidProperties[] = "'icon' can't be null"; - } - if ($this->container['sourceId'] === null) { - $invalidProperties[] = "'sourceId' can't be null"; - } - if ($this->container['sourceShopId'] === null) { - $invalidProperties[] = "'sourceShopId' can't be null"; - } - if ($this->container['shopProductType'] === null) { - $invalidProperties[] = "'shopProductType' can't be null"; - } - if ($this->container['shopStatus'] === null) { - $invalidProperties[] = "'shopStatus' can't be null"; - } - if ($this->container['price'] === null) { - $invalidProperties[] = "'price' can't be null"; - } - if ($this->container['shopRegularPrice'] === null) { - $invalidProperties[] = "'shopRegularPrice' can't be null"; - } - if ($this->container['shopTaxStatus'] === null) { - $invalidProperties[] = "'shopTaxStatus' can't be null"; - } - if ($this->container['shopTaxClass'] === null) { - $invalidProperties[] = "'shopTaxClass' can't be null"; - } - if ($this->container['currentVersion'] === null) { - $invalidProperties[] = "'currentVersion' can't be null"; - } - if ($this->container['changelog'] === null) { - $invalidProperties[] = "'changelog' can't be null"; - } - if ($this->container['type'] === null) { - $invalidProperties[] = "'type' can't be null"; - } - if ($this->container['currency'] === null) { - $invalidProperties[] = "'currency' 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['billingTerm'] === null) { - $invalidProperties[] = "'billingTerm' can't be null"; - } - if ($this->container['billingType'] === null) { - $invalidProperties[] = "'billingType' can't be null"; - } - if ($this->container['activationLimit'] === null) { - $invalidProperties[] = "'activationLimit' can't be null"; - } - if ($this->container['courseId'] === null) { - $invalidProperties[] = "'courseId' 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 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 storeUrl - * - * @return string - */ - public function getStoreUrl() - { - return $this->container['storeUrl']; - } - - /** - * Sets storeUrl - * - * @param string $storeUrl storeUrl - * - * @return $this - */ - public function setStoreUrl($storeUrl) - { - $this->container['storeUrl'] = $storeUrl; - - return $this; - } - - /** - * Gets downloads - * - * @return \Yoast\MyYoastApiClient\Model\ProductDownload[] - */ - public function getDownloads() - { - return $this->container['downloads']; - } - - /** - * Sets downloads - * - * @param \Yoast\MyYoastApiClient\Model\ProductDownload[] $downloads downloads - * - * @return $this - */ - public function setDownloads($downloads) - { - $this->container['downloads'] = $downloads; - - return $this; - } - - /** - * Gets glNumber - * - * @return string - */ - public function getGlNumber() - { - return $this->container['glNumber']; - } - - /** - * Sets glNumber - * - * @param string $glNumber glNumber - * - * @return $this - */ - public function setGlNumber($glNumber) - { - $this->container['glNumber'] = $glNumber; - - return $this; - } - - /** - * Gets isDownloadOnly - * - * @return bool - */ - public function getIsDownloadOnly() - { - return $this->container['isDownloadOnly']; - } - - /** - * Sets isDownloadOnly - * - * @param bool $isDownloadOnly isDownloadOnly - * - * @return $this - */ - public function setIsDownloadOnly($isDownloadOnly) - { - $this->container['isDownloadOnly'] = $isDownloadOnly; - - return $this; - } - - /** - * Gets icon - * - * @return string - */ - public function getIcon() - { - return $this->container['icon']; - } - - /** - * Sets icon - * - * @param string $icon icon - * - * @return $this - */ - public function setIcon($icon) - { - $this->container['icon'] = $icon; - - return $this; - } - - /** - * Gets sourceId - * - * @return int - */ - public function getSourceId() - { - return $this->container['sourceId']; - } - - /** - * Sets sourceId - * - * @param int $sourceId sourceId - * - * @return $this - */ - public function setSourceId($sourceId) - { - $this->container['sourceId'] = $sourceId; - - return $this; - } - - /** - * Gets sourceShopId - * - * @return int - */ - public function getSourceShopId() - { - return $this->container['sourceShopId']; - } - - /** - * Sets sourceShopId - * - * @param int $sourceShopId sourceShopId - * - * @return $this - */ - public function setSourceShopId($sourceShopId) - { - $this->container['sourceShopId'] = $sourceShopId; - - return $this; - } - - /** - * Gets shopProductType - * - * @return string - */ - public function getShopProductType() - { - return $this->container['shopProductType']; - } - - /** - * Sets shopProductType - * - * @param string $shopProductType shopProductType - * - * @return $this - */ - public function setShopProductType($shopProductType) - { - $this->container['shopProductType'] = $shopProductType; - - return $this; - } - - /** - * Gets shopStatus - * - * @return string - */ - public function getShopStatus() - { - return $this->container['shopStatus']; - } - - /** - * Sets shopStatus - * - * @param string $shopStatus shopStatus - * - * @return $this - */ - public function setShopStatus($shopStatus) - { - $this->container['shopStatus'] = $shopStatus; - - return $this; - } - - /** - * Gets price - * - * @return int - */ - public function getPrice() - { - return $this->container['price']; - } - - /** - * Sets price - * - * @param int $price price - * - * @return $this - */ - public function setPrice($price) - { - $this->container['price'] = $price; - - return $this; - } - - /** - * Gets shopRegularPrice - * - * @return int - */ - public function getShopRegularPrice() - { - return $this->container['shopRegularPrice']; - } - - /** - * Sets shopRegularPrice - * - * @param int $shopRegularPrice shopRegularPrice - * - * @return $this - */ - public function setShopRegularPrice($shopRegularPrice) - { - $this->container['shopRegularPrice'] = $shopRegularPrice; - - return $this; - } - - /** - * Gets shopTaxStatus - * - * @return string - */ - public function getShopTaxStatus() - { - return $this->container['shopTaxStatus']; - } - - /** - * Sets shopTaxStatus - * - * @param string $shopTaxStatus shopTaxStatus - * - * @return $this - */ - public function setShopTaxStatus($shopTaxStatus) - { - $this->container['shopTaxStatus'] = $shopTaxStatus; - - return $this; - } - - /** - * Gets shopTaxClass - * - * @return string - */ - public function getShopTaxClass() - { - return $this->container['shopTaxClass']; - } - - /** - * Sets shopTaxClass - * - * @param string $shopTaxClass shopTaxClass - * - * @return $this - */ - public function setShopTaxClass($shopTaxClass) - { - $this->container['shopTaxClass'] = $shopTaxClass; - - return $this; - } - - /** - * Gets currentVersion - * - * @return string - */ - public function getCurrentVersion() - { - return $this->container['currentVersion']; - } - - /** - * Sets currentVersion - * - * @param string $currentVersion currentVersion - * - * @return $this - */ - public function setCurrentVersion($currentVersion) - { - $this->container['currentVersion'] = $currentVersion; - - return $this; - } - - /** - * Gets changelog - * - * @return string - */ - public function getChangelog() - { - return $this->container['changelog']; - } - - /** - * Sets changelog - * - * @param string $changelog changelog - * - * @return $this - */ - public function setChangelog($changelog) - { - $this->container['changelog'] = $changelog; - - return $this; - } - - /** - * Gets type - * - * @return string - */ - public function getType() - { - return $this->container['type']; - } - - /** - * Sets type - * - * @param string $type type - * - * @return $this - */ - public function setType($type) - { - $this->container['type'] = $type; - - return $this; - } - - /** - * Gets currency - * - * @return string - */ - public function getCurrency() - { - return $this->container['currency']; - } - - /** - * Sets currency - * - * @param string $currency currency - * - * @return $this - */ - public function setCurrency($currency) - { - $this->container['currency'] = $currency; - - 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 billingTerm - * - * @return string - */ - public function getBillingTerm() - { - return $this->container['billingTerm']; - } - - /** - * Sets billingTerm - * - * @param string $billingTerm billingTerm - * - * @return $this - */ - public function setBillingTerm($billingTerm) - { - $this->container['billingTerm'] = $billingTerm; - - return $this; - } - - /** - * Gets billingType - * - * @return string - */ - public function getBillingType() - { - return $this->container['billingType']; - } - - /** - * Sets billingType - * - * @param string $billingType billingType - * - * @return $this - */ - public function setBillingType($billingType) - { - $this->container['billingType'] = $billingType; - - return $this; - } - - /** - * Gets activationLimit - * - * @return int - */ - public function getActivationLimit() - { - return $this->container['activationLimit']; - } - - /** - * Sets activationLimit - * - * @param int $activationLimit activationLimit - * - * @return $this - */ - public function setActivationLimit($activationLimit) - { - $this->container['activationLimit'] = $activationLimit; - - return $this; - } - - /** - * Gets courseId - * - * @return string - */ - public function getCourseId() - { - return $this->container['courseId']; - } - - /** - * Sets courseId - * - * @param string $courseId courseId - * - * @return $this - */ - public function setCourseId($courseId) - { - $this->container['courseId'] = $courseId; - - 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/ProductCategory.php b/src/Model/ProductCategory.php deleted file mode 100644 index 415d644..0000000 --- a/src/Model/ProductCategory.php +++ /dev/null @@ -1,360 +0,0 @@ - 'int', -'name' => 'string', -'slug' => 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'id' => null, -'name' => null, -'slug' => 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', -'slug' => 'slug' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'id' => 'setId', -'name' => 'setName', -'slug' => 'setSlug' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'id' => 'getId', -'name' => 'getName', -'slug' => 'getSlug' ]; - - /** - * 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['slug'] = isset($data['slug']) ? $data['slug'] : 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['slug'] === null) { - $invalidProperties[] = "'slug' 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 slug - * - * @return string - */ - public function getSlug() - { - return $this->container['slug']; - } - - /** - * Sets slug - * - * @param string $slug slug - * - * @return $this - */ - public function setSlug($slug) - { - $this->container['slug'] = $slug; - - 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/ProductData.php b/src/Model/ProductData.php deleted file mode 100644 index dfe6556..0000000 --- a/src/Model/ProductData.php +++ /dev/null @@ -1,789 +0,0 @@ - '\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[]' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - 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 ]; - - /** - * 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 = [ - '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' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - 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' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - 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' ]; - - /** - * 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['metaData'] = isset($data['metaData']) ? $data['metaData'] : null; - $this->container['images'] = isset($data['images']) ? $data['images'] : 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['permalink'] = isset($data['permalink']) ? $data['permalink'] : null; - $this->container['downloads'] = isset($data['downloads']) ? $data['downloads'] : null; - $this->container['sku'] = isset($data['sku']) ? $data['sku'] : null; - $this->container['type'] = isset($data['type']) ? $data['type'] : null; - $this->container['status'] = isset($data['status']) ? $data['status'] : null; - $this->container['regularPrice'] = isset($data['regularPrice']) ? $data['regularPrice'] : null; - $this->container['price'] = isset($data['price']) ? $data['price'] : null; - $this->container['purchasable'] = isset($data['purchasable']) ? $data['purchasable'] : null; - $this->container['taxStatus'] = isset($data['taxStatus']) ? $data['taxStatus'] : null; - $this->container['taxClass'] = isset($data['taxClass']) ? $data['taxClass'] : null; - $this->container['categories'] = isset($data['categories']) ? $data['categories'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['metaData'] === null) { - $invalidProperties[] = "'metaData' can't be null"; - } - if ($this->container['images'] === null) { - $invalidProperties[] = "'images' can't be null"; - } - 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['permalink'] === null) { - $invalidProperties[] = "'permalink' can't be null"; - } - if ($this->container['downloads'] === null) { - $invalidProperties[] = "'downloads' can't be null"; - } - if ($this->container['sku'] === null) { - $invalidProperties[] = "'sku' can't be null"; - } - if ($this->container['type'] === null) { - $invalidProperties[] = "'type' can't be null"; - } - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['regularPrice'] === null) { - $invalidProperties[] = "'regularPrice' can't be null"; - } - if ($this->container['price'] === null) { - $invalidProperties[] = "'price' can't be null"; - } - if ($this->container['purchasable'] === null) { - $invalidProperties[] = "'purchasable' can't be null"; - } - if ($this->container['taxStatus'] === null) { - $invalidProperties[] = "'taxStatus' can't be null"; - } - if ($this->container['taxClass'] === null) { - $invalidProperties[] = "'taxClass' can't be null"; - } - if ($this->container['categories'] === null) { - $invalidProperties[] = "'categories' 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 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; - } - - /** - * Gets images - * - * @return \Yoast\MyYoastApiClient\Model\ProductImage[] - */ - public function getImages() - { - return $this->container['images']; - } - - /** - * Sets images - * - * @param \Yoast\MyYoastApiClient\Model\ProductImage[] $images images - * - * @return $this - */ - public function setImages($images) - { - $this->container['images'] = $images; - - return $this; - } - - /** - * 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 permalink - * - * @return string - */ - public function getPermalink() - { - return $this->container['permalink']; - } - - /** - * Sets permalink - * - * @param string $permalink permalink - * - * @return $this - */ - public function setPermalink($permalink) - { - $this->container['permalink'] = $permalink; - - return $this; - } - - /** - * Gets downloads - * - * @return \Yoast\MyYoastApiClient\Model\ProductDownload[] - */ - public function getDownloads() - { - return $this->container['downloads']; - } - - /** - * Sets downloads - * - * @param \Yoast\MyYoastApiClient\Model\ProductDownload[] $downloads downloads - * - * @return $this - */ - public function setDownloads($downloads) - { - $this->container['downloads'] = $downloads; - - return $this; - } - - /** - * Gets sku - * - * @return string - */ - public function getSku() - { - return $this->container['sku']; - } - - /** - * Sets sku - * - * @param string $sku sku - * - * @return $this - */ - public function setSku($sku) - { - $this->container['sku'] = $sku; - - return $this; - } - - /** - * Gets type - * - * @return string - */ - public function getType() - { - return $this->container['type']; - } - - /** - * Sets type - * - * @param string $type type - * - * @return $this - */ - public function setType($type) - { - $this->container['type'] = $type; - - return $this; - } - - /** - * Gets status - * - * @return string - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param string $status status - * - * @return $this - */ - public function setStatus($status) - { - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets regularPrice - * - * @return string - */ - public function getRegularPrice() - { - return $this->container['regularPrice']; - } - - /** - * Sets regularPrice - * - * @param string $regularPrice regularPrice - * - * @return $this - */ - public function setRegularPrice($regularPrice) - { - $this->container['regularPrice'] = $regularPrice; - - return $this; - } - - /** - * Gets price - * - * @return string - */ - public function getPrice() - { - return $this->container['price']; - } - - /** - * Sets price - * - * @param string $price price - * - * @return $this - */ - public function setPrice($price) - { - $this->container['price'] = $price; - - return $this; - } - - /** - * Gets purchasable - * - * @return bool - */ - public function getPurchasable() - { - return $this->container['purchasable']; - } - - /** - * Sets purchasable - * - * @param bool $purchasable purchasable - * - * @return $this - */ - public function setPurchasable($purchasable) - { - $this->container['purchasable'] = $purchasable; - - 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 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 categories - * - * @return \Yoast\MyYoastApiClient\Model\ProductCategory[] - */ - public function getCategories() - { - return $this->container['categories']; - } - - /** - * Sets categories - * - * @param \Yoast\MyYoastApiClient\Model\ProductCategory[] $categories categories - * - * @return $this - */ - public function setCategories($categories) - { - $this->container['categories'] = $categories; - - 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/ProductDownload.php b/src/Model/ProductDownload.php deleted file mode 100644 index d1d9bd3..0000000 --- a/src/Model/ProductDownload.php +++ /dev/null @@ -1,360 +0,0 @@ - 'string', -'name' => 'string', -'file' => 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'id' => null, -'name' => null, -'file' => 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', -'file' => 'file' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'id' => 'setId', -'name' => 'setName', -'file' => 'setFile' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'id' => 'getId', -'name' => 'getName', -'file' => 'getFile' ]; - - /** - * 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['file'] = isset($data['file']) ? $data['file'] : 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['file'] === null) { - $invalidProperties[] = "'file' 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 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 file - * - * @return string - */ - public function getFile() - { - return $this->container['file']; - } - - /** - * Sets file - * - * @param string $file file - * - * @return $this - */ - public function setFile($file) - { - $this->container['file'] = $file; - - 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/ProductFromWooDto.php b/src/Model/ProductFromWooDto.php deleted file mode 100644 index 8bab771..0000000 --- a/src/Model/ProductFromWooDto.php +++ /dev/null @@ -1,327 +0,0 @@ - '\Yoast\MyYoastApiClient\Model\ProductData', -'extraData' => '\Yoast\MyYoastApiClient\Model\ExtraProductData' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'productData' => null, -'extraData' => 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 = [ - 'productData' => 'productData', -'extraData' => 'extraData' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'productData' => 'setProductData', -'extraData' => 'setExtraData' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'productData' => 'getProductData', -'extraData' => 'getExtraData' ]; - - /** - * 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['productData'] = isset($data['productData']) ? $data['productData'] : null; - $this->container['extraData'] = isset($data['extraData']) ? $data['extraData'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['productData'] === null) { - $invalidProperties[] = "'productData' can't be null"; - } - if ($this->container['extraData'] === null) { - $invalidProperties[] = "'extraData' 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 productData - * - * @return \Yoast\MyYoastApiClient\Model\ProductData - */ - public function getProductData() - { - return $this->container['productData']; - } - - /** - * Sets productData - * - * @param \Yoast\MyYoastApiClient\Model\ProductData $productData productData - * - * @return $this - */ - public function setProductData($productData) - { - $this->container['productData'] = $productData; - - return $this; - } - - /** - * Gets extraData - * - * @return \Yoast\MyYoastApiClient\Model\ExtraProductData - */ - public function getExtraData() - { - return $this->container['extraData']; - } - - /** - * Sets extraData - * - * @param \Yoast\MyYoastApiClient\Model\ExtraProductData $extraData extraData - * - * @return $this - */ - public function setExtraData($extraData) - { - $this->container['extraData'] = $extraData; - - 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/ProductGroup.php b/src/Model/ProductGroup.php deleted file mode 100644 index 0c3a495..0000000 --- a/src/Model/ProductGroup.php +++ /dev/null @@ -1,690 +0,0 @@ - 'string', -'updatedAt' => '\DateTime', -'createdAt' => '\DateTime', -'name' => 'string', -'slug' => 'string', -'description' => 'string', -'icon' => 'string', -'svgIcon' => 'string', -'changelog' => 'string', -'version' => 'string', -'downloadUrl' => 'string', -'courseId' => 'string', -'parentId' => 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'id' => 'uuid', -'updatedAt' => 'date-time', -'createdAt' => 'date-time', -'name' => null, -'slug' => null, -'description' => null, -'icon' => null, -'svgIcon' => null, -'changelog' => null, -'version' => null, -'downloadUrl' => null, -'courseId' => 'uuid', -'parentId' => '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', -'name' => 'name', -'slug' => 'slug', -'description' => 'description', -'icon' => 'icon', -'svgIcon' => 'svgIcon', -'changelog' => 'changelog', -'version' => 'version', -'downloadUrl' => 'downloadUrl', -'courseId' => 'courseId', -'parentId' => 'parentId' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'id' => 'setId', -'updatedAt' => 'setUpdatedAt', -'createdAt' => 'setCreatedAt', -'name' => 'setName', -'slug' => 'setSlug', -'description' => 'setDescription', -'icon' => 'setIcon', -'svgIcon' => 'setSvgIcon', -'changelog' => 'setChangelog', -'version' => 'setVersion', -'downloadUrl' => 'setDownloadUrl', -'courseId' => 'setCourseId', -'parentId' => 'setParentId' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'id' => 'getId', -'updatedAt' => 'getUpdatedAt', -'createdAt' => 'getCreatedAt', -'name' => 'getName', -'slug' => 'getSlug', -'description' => 'getDescription', -'icon' => 'getIcon', -'svgIcon' => 'getSvgIcon', -'changelog' => 'getChangelog', -'version' => 'getVersion', -'downloadUrl' => 'getDownloadUrl', -'courseId' => 'getCourseId', -'parentId' => 'getParentId' ]; - - /** - * 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['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['slug'] = isset($data['slug']) ? $data['slug'] : null; - $this->container['description'] = isset($data['description']) ? $data['description'] : null; - $this->container['icon'] = isset($data['icon']) ? $data['icon'] : null; - $this->container['svgIcon'] = isset($data['svgIcon']) ? $data['svgIcon'] : null; - $this->container['changelog'] = isset($data['changelog']) ? $data['changelog'] : null; - $this->container['version'] = isset($data['version']) ? $data['version'] : null; - $this->container['downloadUrl'] = isset($data['downloadUrl']) ? $data['downloadUrl'] : null; - $this->container['courseId'] = isset($data['courseId']) ? $data['courseId'] : null; - $this->container['parentId'] = isset($data['parentId']) ? $data['parentId'] : 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['name'] === null) { - $invalidProperties[] = "'name' can't be null"; - } - if ($this->container['slug'] === null) { - $invalidProperties[] = "'slug' can't be null"; - } - if ($this->container['description'] === null) { - $invalidProperties[] = "'description' can't be null"; - } - if ($this->container['icon'] === null) { - $invalidProperties[] = "'icon' can't be null"; - } - if ($this->container['svgIcon'] === null) { - $invalidProperties[] = "'svgIcon' can't be null"; - } - if ($this->container['changelog'] === null) { - $invalidProperties[] = "'changelog' can't be null"; - } - if ($this->container['version'] === null) { - $invalidProperties[] = "'version' can't be null"; - } - if ($this->container['downloadUrl'] === null) { - $invalidProperties[] = "'downloadUrl' can't be null"; - } - if ($this->container['courseId'] === null) { - $invalidProperties[] = "'courseId' can't be null"; - } - if ($this->container['parentId'] === null) { - $invalidProperties[] = "'parentId' 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 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 slug - * - * @return string - */ - public function getSlug() - { - return $this->container['slug']; - } - - /** - * Sets slug - * - * @param string $slug slug - * - * @return $this - */ - public function setSlug($slug) - { - $this->container['slug'] = $slug; - - 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 icon - * - * @return string - */ - public function getIcon() - { - return $this->container['icon']; - } - - /** - * Sets icon - * - * @param string $icon icon - * - * @return $this - */ - public function setIcon($icon) - { - $this->container['icon'] = $icon; - - return $this; - } - - /** - * Gets svgIcon - * - * @return string - */ - public function getSvgIcon() - { - return $this->container['svgIcon']; - } - - /** - * Sets svgIcon - * - * @param string $svgIcon svgIcon - * - * @return $this - */ - public function setSvgIcon($svgIcon) - { - $this->container['svgIcon'] = $svgIcon; - - return $this; - } - - /** - * Gets changelog - * - * @return string - */ - public function getChangelog() - { - return $this->container['changelog']; - } - - /** - * Sets changelog - * - * @param string $changelog changelog - * - * @return $this - */ - public function setChangelog($changelog) - { - $this->container['changelog'] = $changelog; - - return $this; - } - - /** - * Gets version - * - * @return string - */ - public function getVersion() - { - return $this->container['version']; - } - - /** - * Sets version - * - * @param string $version version - * - * @return $this - */ - public function setVersion($version) - { - $this->container['version'] = $version; - - return $this; - } - - /** - * Gets downloadUrl - * - * @return string - */ - public function getDownloadUrl() - { - return $this->container['downloadUrl']; - } - - /** - * Sets downloadUrl - * - * @param string $downloadUrl downloadUrl - * - * @return $this - */ - public function setDownloadUrl($downloadUrl) - { - $this->container['downloadUrl'] = $downloadUrl; - - return $this; - } - - /** - * Gets courseId - * - * @return string - */ - public function getCourseId() - { - return $this->container['courseId']; - } - - /** - * Sets courseId - * - * @param string $courseId courseId - * - * @return $this - */ - public function setCourseId($courseId) - { - $this->container['courseId'] = $courseId; - - return $this; - } - - /** - * Gets parentId - * - * @return string - */ - public function getParentId() - { - return $this->container['parentId']; - } - - /** - * Sets parentId - * - * @param string $parentId parentId - * - * @return $this - */ - public function setParentId($parentId) - { - $this->container['parentId'] = $parentId; - - 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/ProductGroupExtraData.php b/src/Model/ProductGroupExtraData.php deleted file mode 100644 index 8c66f0c..0000000 --- a/src/Model/ProductGroupExtraData.php +++ /dev/null @@ -1,360 +0,0 @@ - 'string', -'icon' => 'string', -'changelog' => 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'parentSlug' => null, -'icon' => null, -'changelog' => 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 = [ - 'parentSlug' => 'parent_slug', -'icon' => 'icon', -'changelog' => 'changelog' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'parentSlug' => 'setParentSlug', -'icon' => 'setIcon', -'changelog' => 'setChangelog' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'parentSlug' => 'getParentSlug', -'icon' => 'getIcon', -'changelog' => 'getChangelog' ]; - - /** - * 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['parentSlug'] = isset($data['parentSlug']) ? $data['parentSlug'] : null; - $this->container['icon'] = isset($data['icon']) ? $data['icon'] : null; - $this->container['changelog'] = isset($data['changelog']) ? $data['changelog'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['parentSlug'] === null) { - $invalidProperties[] = "'parentSlug' can't be null"; - } - if ($this->container['icon'] === null) { - $invalidProperties[] = "'icon' can't be null"; - } - if ($this->container['changelog'] === null) { - $invalidProperties[] = "'changelog' 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 parentSlug - * - * @return string - */ - public function getParentSlug() - { - return $this->container['parentSlug']; - } - - /** - * Sets parentSlug - * - * @param string $parentSlug parentSlug - * - * @return $this - */ - public function setParentSlug($parentSlug) - { - $this->container['parentSlug'] = $parentSlug; - - return $this; - } - - /** - * Gets icon - * - * @return string - */ - public function getIcon() - { - return $this->container['icon']; - } - - /** - * Sets icon - * - * @param string $icon icon - * - * @return $this - */ - public function setIcon($icon) - { - $this->container['icon'] = $icon; - - return $this; - } - - /** - * Gets changelog - * - * @return string - */ - public function getChangelog() - { - return $this->container['changelog']; - } - - /** - * Sets changelog - * - * @param string $changelog changelog - * - * @return $this - */ - public function setChangelog($changelog) - { - $this->container['changelog'] = $changelog; - - 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/ProductGroupFromWooDto.php b/src/Model/ProductGroupFromWooDto.php deleted file mode 100644 index e1df722..0000000 --- a/src/Model/ProductGroupFromWooDto.php +++ /dev/null @@ -1,360 +0,0 @@ - '\Yoast\MyYoastApiClient\Model\ProductGroupTerm', -'productGroupMeta' => '\Yoast\MyYoastApiClient\Model\ProductGroupMeta', -'extraData' => '\Yoast\MyYoastApiClient\Model\ProductGroupExtraData' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'productGroupTerm' => null, -'productGroupMeta' => null, -'extraData' => 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 = [ - 'productGroupTerm' => 'productGroupTerm', -'productGroupMeta' => 'productGroupMeta', -'extraData' => 'extraData' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'productGroupTerm' => 'setProductGroupTerm', -'productGroupMeta' => 'setProductGroupMeta', -'extraData' => 'setExtraData' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'productGroupTerm' => 'getProductGroupTerm', -'productGroupMeta' => 'getProductGroupMeta', -'extraData' => 'getExtraData' ]; - - /** - * 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['productGroupTerm'] = isset($data['productGroupTerm']) ? $data['productGroupTerm'] : null; - $this->container['productGroupMeta'] = isset($data['productGroupMeta']) ? $data['productGroupMeta'] : null; - $this->container['extraData'] = isset($data['extraData']) ? $data['extraData'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['productGroupTerm'] === null) { - $invalidProperties[] = "'productGroupTerm' can't be null"; - } - if ($this->container['productGroupMeta'] === null) { - $invalidProperties[] = "'productGroupMeta' can't be null"; - } - if ($this->container['extraData'] === null) { - $invalidProperties[] = "'extraData' 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 productGroupTerm - * - * @return \Yoast\MyYoastApiClient\Model\ProductGroupTerm - */ - public function getProductGroupTerm() - { - return $this->container['productGroupTerm']; - } - - /** - * Sets productGroupTerm - * - * @param \Yoast\MyYoastApiClient\Model\ProductGroupTerm $productGroupTerm productGroupTerm - * - * @return $this - */ - public function setProductGroupTerm($productGroupTerm) - { - $this->container['productGroupTerm'] = $productGroupTerm; - - return $this; - } - - /** - * Gets productGroupMeta - * - * @return \Yoast\MyYoastApiClient\Model\ProductGroupMeta - */ - public function getProductGroupMeta() - { - return $this->container['productGroupMeta']; - } - - /** - * Sets productGroupMeta - * - * @param \Yoast\MyYoastApiClient\Model\ProductGroupMeta $productGroupMeta productGroupMeta - * - * @return $this - */ - public function setProductGroupMeta($productGroupMeta) - { - $this->container['productGroupMeta'] = $productGroupMeta; - - return $this; - } - - /** - * Gets extraData - * - * @return \Yoast\MyYoastApiClient\Model\ProductGroupExtraData - */ - public function getExtraData() - { - return $this->container['extraData']; - } - - /** - * Sets extraData - * - * @param \Yoast\MyYoastApiClient\Model\ProductGroupExtraData $extraData extraData - * - * @return $this - */ - public function setExtraData($extraData) - { - $this->container['extraData'] = $extraData; - - 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/ProductGroupMeta.php b/src/Model/ProductGroupMeta.php deleted file mode 100644 index 9ae61e3..0000000 --- a/src/Model/ProductGroupMeta.php +++ /dev/null @@ -1,360 +0,0 @@ - 'string', -'svgIcon' => 'string', -'version' => 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'courseId' => null, -'svgIcon' => null, -'version' => 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 = [ - 'courseId' => 'course_id', -'svgIcon' => 'svg_icon', -'version' => 'version' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'courseId' => 'setCourseId', -'svgIcon' => 'setSvgIcon', -'version' => 'setVersion' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'courseId' => 'getCourseId', -'svgIcon' => 'getSvgIcon', -'version' => 'getVersion' ]; - - /** - * 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['courseId'] = isset($data['courseId']) ? $data['courseId'] : null; - $this->container['svgIcon'] = isset($data['svgIcon']) ? $data['svgIcon'] : null; - $this->container['version'] = isset($data['version']) ? $data['version'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['courseId'] === null) { - $invalidProperties[] = "'courseId' can't be null"; - } - if ($this->container['svgIcon'] === null) { - $invalidProperties[] = "'svgIcon' can't be null"; - } - if ($this->container['version'] === null) { - $invalidProperties[] = "'version' 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 courseId - * - * @return string - */ - public function getCourseId() - { - return $this->container['courseId']; - } - - /** - * Sets courseId - * - * @param string $courseId courseId - * - * @return $this - */ - public function setCourseId($courseId) - { - $this->container['courseId'] = $courseId; - - return $this; - } - - /** - * Gets svgIcon - * - * @return string - */ - public function getSvgIcon() - { - return $this->container['svgIcon']; - } - - /** - * Sets svgIcon - * - * @param string $svgIcon svgIcon - * - * @return $this - */ - public function setSvgIcon($svgIcon) - { - $this->container['svgIcon'] = $svgIcon; - - return $this; - } - - /** - * Gets version - * - * @return string - */ - public function getVersion() - { - return $this->container['version']; - } - - /** - * Sets version - * - * @param string $version version - * - * @return $this - */ - public function setVersion($version) - { - $this->container['version'] = $version; - - 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/ProductGroupTerm.php b/src/Model/ProductGroupTerm.php deleted file mode 100644 index 9b6510a..0000000 --- a/src/Model/ProductGroupTerm.php +++ /dev/null @@ -1,360 +0,0 @@ - 'string', -'slug' => 'string', -'description' => 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'name' => null, -'slug' => null, -'description' => 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 = [ - 'name' => 'name', -'slug' => 'slug', -'description' => 'description' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'name' => 'setName', -'slug' => 'setSlug', -'description' => 'setDescription' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'name' => 'getName', -'slug' => 'getSlug', -'description' => 'getDescription' ]; - - /** - * 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['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['slug'] = isset($data['slug']) ? $data['slug'] : null; - $this->container['description'] = isset($data['description']) ? $data['description'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['name'] === null) { - $invalidProperties[] = "'name' can't be null"; - } - if ($this->container['slug'] === null) { - $invalidProperties[] = "'slug' can't be null"; - } - if ($this->container['description'] === null) { - $invalidProperties[] = "'description' 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 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 slug - * - * @return string - */ - public function getSlug() - { - return $this->container['slug']; - } - - /** - * Sets slug - * - * @param string $slug slug - * - * @return $this - */ - public function setSlug($slug) - { - $this->container['slug'] = $slug; - - 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; - } - /** - * 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/ProductImage.php b/src/Model/ProductImage.php deleted file mode 100644 index 5e8e162..0000000 --- a/src/Model/ProductImage.php +++ /dev/null @@ -1,558 +0,0 @@ - '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 - * - * @var string[] - */ - 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 ]; - - /** - * 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', -'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) - * - * @var string[] - */ - protected static $setters = [ - 'id' => 'setId', -'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) - * - * @var string[] - */ - protected static $getters = [ - 'id' => 'getId', -'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, - * 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['dateCreated'] = isset($data['dateCreated']) ? $data['dateCreated'] : null; - $this->container['dateCreatedGmt'] = isset($data['dateCreatedGmt']) ? $data['dateCreatedGmt'] : null; - $this->container['dateModified'] = isset($data['dateModified']) ? $data['dateModified'] : null; - $this->container['dateModifiedGmt'] = isset($data['dateModifiedGmt']) ? $data['dateModifiedGmt'] : null; - $this->container['src'] = isset($data['src']) ? $data['src'] : null; - $this->container['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['alt'] = isset($data['alt']) ? $data['alt'] : null; - $this->container['position'] = isset($data['position']) ? $data['position'] : 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['dateCreated'] === null) { - $invalidProperties[] = "'dateCreated' can't be null"; - } - if ($this->container['dateCreatedGmt'] === null) { - $invalidProperties[] = "'dateCreatedGmt' can't be null"; - } - if ($this->container['dateModified'] === null) { - $invalidProperties[] = "'dateModified' can't be null"; - } - if ($this->container['dateModifiedGmt'] === null) { - $invalidProperties[] = "'dateModifiedGmt' can't be null"; - } - if ($this->container['src'] === null) { - $invalidProperties[] = "'src' can't be null"; - } - if ($this->container['name'] === null) { - $invalidProperties[] = "'name' can't be null"; - } - if ($this->container['alt'] === null) { - $invalidProperties[] = "'alt' can't be null"; - } - if ($this->container['position'] === null) { - $invalidProperties[] = "'position' 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 dateCreated - * - * @return \DateTime - */ - public function getDateCreated() - { - return $this->container['dateCreated']; - } - - /** - * Sets dateCreated - * - * @param \DateTime $dateCreated dateCreated - * - * @return $this - */ - public function setDateCreated($dateCreated) - { - $this->container['dateCreated'] = $dateCreated; - - return $this; - } - - /** - * Gets dateCreatedGmt - * - * @return \DateTime - */ - public function getDateCreatedGmt() - { - return $this->container['dateCreatedGmt']; - } - - /** - * Sets dateCreatedGmt - * - * @param \DateTime $dateCreatedGmt dateCreatedGmt - * - * @return $this - */ - public function setDateCreatedGmt($dateCreatedGmt) - { - $this->container['dateCreatedGmt'] = $dateCreatedGmt; - - return $this; - } - - /** - * Gets dateModified - * - * @return \DateTime - */ - public function getDateModified() - { - return $this->container['dateModified']; - } - - /** - * Sets dateModified - * - * @param \DateTime $dateModified dateModified - * - * @return $this - */ - public function setDateModified($dateModified) - { - $this->container['dateModified'] = $dateModified; - - return $this; - } - - /** - * Gets dateModifiedGmt - * - * @return \DateTime - */ - public function getDateModifiedGmt() - { - return $this->container['dateModifiedGmt']; - } - - /** - * Sets dateModifiedGmt - * - * @param \DateTime $dateModifiedGmt dateModifiedGmt - * - * @return $this - */ - public function setDateModifiedGmt($dateModifiedGmt) - { - $this->container['dateModifiedGmt'] = $dateModifiedGmt; - - return $this; - } - - /** - * Gets src - * - * @return string - */ - public function getSrc() - { - return $this->container['src']; - } - - /** - * Sets src - * - * @param string $src src - * - * @return $this - */ - public function setSrc($src) - { - $this->container['src'] = $src; - - 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 alt - * - * @return string - */ - public function getAlt() - { - return $this->container['alt']; - } - - /** - * Sets alt - * - * @param string $alt alt - * - * @return $this - */ - public function setAlt($alt) - { - $this->container['alt'] = $alt; - - return $this; - } - - /** - * Gets position - * - * @return int - */ - public function getPosition() - { - return $this->container['position']; - } - - /** - * Sets position - * - * @param int $position position - * - * @return $this - */ - public function setPosition($position) - { - $this->container['position'] = $position; - - 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/ProgressData.php b/src/Model/ProgressData.php deleted file mode 100644 index 33cb531..0000000 --- a/src/Model/ProgressData.php +++ /dev/null @@ -1,492 +0,0 @@ - 'string', -'progress' => 'int', -'outsideTrialProgress' => 'bool', -'studentId' => 'int', -'courseId' => 'int', -'isTrial' => 'bool', -'trialCompleted' => 'bool' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'status' => null, -'progress' => null, -'outsideTrialProgress' => null, -'studentId' => null, -'courseId' => null, -'isTrial' => null, -'trialCompleted' => 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 = [ - 'status' => 'status', -'progress' => 'progress', -'outsideTrialProgress' => 'outsideTrialProgress', -'studentId' => 'studentId', -'courseId' => 'courseId', -'isTrial' => 'isTrial', -'trialCompleted' => 'trialCompleted' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', -'progress' => 'setProgress', -'outsideTrialProgress' => 'setOutsideTrialProgress', -'studentId' => 'setStudentId', -'courseId' => 'setCourseId', -'isTrial' => 'setIsTrial', -'trialCompleted' => 'setTrialCompleted' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', -'progress' => 'getProgress', -'outsideTrialProgress' => 'getOutsideTrialProgress', -'studentId' => 'getStudentId', -'courseId' => 'getCourseId', -'isTrial' => 'getIsTrial', -'trialCompleted' => 'getTrialCompleted' ]; - - /** - * 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['status'] = isset($data['status']) ? $data['status'] : null; - $this->container['progress'] = isset($data['progress']) ? $data['progress'] : null; - $this->container['outsideTrialProgress'] = isset($data['outsideTrialProgress']) ? $data['outsideTrialProgress'] : null; - $this->container['studentId'] = isset($data['studentId']) ? $data['studentId'] : null; - $this->container['courseId'] = isset($data['courseId']) ? $data['courseId'] : null; - $this->container['isTrial'] = isset($data['isTrial']) ? $data['isTrial'] : null; - $this->container['trialCompleted'] = isset($data['trialCompleted']) ? $data['trialCompleted'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['progress'] === null) { - $invalidProperties[] = "'progress' can't be null"; - } - if ($this->container['outsideTrialProgress'] === null) { - $invalidProperties[] = "'outsideTrialProgress' can't be null"; - } - if ($this->container['studentId'] === null) { - $invalidProperties[] = "'studentId' can't be null"; - } - if ($this->container['courseId'] === null) { - $invalidProperties[] = "'courseId' can't be null"; - } - if ($this->container['isTrial'] === null) { - $invalidProperties[] = "'isTrial' can't be null"; - } - if ($this->container['trialCompleted'] === null) { - $invalidProperties[] = "'trialCompleted' 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 status - * - * @return string - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param string $status status - * - * @return $this - */ - public function setStatus($status) - { - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets progress - * - * @return int - */ - public function getProgress() - { - return $this->container['progress']; - } - - /** - * Sets progress - * - * @param int $progress progress - * - * @return $this - */ - public function setProgress($progress) - { - $this->container['progress'] = $progress; - - return $this; - } - - /** - * Gets outsideTrialProgress - * - * @return bool - */ - public function getOutsideTrialProgress() - { - return $this->container['outsideTrialProgress']; - } - - /** - * Sets outsideTrialProgress - * - * @param bool $outsideTrialProgress outsideTrialProgress - * - * @return $this - */ - public function setOutsideTrialProgress($outsideTrialProgress) - { - $this->container['outsideTrialProgress'] = $outsideTrialProgress; - - return $this; - } - - /** - * Gets studentId - * - * @return int - */ - public function getStudentId() - { - return $this->container['studentId']; - } - - /** - * Sets studentId - * - * @param int $studentId studentId - * - * @return $this - */ - public function setStudentId($studentId) - { - $this->container['studentId'] = $studentId; - - return $this; - } - - /** - * Gets courseId - * - * @return int - */ - public function getCourseId() - { - return $this->container['courseId']; - } - - /** - * Sets courseId - * - * @param int $courseId courseId - * - * @return $this - */ - public function setCourseId($courseId) - { - $this->container['courseId'] = $courseId; - - return $this; - } - - /** - * Gets isTrial - * - * @return bool - */ - public function getIsTrial() - { - return $this->container['isTrial']; - } - - /** - * Sets isTrial - * - * @param bool $isTrial isTrial - * - * @return $this - */ - public function setIsTrial($isTrial) - { - $this->container['isTrial'] = $isTrial; - - return $this; - } - - /** - * Gets trialCompleted - * - * @return bool - */ - public function getTrialCompleted() - { - return $this->container['trialCompleted']; - } - - /** - * Sets trialCompleted - * - * @param bool $trialCompleted trialCompleted - * - * @return $this - */ - public function setTrialCompleted($trialCompleted) - { - $this->container['trialCompleted'] = $trialCompleted; - - 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/ProvisionerData.php b/src/Model/ProvisionerData.php deleted file mode 100644 index dae3b50..0000000 --- a/src/Model/ProvisionerData.php +++ /dev/null @@ -1,393 +0,0 @@ - '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 deleted file mode 100644 index 4b4f5d6..0000000 --- a/src/Model/PurgeKVRequestDto.php +++ /dev/null @@ -1,291 +0,0 @@ - 'int' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'limit' => 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 = [ - 'limit' => 'limit' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'limit' => 'setLimit' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'limit' => 'getLimit' ]; - - /** - * 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['limit'] = isset($data['limit']) ? $data['limit'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets limit - * - * @return int - */ - public function getLimit() - { - return $this->container['limit']; - } - - /** - * Sets limit - * - * @param int $limit limit - * - * @return $this - */ - public function setLimit($limit) - { - $this->container['limit'] = $limit; - - 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/Refund.php b/src/Model/Refund.php deleted file mode 100644 index 624550a..0000000 --- a/src/Model/Refund.php +++ /dev/null @@ -1,558 +0,0 @@ - '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 - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'id' => null, -'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 - * - * @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', -'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) - * - * @var string[] - */ - protected static $setters = [ - 'id' => 'setId', -'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) - * - * @var string[] - */ - protected static $getters = [ - 'id' => 'getId', -'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, - * 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['amount'] = isset($data['amount']) ? $data['amount'] : null; - $this->container['date'] = isset($data['date']) ? $data['date'] : null; - $this->container['modifiedAt'] = isset($data['modifiedAt']) ? $data['modifiedAt'] : null; - $this->container['reason'] = isset($data['reason']) ? $data['reason'] : null; - $this->container['sourceId'] = isset($data['sourceId']) ? $data['sourceId'] : null; - $this->container['sourceShopId'] = isset($data['sourceShopId']) ? $data['sourceShopId'] : null; - $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null; - $this->container['orderId'] = isset($data['orderId']) ? $data['orderId'] : 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['amount'] === null) { - $invalidProperties[] = "'amount' can't be null"; - } - if ($this->container['date'] === null) { - $invalidProperties[] = "'date' can't be null"; - } - if ($this->container['modifiedAt'] === null) { - $invalidProperties[] = "'modifiedAt' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['sourceId'] === null) { - $invalidProperties[] = "'sourceId' can't be null"; - } - if ($this->container['sourceShopId'] === null) { - $invalidProperties[] = "'sourceShopId' can't be null"; - } - if ($this->container['createdAt'] === null) { - $invalidProperties[] = "'createdAt' can't be null"; - } - if ($this->container['orderId'] === null) { - $invalidProperties[] = "'orderId' 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 amount - * - * @return int - */ - public function getAmount() - { - return $this->container['amount']; - } - - /** - * Sets amount - * - * @param int $amount amount - * - * @return $this - */ - public function setAmount($amount) - { - $this->container['amount'] = $amount; - - return $this; - } - - /** - * Gets date - * - * @return \DateTime - */ - public function getDate() - { - return $this->container['date']; - } - - /** - * Sets date - * - * @param \DateTime $date date - * - * @return $this - */ - public function setDate($date) - { - $this->container['date'] = $date; - - 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 reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return $this - */ - public function setReason($reason) - { - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets sourceId - * - * @return int - */ - public function getSourceId() - { - return $this->container['sourceId']; - } - - /** - * Sets sourceId - * - * @param int $sourceId sourceId - * - * @return $this - */ - public function setSourceId($sourceId) - { - $this->container['sourceId'] = $sourceId; - - return $this; - } - - /** - * Gets sourceShopId - * - * @return int - */ - public function getSourceShopId() - { - return $this->container['sourceShopId']; - } - - /** - * Sets sourceShopId - * - * @param int $sourceShopId sourceShopId - * - * @return $this - */ - public function setSourceShopId($sourceShopId) - { - $this->container['sourceShopId'] = $sourceShopId; - - 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 orderId - * - * @return string - */ - public function getOrderId() - { - return $this->container['orderId']; - } - - /** - * Sets orderId - * - * @param string $orderId orderId - * - * @return $this - */ - public function setOrderId($orderId) - { - $this->container['orderId'] = $orderId; - - 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/RefundDataDto.php b/src/Model/RefundDataDto.php deleted file mode 100644 index edab71b..0000000 --- a/src/Model/RefundDataDto.php +++ /dev/null @@ -1,657 +0,0 @@ - 'int', -'dateCreated' => '\DateTime', -'dateCreatedGmt' => '\DateTime', -'amount' => 'string', -'reason' => 'string', -'refundedBy' => 'int', -'refundedPayment' => 'bool', -'metaData' => '\Yoast\MyYoastApiClient\Model\MetaDataDto[]', -'lineItems' => '\Yoast\MyYoastApiClient\Model\LineItemDto[]', -'shippingLines' => 'string[]', -'taxLines' => 'array[]', -'feeLines' => 'string[]' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'id' => null, -'dateCreated' => 'date-time', -'dateCreatedGmt' => 'date-time', -'amount' => null, -'reason' => null, -'refundedBy' => null, -'refundedPayment' => null, -'metaData' => null, -'lineItems' => null, -'shippingLines' => null, -'taxLines' => null, -'feeLines' => 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', -'dateCreated' => 'date_created', -'dateCreatedGmt' => 'date_created_gmt', -'amount' => 'amount', -'reason' => 'reason', -'refundedBy' => 'refunded_by', -'refundedPayment' => 'refunded_payment', -'metaData' => 'meta_data', -'lineItems' => 'line_items', -'shippingLines' => 'shipping_lines', -'taxLines' => 'tax_lines', -'feeLines' => 'fee_lines' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'id' => 'setId', -'dateCreated' => 'setDateCreated', -'dateCreatedGmt' => 'setDateCreatedGmt', -'amount' => 'setAmount', -'reason' => 'setReason', -'refundedBy' => 'setRefundedBy', -'refundedPayment' => 'setRefundedPayment', -'metaData' => 'setMetaData', -'lineItems' => 'setLineItems', -'shippingLines' => 'setShippingLines', -'taxLines' => 'setTaxLines', -'feeLines' => 'setFeeLines' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'id' => 'getId', -'dateCreated' => 'getDateCreated', -'dateCreatedGmt' => 'getDateCreatedGmt', -'amount' => 'getAmount', -'reason' => 'getReason', -'refundedBy' => 'getRefundedBy', -'refundedPayment' => 'getRefundedPayment', -'metaData' => 'getMetaData', -'lineItems' => 'getLineItems', -'shippingLines' => 'getShippingLines', -'taxLines' => 'getTaxLines', -'feeLines' => 'getFeeLines' ]; - - /** - * 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['dateCreated'] = isset($data['dateCreated']) ? $data['dateCreated'] : null; - $this->container['dateCreatedGmt'] = isset($data['dateCreatedGmt']) ? $data['dateCreatedGmt'] : null; - $this->container['amount'] = isset($data['amount']) ? $data['amount'] : null; - $this->container['reason'] = isset($data['reason']) ? $data['reason'] : null; - $this->container['refundedBy'] = isset($data['refundedBy']) ? $data['refundedBy'] : null; - $this->container['refundedPayment'] = isset($data['refundedPayment']) ? $data['refundedPayment'] : null; - $this->container['metaData'] = isset($data['metaData']) ? $data['metaData'] : null; - $this->container['lineItems'] = isset($data['lineItems']) ? $data['lineItems'] : null; - $this->container['shippingLines'] = isset($data['shippingLines']) ? $data['shippingLines'] : null; - $this->container['taxLines'] = isset($data['taxLines']) ? $data['taxLines'] : null; - $this->container['feeLines'] = isset($data['feeLines']) ? $data['feeLines'] : 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['dateCreated'] === null) { - $invalidProperties[] = "'dateCreated' can't be null"; - } - if ($this->container['dateCreatedGmt'] === null) { - $invalidProperties[] = "'dateCreatedGmt' can't be null"; - } - if ($this->container['amount'] === null) { - $invalidProperties[] = "'amount' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['refundedBy'] === null) { - $invalidProperties[] = "'refundedBy' can't be null"; - } - if ($this->container['refundedPayment'] === null) { - $invalidProperties[] = "'refundedPayment' can't be null"; - } - if ($this->container['metaData'] === null) { - $invalidProperties[] = "'metaData' can't be null"; - } - if ($this->container['lineItems'] === null) { - $invalidProperties[] = "'lineItems' can't be null"; - } - if ($this->container['shippingLines'] === null) { - $invalidProperties[] = "'shippingLines' can't be null"; - } - if ($this->container['taxLines'] === null) { - $invalidProperties[] = "'taxLines' can't be null"; - } - if ($this->container['feeLines'] === null) { - $invalidProperties[] = "'feeLines' 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 dateCreated - * - * @return \DateTime - */ - public function getDateCreated() - { - return $this->container['dateCreated']; - } - - /** - * Sets dateCreated - * - * @param \DateTime $dateCreated dateCreated - * - * @return $this - */ - public function setDateCreated($dateCreated) - { - $this->container['dateCreated'] = $dateCreated; - - return $this; - } - - /** - * Gets dateCreatedGmt - * - * @return \DateTime - */ - public function getDateCreatedGmt() - { - return $this->container['dateCreatedGmt']; - } - - /** - * Sets dateCreatedGmt - * - * @param \DateTime $dateCreatedGmt dateCreatedGmt - * - * @return $this - */ - public function setDateCreatedGmt($dateCreatedGmt) - { - $this->container['dateCreatedGmt'] = $dateCreatedGmt; - - 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 reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return $this - */ - public function setReason($reason) - { - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets refundedBy - * - * @return int - */ - public function getRefundedBy() - { - return $this->container['refundedBy']; - } - - /** - * Sets refundedBy - * - * @param int $refundedBy refundedBy - * - * @return $this - */ - public function setRefundedBy($refundedBy) - { - $this->container['refundedBy'] = $refundedBy; - - return $this; - } - - /** - * Gets refundedPayment - * - * @return bool - */ - public function getRefundedPayment() - { - return $this->container['refundedPayment']; - } - - /** - * Sets refundedPayment - * - * @param bool $refundedPayment refundedPayment - * - * @return $this - */ - public function setRefundedPayment($refundedPayment) - { - $this->container['refundedPayment'] = $refundedPayment; - - 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; - } - - /** - * Gets lineItems - * - * @return \Yoast\MyYoastApiClient\Model\LineItemDto[] - */ - public function getLineItems() - { - return $this->container['lineItems']; - } - - /** - * Sets lineItems - * - * @param \Yoast\MyYoastApiClient\Model\LineItemDto[] $lineItems lineItems - * - * @return $this - */ - public function setLineItems($lineItems) - { - $this->container['lineItems'] = $lineItems; - - return $this; - } - - /** - * Gets shippingLines - * - * @return string[] - */ - public function getShippingLines() - { - return $this->container['shippingLines']; - } - - /** - * Sets shippingLines - * - * @param string[] $shippingLines shippingLines - * - * @return $this - */ - public function setShippingLines($shippingLines) - { - $this->container['shippingLines'] = $shippingLines; - - return $this; - } - - /** - * Gets taxLines - * - * @return array[] - */ - public function getTaxLines() - { - return $this->container['taxLines']; - } - - /** - * Sets taxLines - * - * @param array[] $taxLines taxLines - * - * @return $this - */ - public function setTaxLines($taxLines) - { - $this->container['taxLines'] = $taxLines; - - return $this; - } - - /** - * Gets feeLines - * - * @return string[] - */ - public function getFeeLines() - { - return $this->container['feeLines']; - } - - /** - * Sets feeLines - * - * @param string[] $feeLines feeLines - * - * @return $this - */ - public function setFeeLines($feeLines) - { - $this->container['feeLines'] = $feeLines; - - 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/RegenerateTokenResponseDto.php b/src/Model/RegenerateTokenResponseDto.php deleted file mode 100644 index ea88ba0..0000000 --- a/src/Model/RegenerateTokenResponseDto.php +++ /dev/null @@ -1,294 +0,0 @@ - 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'token' => 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 = [ - 'token' => 'token' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'token' => 'setToken' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'token' => 'getToken' ]; - - /** - * 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['token'] = isset($data['token']) ? $data['token'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['token'] === null) { - $invalidProperties[] = "'token' 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 token - * - * @return string - */ - public function getToken() - { - return $this->container['token']; - } - - /** - * Sets token - * - * @param string $token The newly generated token to authenticate with. Store this value somewhere safe! - * - * @return $this - */ - public function setToken($token) - { - $this->container['token'] = $token; - - 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/RenameBodyDto.php b/src/Model/RenameBodyDto.php deleted file mode 100644 index bd5ff0a..0000000 --- a/src/Model/RenameBodyDto.php +++ /dev/null @@ -1,294 +0,0 @@ - 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'name' => 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 = [ - 'name' => 'name' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'name' => 'setName' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'name' => 'getName' ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$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['name'] = isset($data['name']) ? $data['name'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['name'] === null) { - $invalidProperties[] = "'name' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets 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; - } - /** - * 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/ResetPasswordDto.php b/src/Model/ResetPasswordDto.php deleted file mode 100644 index ae605ff..0000000 --- a/src/Model/ResetPasswordDto.php +++ /dev/null @@ -1,393 +0,0 @@ - 'string', -'password1' => 'string', -'password2' => 'string', -'key' => 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'userLogin' => null, -'password1' => null, -'password2' => null, -'key' => 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 = [ - 'userLogin' => 'user_login', -'password1' => 'password1', -'password2' => 'password2', -'key' => 'key' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'userLogin' => 'setUserLogin', -'password1' => 'setPassword1', -'password2' => 'setPassword2', -'key' => 'setKey' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'userLogin' => 'getUserLogin', -'password1' => 'getPassword1', -'password2' => 'getPassword2', -'key' => 'getKey' ]; - - /** - * 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['userLogin'] = isset($data['userLogin']) ? $data['userLogin'] : null; - $this->container['password1'] = isset($data['password1']) ? $data['password1'] : null; - $this->container['password2'] = isset($data['password2']) ? $data['password2'] : null; - $this->container['key'] = isset($data['key']) ? $data['key'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['userLogin'] === null) { - $invalidProperties[] = "'userLogin' can't be null"; - } - if ($this->container['password1'] === null) { - $invalidProperties[] = "'password1' can't be null"; - } - if ($this->container['password2'] === null) { - $invalidProperties[] = "'password2' can't be null"; - } - if ($this->container['key'] === null) { - $invalidProperties[] = "'key' 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 userLogin - * - * @return string - */ - public function getUserLogin() - { - return $this->container['userLogin']; - } - - /** - * Sets userLogin - * - * @param string $userLogin userLogin - * - * @return $this - */ - public function setUserLogin($userLogin) - { - $this->container['userLogin'] = $userLogin; - - return $this; - } - - /** - * Gets password1 - * - * @return string - */ - public function getPassword1() - { - return $this->container['password1']; - } - - /** - * Sets password1 - * - * @param string $password1 password1 - * - * @return $this - */ - public function setPassword1($password1) - { - $this->container['password1'] = $password1; - - return $this; - } - - /** - * Gets password2 - * - * @return string - */ - public function getPassword2() - { - return $this->container['password2']; - } - - /** - * Sets password2 - * - * @param string $password2 password2 - * - * @return $this - */ - public function setPassword2($password2) - { - $this->container['password2'] = $password2; - - return $this; - } - - /** - * Gets key - * - * @return string - */ - public function getKey() - { - return $this->container['key']; - } - - /** - * Sets key - * - * @param string $key key - * - * @return $this - */ - public function setKey($key) - { - $this->container['key'] = $key; - - 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 deleted file mode 100644 index 98f70e5..0000000 --- a/src/Model/RoleIDDto.php +++ /dev/null @@ -1,294 +0,0 @@ - 'int' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'roleId' => 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 = [ - 'roleId' => 'roleId' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'roleId' => 'setRoleId' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'roleId' => 'getRoleId' ]; - - /** - * 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['roleId'] = isset($data['roleId']) ? $data['roleId'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['roleId'] === null) { - $invalidProperties[] = "'roleId' 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 roleId - * - * @return int - */ - public function getRoleId() - { - return $this->container['roleId']; - } - - /** - * Sets roleId - * - * @param int $roleId roleId - * - * @return $this - */ - public function setRoleId($roleId) - { - $this->container['roleId'] = $roleId; - - 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/ScheduleDeleteUserDto.php b/src/Model/ScheduleDeleteUserDto.php deleted file mode 100644 index 863e585..0000000 --- a/src/Model/ScheduleDeleteUserDto.php +++ /dev/null @@ -1,393 +0,0 @@ - 'string', -'identifier' => 'string', -'customerEmail' => 'string', -'deleteAt' => 'int' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'provisioner' => null, -'identifier' => null, -'customerEmail' => null, -'deleteAt' => 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 = [ - 'provisioner' => 'provisioner', -'identifier' => 'identifier', -'customerEmail' => 'customerEmail', -'deleteAt' => 'deleteAt' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'provisioner' => 'setProvisioner', -'identifier' => 'setIdentifier', -'customerEmail' => 'setCustomerEmail', -'deleteAt' => 'setDeleteAt' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'provisioner' => 'getProvisioner', -'identifier' => 'getIdentifier', -'customerEmail' => 'getCustomerEmail', -'deleteAt' => 'getDeleteAt' ]; - - /** - * 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['provisioner'] = isset($data['provisioner']) ? $data['provisioner'] : null; - $this->container['identifier'] = isset($data['identifier']) ? $data['identifier'] : null; - $this->container['customerEmail'] = isset($data['customerEmail']) ? $data['customerEmail'] : null; - $this->container['deleteAt'] = isset($data['deleteAt']) ? $data['deleteAt'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['provisioner'] === null) { - $invalidProperties[] = "'provisioner' can't be null"; - } - if ($this->container['identifier'] === null) { - $invalidProperties[] = "'identifier' can't be null"; - } - if ($this->container['customerEmail'] === null) { - $invalidProperties[] = "'customerEmail' can't be null"; - } - if ($this->container['deleteAt'] === null) { - $invalidProperties[] = "'deleteAt' 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 provisioner - * - * @return string - */ - public function getProvisioner() - { - return $this->container['provisioner']; - } - - /** - * Sets provisioner - * - * @param string $provisioner The name of the provisioner. - * - * @return $this - */ - public function setProvisioner($provisioner) - { - $this->container['provisioner'] = $provisioner; - - return $this; - } - - /** - * Gets identifier - * - * @return string - */ - public function getIdentifier() - { - return $this->container['identifier']; - } - - /** - * Sets identifier - * - * @param string $identifier An identifier of the resource to gdpr delete. - * - * @return $this - */ - public function setIdentifier($identifier) - { - $this->container['identifier'] = $identifier; - - return $this; - } - - /** - * 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 deleteAt - * - * @return int - */ - public function getDeleteAt() - { - return $this->container['deleteAt']; - } - - /** - * Sets deleteAt - * - * @param int $deleteAt UNIX Timestamp of the date when it should be deleted. - * - * @return $this - */ - public function setDeleteAt($deleteAt) - { - $this->container['deleteAt'] = $deleteAt; - - 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/SendResetPasswordEmailDto.php b/src/Model/SendResetPasswordEmailDto.php deleted file mode 100644 index 778f6aa..0000000 --- a/src/Model/SendResetPasswordEmailDto.php +++ /dev/null @@ -1,294 +0,0 @@ - '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/SetExpiryDateDto.php b/src/Model/SetExpiryDateDto.php deleted file mode 100644 index 386ecec..0000000 --- a/src/Model/SetExpiryDateDto.php +++ /dev/null @@ -1,327 +0,0 @@ - 'string', -'expiryDate' => '\DateTime' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'subscriptionId' => null, -'expiryDate' => '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 = [ - 'subscriptionId' => 'subscriptionId', -'expiryDate' => 'expiryDate' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'subscriptionId' => 'setSubscriptionId', -'expiryDate' => 'setExpiryDate' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'subscriptionId' => 'getSubscriptionId', -'expiryDate' => 'getExpiryDate' ]; - - /** - * 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['subscriptionId'] = isset($data['subscriptionId']) ? $data['subscriptionId'] : null; - $this->container['expiryDate'] = isset($data['expiryDate']) ? $data['expiryDate'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['subscriptionId'] === null) { - $invalidProperties[] = "'subscriptionId' can't be null"; - } - if ($this->container['expiryDate'] === null) { - $invalidProperties[] = "'expiryDate' 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 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; - } - - /** - * Gets expiryDate - * - * @return \DateTime - */ - public function getExpiryDate() - { - return $this->container['expiryDate']; - } - - /** - * Sets expiryDate - * - * @param \DateTime $expiryDate expiryDate - * - * @return $this - */ - public function setExpiryDate($expiryDate) - { - $this->container['expiryDate'] = $expiryDate; - - 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/SetProvisionedSiteDto.php b/src/Model/SetProvisionedSiteDto.php deleted file mode 100644 index b522e90..0000000 --- a/src/Model/SetProvisionedSiteDto.php +++ /dev/null @@ -1,294 +0,0 @@ - '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 deleted file mode 100644 index 1b35a89..0000000 --- a/src/Model/ShippingDto.php +++ /dev/null @@ -1,558 +0,0 @@ - '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 - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'address1' => 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 - * - * @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 = [ - 'address1' => 'address_1', -'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) - * - * @var string[] - */ - protected static $setters = [ - 'address1' => 'setAddress1', -'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) - * - * @var string[] - */ - protected static $getters = [ - 'address1' => 'getAddress1', -'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, - * 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['address1'] = isset($data['address1']) ? $data['address1'] : null; - $this->container['address2'] = isset($data['address2']) ? $data['address2'] : null; - $this->container['city'] = isset($data['city']) ? $data['city'] : null; - $this->container['company'] = isset($data['company']) ? $data['company'] : null; - $this->container['country'] = isset($data['country']) ? $data['country'] : null; - $this->container['firstName'] = isset($data['firstName']) ? $data['firstName'] : null; - $this->container['lastName'] = isset($data['lastName']) ? $data['lastName'] : null; - $this->container['postcode'] = isset($data['postcode']) ? $data['postcode'] : null; - $this->container['state'] = isset($data['state']) ? $data['state'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['address1'] === null) { - $invalidProperties[] = "'address1' can't be null"; - } - if ($this->container['address2'] === null) { - $invalidProperties[] = "'address2' can't be null"; - } - if ($this->container['city'] === null) { - $invalidProperties[] = "'city' can't be null"; - } - if ($this->container['company'] === null) { - $invalidProperties[] = "'company' can't be null"; - } - if ($this->container['country'] === null) { - $invalidProperties[] = "'country' 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"; - } - if ($this->container['postcode'] === null) { - $invalidProperties[] = "'postcode' can't be null"; - } - if ($this->container['state'] === null) { - $invalidProperties[] = "'state' 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 address1 - * - * @return string - */ - public function getAddress1() - { - return $this->container['address1']; - } - - /** - * Sets address1 - * - * @param string $address1 address1 - * - * @return $this - */ - public function setAddress1($address1) - { - $this->container['address1'] = $address1; - - return $this; - } - - /** - * Gets address2 - * - * @return string - */ - public function getAddress2() - { - return $this->container['address2']; - } - - /** - * Sets address2 - * - * @param string $address2 address2 - * - * @return $this - */ - public function setAddress2($address2) - { - $this->container['address2'] = $address2; - - return $this; - } - - /** - * Gets city - * - * @return string - */ - public function getCity() - { - return $this->container['city']; - } - - /** - * Sets city - * - * @param string $city city - * - * @return $this - */ - public function setCity($city) - { - $this->container['city'] = $city; - - return $this; - } - - /** - * Gets company - * - * @return string - */ - public function getCompany() - { - return $this->container['company']; - } - - /** - * Sets company - * - * @param string $company company - * - * @return $this - */ - public function setCompany($company) - { - $this->container['company'] = $company; - - return $this; - } - - /** - * Gets country - * - * @return string - */ - public function getCountry() - { - return $this->container['country']; - } - - /** - * Sets country - * - * @param string $country country - * - * @return $this - */ - public function setCountry($country) - { - $this->container['country'] = $country; - - return $this; - } - - /** - * Gets firstName - * - * @return string - */ - public function getFirstName() - { - return $this->container['firstName']; - } - - /** - * Sets firstName - * - * @param string $firstName firstName - * - * @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 lastName - * - * @return $this - */ - public function setLastName($lastName) - { - $this->container['lastName'] = $lastName; - - return $this; - } - - /** - * Gets postcode - * - * @return string - */ - public function getPostcode() - { - return $this->container['postcode']; - } - - /** - * Sets postcode - * - * @param string $postcode postcode - * - * @return $this - */ - public function setPostcode($postcode) - { - $this->container['postcode'] = $postcode; - - return $this; - } - - /** - * Gets state - * - * @return string - */ - public function getState() - { - return $this->container['state']; - } - - /** - * Sets state - * - * @param string $state state - * - * @return $this - */ - public function setState($state) - { - $this->container['state'] = $state; - - 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/SignupAccountDto.php b/src/Model/SignupAccountDto.php deleted file mode 100644 index 61f9fda..0000000 --- a/src/Model/SignupAccountDto.php +++ /dev/null @@ -1,360 +0,0 @@ - 'string', -'repeatPassword' => 'string', -'userEmail' => 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'password' => null, -'repeatPassword' => null, -'userEmail' => 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 = [ - 'password' => 'password', -'repeatPassword' => 'repeatPassword', -'userEmail' => 'userEmail' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'password' => 'setPassword', -'repeatPassword' => 'setRepeatPassword', -'userEmail' => 'setUserEmail' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'password' => 'getPassword', -'repeatPassword' => 'getRepeatPassword', -'userEmail' => 'getUserEmail' ]; - - /** - * 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['password'] = isset($data['password']) ? $data['password'] : null; - $this->container['repeatPassword'] = isset($data['repeatPassword']) ? $data['repeatPassword'] : null; - $this->container['userEmail'] = isset($data['userEmail']) ? $data['userEmail'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['password'] === null) { - $invalidProperties[] = "'password' can't be null"; - } - if ($this->container['repeatPassword'] === null) { - $invalidProperties[] = "'repeatPassword' can't be null"; - } - if ($this->container['userEmail'] === null) { - $invalidProperties[] = "'userEmail' 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 password - * - * @return string - */ - public function getPassword() - { - return $this->container['password']; - } - - /** - * Sets password - * - * @param string $password password - * - * @return $this - */ - public function setPassword($password) - { - $this->container['password'] = $password; - - return $this; - } - - /** - * Gets repeatPassword - * - * @return string - */ - public function getRepeatPassword() - { - return $this->container['repeatPassword']; - } - - /** - * Sets repeatPassword - * - * @param string $repeatPassword repeatPassword - * - * @return $this - */ - public function setRepeatPassword($repeatPassword) - { - $this->container['repeatPassword'] = $repeatPassword; - - return $this; - } - - /** - * Gets userEmail - * - * @return string - */ - public function getUserEmail() - { - return $this->container['userEmail']; - } - - /** - * Sets userEmail - * - * @param string $userEmail userEmail - * - * @return $this - */ - public function setUserEmail($userEmail) - { - $this->container['userEmail'] = $userEmail; - - 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/Site.php b/src/Model/Site.php deleted file mode 100644 index 8e439e6..0000000 --- a/src/Model/Site.php +++ /dev/null @@ -1,822 +0,0 @@ - '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 - * - * @var string[] - */ - 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', -'provisionerId' => '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', -'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) - * - * @var string[] - */ - 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', -'provisionerId' => 'setProvisionerId' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - 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', -'provisionerId' => 'getProvisionerId' ]; - - /** - * 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['url'] = isset($data['url']) ? $data['url'] : null; - $this->container['header'] = isset($data['header']) ? $data['header'] : null; - $this->container['icon'] = isset($data['icon']) ? $data['icon'] : null; - $this->container['creationDate'] = isset($data['creationDate']) ? $data['creationDate'] : null; - $this->container['hostname'] = isset($data['hostname']) ? $data['hostname'] : null; - $this->container['protocol'] = isset($data['protocol']) ? $data['protocol'] : null; - $this->container['port'] = isset($data['port']) ? $data['port'] : null; - $this->container['path'] = isset($data['path']) ? $data['path'] : null; - $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null; - $this->container['modifiedAt'] = isset($data['modifiedAt']) ? $data['modifiedAt'] : null; - $this->container['type'] = isset($data['type']) ? $data['type'] : null; - $this->container['status'] = isset($data['status']) ? $data['status'] : 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; - } - - /** - * 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['url'] === null) { - $invalidProperties[] = "'url' can't be null"; - } - if ($this->container['header'] === null) { - $invalidProperties[] = "'header' can't be null"; - } - if ($this->container['icon'] === null) { - $invalidProperties[] = "'icon' can't be null"; - } - if ($this->container['creationDate'] === null) { - $invalidProperties[] = "'creationDate' can't be null"; - } - if ($this->container['hostname'] === null) { - $invalidProperties[] = "'hostname' can't be null"; - } - if ($this->container['protocol'] === null) { - $invalidProperties[] = "'protocol' can't be null"; - } - if ($this->container['port'] === null) { - $invalidProperties[] = "'port' can't be null"; - } - if ($this->container['path'] === null) { - $invalidProperties[] = "'path' 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['type'] === null) { - $invalidProperties[] = "'type' can't be null"; - } - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['clientId'] === null) { - $invalidProperties[] = "'clientId' can't be null"; - } - if ($this->container['clientSecret'] === null) { - $invalidProperties[] = "'clientSecret' can't be null"; - } - if ($this->container['userId'] === null) { - $invalidProperties[] = "'userId' can't be null"; - } - if ($this->container['provisionerId'] === null) { - $invalidProperties[] = "'provisionerId' 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 url - * - * @return string - */ - public function getUrl() - { - return $this->container['url']; - } - - /** - * Sets url - * - * @param string $url url - * - * @return $this - */ - public function setUrl($url) - { - $this->container['url'] = $url; - - return $this; - } - - /** - * Gets header - * - * @return string - */ - public function getHeader() - { - return $this->container['header']; - } - - /** - * Sets header - * - * @param string $header header - * - * @return $this - */ - public function setHeader($header) - { - $this->container['header'] = $header; - - return $this; - } - - /** - * Gets icon - * - * @return string - */ - public function getIcon() - { - return $this->container['icon']; - } - - /** - * Sets icon - * - * @param string $icon icon - * - * @return $this - */ - public function setIcon($icon) - { - $this->container['icon'] = $icon; - - return $this; - } - - /** - * Gets creationDate - * - * @return \DateTime - */ - public function getCreationDate() - { - return $this->container['creationDate']; - } - - /** - * Sets creationDate - * - * @param \DateTime $creationDate creationDate - * - * @return $this - */ - public function setCreationDate($creationDate) - { - $this->container['creationDate'] = $creationDate; - - return $this; - } - - /** - * Gets hostname - * - * @return string - */ - public function getHostname() - { - return $this->container['hostname']; - } - - /** - * Sets hostname - * - * @param string $hostname hostname - * - * @return $this - */ - public function setHostname($hostname) - { - $this->container['hostname'] = $hostname; - - return $this; - } - - /** - * Gets protocol - * - * @return string - */ - public function getProtocol() - { - return $this->container['protocol']; - } - - /** - * Sets protocol - * - * @param string $protocol protocol - * - * @return $this - */ - public function setProtocol($protocol) - { - $this->container['protocol'] = $protocol; - - return $this; - } - - /** - * Gets port - * - * @return int - */ - public function getPort() - { - return $this->container['port']; - } - - /** - * Sets port - * - * @param int $port port - * - * @return $this - */ - public function setPort($port) - { - $this->container['port'] = $port; - - return $this; - } - - /** - * Gets path - * - * @return string - */ - public function getPath() - { - return $this->container['path']; - } - - /** - * Sets path - * - * @param string $path path - * - * @return $this - */ - public function setPath($path) - { - $this->container['path'] = $path; - - 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 type - * - * @return string - */ - public function getType() - { - return $this->container['type']; - } - - /** - * Sets type - * - * @param string $type type - * - * @return $this - */ - public function setType($type) - { - $this->container['type'] = $type; - - return $this; - } - - /** - * Gets status - * - * @return string - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param string $status status - * - * @return $this - */ - public function setStatus($status) - { - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets clientId - * - * @return string - */ - public function getClientId() - { - return $this->container['clientId']; - } - - /** - * Sets clientId - * - * @param string $clientId clientId - * - * @return $this - */ - public function setClientId($clientId) - { - $this->container['clientId'] = $clientId; - - return $this; - } - - /** - * Gets clientSecret - * - * @return string - */ - public function getClientSecret() - { - return $this->container['clientSecret']; - } - - /** - * Sets clientSecret - * - * @param string $clientSecret clientSecret - * - * @return $this - */ - public function setClientSecret($clientSecret) - { - $this->container['clientSecret'] = $clientSecret; - - 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; - } - - /** - * 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. - * - * @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/SubscribeByEmailBodyDto.php b/src/Model/SubscribeByEmailBodyDto.php deleted file mode 100644 index f201118..0000000 --- a/src/Model/SubscribeByEmailBodyDto.php +++ /dev/null @@ -1,360 +0,0 @@ - 'string', -'firstName' => 'string', -'lastName' => 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'email' => 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 = [ - 'email' => 'email', -'firstName' => 'firstName', -'lastName' => 'lastName' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'email' => 'setEmail', -'firstName' => 'setFirstName', -'lastName' => 'setLastName' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'email' => 'getEmail', -'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['email'] = isset($data['email']) ? $data['email'] : 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['email'] === null) { - $invalidProperties[] = "'email' 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 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 firstName - * - * @return string - */ - public function getFirstName() - { - return $this->container['firstName']; - } - - /** - * Sets firstName - * - * @param string $firstName firstName - * - * @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 lastName - * - * @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/SubscribeDto.php b/src/Model/SubscribeDto.php deleted file mode 100644 index 33788f8..0000000 --- a/src/Model/SubscribeDto.php +++ /dev/null @@ -1,327 +0,0 @@ - '\Yoast\MyYoastApiClient\Model\CustomerDetails', -'list' => 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'customerDetails' => null, -'list' => 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 = [ - 'customerDetails' => 'customerDetails', -'list' => 'list' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'customerDetails' => 'setCustomerDetails', -'list' => 'setList' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'customerDetails' => 'getCustomerDetails', -'list' => 'getList' ]; - - /** - * 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['customerDetails'] = isset($data['customerDetails']) ? $data['customerDetails'] : null; - $this->container['list'] = isset($data['list']) ? $data['list'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['customerDetails'] === null) { - $invalidProperties[] = "'customerDetails' can't be null"; - } - if ($this->container['list'] === null) { - $invalidProperties[] = "'list' 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 customerDetails - * - * @return \Yoast\MyYoastApiClient\Model\CustomerDetails - */ - public function getCustomerDetails() - { - return $this->container['customerDetails']; - } - - /** - * Sets customerDetails - * - * @param \Yoast\MyYoastApiClient\Model\CustomerDetails $customerDetails customerDetails - * - * @return $this - */ - public function setCustomerDetails($customerDetails) - { - $this->container['customerDetails'] = $customerDetails; - - return $this; - } - - /** - * Gets list - * - * @return string - */ - public function getList() - { - return $this->container['list']; - } - - /** - * Sets list - * - * @param string $list list - * - * @return $this - */ - public function setList($list) - { - $this->container['list'] = $list; - - 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/Subscription.php b/src/Model/Subscription.php deleted file mode 100644 index 8761630..0000000 --- a/src/Model/Subscription.php +++ /dev/null @@ -1,954 +0,0 @@ - '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' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - 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, -'subscriberId' => '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', -'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' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - 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', -'subscriberId' => 'setSubscriberId' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - 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', -'subscriberId' => 'getSubscriberId' ]; - - /** - * 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['startDate'] = isset($data['startDate']) ? $data['startDate'] : null; - $this->container['endDate'] = isset($data['endDate']) ? $data['endDate'] : null; - $this->container['sourceId'] = isset($data['sourceId']) ? $data['sourceId'] : null; - $this->container['sourceLineItemId'] = isset($data['sourceLineItemId']) ? $data['sourceLineItemId'] : null; - $this->container['sourceShopId'] = isset($data['sourceShopId']) ? $data['sourceShopId'] : null; - $this->container['status'] = isset($data['status']) ? $data['status'] : null; - $this->container['currency'] = isset($data['currency']) ? $data['currency'] : null; - $this->container['date'] = isset($data['date']) ? $data['date'] : null; - $this->container['price'] = isset($data['price']) ? $data['price'] : null; - $this->container['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['nextPayment'] = isset($data['nextPayment']) ? $data['nextPayment'] : null; - $this->container['limit'] = isset($data['limit']) ? $data['limit'] : null; - $this->container['used'] = isset($data['used']) ? $data['used'] : null; - $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null; - $this->container['modifiedAt'] = isset($data['modifiedAt']) ? $data['modifiedAt'] : null; - $this->container['requiresManualRenewal'] = isset($data['requiresManualRenewal']) ? $data['requiresManualRenewal'] : 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; - } - - /** - * 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['startDate'] === null) { - $invalidProperties[] = "'startDate' can't be null"; - } - if ($this->container['endDate'] === null) { - $invalidProperties[] = "'endDate' can't be null"; - } - if ($this->container['sourceId'] === null) { - $invalidProperties[] = "'sourceId' can't be null"; - } - if ($this->container['sourceLineItemId'] === null) { - $invalidProperties[] = "'sourceLineItemId' can't be null"; - } - if ($this->container['sourceShopId'] === null) { - $invalidProperties[] = "'sourceShopId' can't be null"; - } - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['currency'] === null) { - $invalidProperties[] = "'currency' can't be null"; - } - if ($this->container['date'] === null) { - $invalidProperties[] = "'date' can't be null"; - } - if ($this->container['price'] === null) { - $invalidProperties[] = "'price' can't be null"; - } - if ($this->container['name'] === null) { - $invalidProperties[] = "'name' can't be null"; - } - if ($this->container['nextPayment'] === null) { - $invalidProperties[] = "'nextPayment' can't be null"; - } - if ($this->container['limit'] === null) { - $invalidProperties[] = "'limit' can't be null"; - } - if ($this->container['used'] === null) { - $invalidProperties[] = "'used' 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['requiresManualRenewal'] === null) { - $invalidProperties[] = "'requiresManualRenewal' can't be null"; - } - if ($this->container['renewalSecret'] === null) { - $invalidProperties[] = "'renewalSecret' can't be null"; - } - if ($this->container['subscriptionNumber'] === null) { - $invalidProperties[] = "'subscriptionNumber' can't be null"; - } - if ($this->container['lastBillingTerm'] === null) { - $invalidProperties[] = "'lastBillingTerm' can't be null"; - } - if ($this->container['subscriberId'] === null) { - $invalidProperties[] = "'subscriberId' 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 startDate - * - * @return \DateTime - */ - public function getStartDate() - { - return $this->container['startDate']; - } - - /** - * Sets startDate - * - * @param \DateTime $startDate startDate - * - * @return $this - */ - public function setStartDate($startDate) - { - $this->container['startDate'] = $startDate; - - return $this; - } - - /** - * Gets endDate - * - * @return \DateTime - */ - public function getEndDate() - { - return $this->container['endDate']; - } - - /** - * Sets endDate - * - * @param \DateTime $endDate endDate - * - * @return $this - */ - public function setEndDate($endDate) - { - $this->container['endDate'] = $endDate; - - return $this; - } - - /** - * Gets sourceId - * - * @return int - */ - public function getSourceId() - { - return $this->container['sourceId']; - } - - /** - * Sets sourceId - * - * @param int $sourceId sourceId - * - * @return $this - */ - public function setSourceId($sourceId) - { - $this->container['sourceId'] = $sourceId; - - return $this; - } - - /** - * Gets sourceLineItemId - * - * @return int - */ - public function getSourceLineItemId() - { - return $this->container['sourceLineItemId']; - } - - /** - * Sets sourceLineItemId - * - * @param int $sourceLineItemId sourceLineItemId - * - * @return $this - */ - public function setSourceLineItemId($sourceLineItemId) - { - $this->container['sourceLineItemId'] = $sourceLineItemId; - - return $this; - } - - /** - * Gets sourceShopId - * - * @return int - */ - public function getSourceShopId() - { - return $this->container['sourceShopId']; - } - - /** - * Sets sourceShopId - * - * @param int $sourceShopId sourceShopId - * - * @return $this - */ - public function setSourceShopId($sourceShopId) - { - $this->container['sourceShopId'] = $sourceShopId; - - return $this; - } - - /** - * Gets status - * - * @return string - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param string $status status - * - * @return $this - */ - public function setStatus($status) - { - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets currency - * - * @return string - */ - public function getCurrency() - { - return $this->container['currency']; - } - - /** - * Sets currency - * - * @param string $currency currency - * - * @return $this - */ - public function setCurrency($currency) - { - $this->container['currency'] = $currency; - - return $this; - } - - /** - * Gets date - * - * @return \DateTime - */ - public function getDate() - { - return $this->container['date']; - } - - /** - * Sets date - * - * @param \DateTime $date date - * - * @return $this - */ - public function setDate($date) - { - $this->container['date'] = $date; - - return $this; - } - - /** - * Gets price - * - * @return int - */ - public function getPrice() - { - return $this->container['price']; - } - - /** - * Sets price - * - * @param int $price price - * - * @return $this - */ - public function setPrice($price) - { - $this->container['price'] = $price; - - 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 nextPayment - * - * @return \DateTime - */ - public function getNextPayment() - { - return $this->container['nextPayment']; - } - - /** - * Sets nextPayment - * - * @param \DateTime $nextPayment nextPayment - * - * @return $this - */ - public function setNextPayment($nextPayment) - { - $this->container['nextPayment'] = $nextPayment; - - return $this; - } - - /** - * Gets limit - * - * @return int - */ - public function getLimit() - { - return $this->container['limit']; - } - - /** - * Sets limit - * - * @param int $limit limit - * - * @return $this - */ - public function setLimit($limit) - { - $this->container['limit'] = $limit; - - return $this; - } - - /** - * Gets used - * - * @return int - */ - public function getUsed() - { - return $this->container['used']; - } - - /** - * Sets used - * - * @param int $used used - * - * @return $this - */ - public function setUsed($used) - { - $this->container['used'] = $used; - - 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 requiresManualRenewal - * - * @return bool - */ - public function getRequiresManualRenewal() - { - return $this->container['requiresManualRenewal']; - } - - /** - * Sets requiresManualRenewal - * - * @param bool $requiresManualRenewal requiresManualRenewal - * - * @return $this - */ - public function setRequiresManualRenewal($requiresManualRenewal) - { - $this->container['requiresManualRenewal'] = $requiresManualRenewal; - - return $this; - } - - /** - * Gets renewalSecret - * - * @return string - */ - public function getRenewalSecret() - { - return $this->container['renewalSecret']; - } - - /** - * Sets renewalSecret - * - * @param string $renewalSecret renewalSecret - * - * @return $this - */ - public function setRenewalSecret($renewalSecret) - { - $this->container['renewalSecret'] = $renewalSecret; - - return $this; - } - - /** - * Gets subscriptionNumber - * - * @return string - */ - public function getSubscriptionNumber() - { - return $this->container['subscriptionNumber']; - } - - /** - * Sets subscriptionNumber - * - * @param string $subscriptionNumber subscriptionNumber - * - * @return $this - */ - public function setSubscriptionNumber($subscriptionNumber) - { - $this->container['subscriptionNumber'] = $subscriptionNumber; - - return $this; - } - - /** - * Gets lastBillingTerm - * - * @return string - */ - public function getLastBillingTerm() - { - return $this->container['lastBillingTerm']; - } - - /** - * Sets lastBillingTerm - * - * @param string $lastBillingTerm lastBillingTerm - * - * @return $this - */ - public function setLastBillingTerm($lastBillingTerm) - { - $this->container['lastBillingTerm'] = $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; - } - /** - * 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/SubscriptionProvisioningResponseDto.php b/src/Model/SubscriptionProvisioningResponseDto.php deleted file mode 100644 index 308b96f..0000000 --- a/src/Model/SubscriptionProvisioningResponseDto.php +++ /dev/null @@ -1,492 +0,0 @@ - '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 deleted file mode 100644 index dc0a68a..0000000 --- a/src/Model/SwitchSubscriptionNumberOfTimesDto.php +++ /dev/null @@ -1,360 +0,0 @@ - 'int', -'toSourceId' => 'int', -'productId' => 'int' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'fromSourceId' => null, -'toSourceId' => null, -'productId' => 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 = [ - 'fromSourceId' => 'fromSourceId', -'toSourceId' => 'toSourceId', -'productId' => 'productId' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'fromSourceId' => 'setFromSourceId', -'toSourceId' => 'setToSourceId', -'productId' => 'setProductId' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'fromSourceId' => 'getFromSourceId', -'toSourceId' => 'getToSourceId', -'productId' => 'getProductId' ]; - - /** - * 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['fromSourceId'] = isset($data['fromSourceId']) ? $data['fromSourceId'] : null; - $this->container['toSourceId'] = isset($data['toSourceId']) ? $data['toSourceId'] : null; - $this->container['productId'] = isset($data['productId']) ? $data['productId'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['fromSourceId'] === null) { - $invalidProperties[] = "'fromSourceId' can't be null"; - } - if ($this->container['toSourceId'] === null) { - $invalidProperties[] = "'toSourceId' can't be null"; - } - if ($this->container['productId'] === null) { - $invalidProperties[] = "'productId' 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 fromSourceId - * - * @return int - */ - public function getFromSourceId() - { - return $this->container['fromSourceId']; - } - - /** - * Sets fromSourceId - * - * @param int $fromSourceId fromSourceId - * - * @return $this - */ - public function setFromSourceId($fromSourceId) - { - $this->container['fromSourceId'] = $fromSourceId; - - return $this; - } - - /** - * Gets toSourceId - * - * @return int - */ - public function getToSourceId() - { - return $this->container['toSourceId']; - } - - /** - * Sets toSourceId - * - * @param int $toSourceId toSourceId - * - * @return $this - */ - public function setToSourceId($toSourceId) - { - $this->container['toSourceId'] = $toSourceId; - - return $this; - } - - /** - * Gets productId - * - * @return int - */ - public function getProductId() - { - return $this->container['productId']; - } - - /** - * Sets productId - * - * @param int $productId productId - * - * @return $this - */ - public function setProductId($productId) - { - $this->container['productId'] = $productId; - - 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/TaxLineItem.php b/src/Model/TaxLineItem.php deleted file mode 100644 index 2557020..0000000 --- a/src/Model/TaxLineItem.php +++ /dev/null @@ -1,555 +0,0 @@ - 'int', -'compound' => 'bool', -'label' => 'string', -'metaData' => '\Yoast\MyYoastApiClient\Model\MetaDataDto[]', -'rateCode' => 'string', -'rateId' => 'int', -'shippingTaxTotal' => 'string', -'taxTotal' => 'string', -'ratePercent' => 'int' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'id' => null, -'compound' => null, -'label' => null, -'metaData' => null, -'rateCode' => null, -'rateId' => null, -'shippingTaxTotal' => null, -'taxTotal' => null, -'ratePercent' => 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', -'compound' => 'compound', -'label' => 'label', -'metaData' => 'meta_data', -'rateCode' => 'rate_code', -'rateId' => 'rate_id', -'shippingTaxTotal' => 'shipping_tax_total', -'taxTotal' => 'tax_total', -'ratePercent' => 'rate_percent' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'id' => 'setId', -'compound' => 'setCompound', -'label' => 'setLabel', -'metaData' => 'setMetaData', -'rateCode' => 'setRateCode', -'rateId' => 'setRateId', -'shippingTaxTotal' => 'setShippingTaxTotal', -'taxTotal' => 'setTaxTotal', -'ratePercent' => 'setRatePercent' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'id' => 'getId', -'compound' => 'getCompound', -'label' => 'getLabel', -'metaData' => 'getMetaData', -'rateCode' => 'getRateCode', -'rateId' => 'getRateId', -'shippingTaxTotal' => 'getShippingTaxTotal', -'taxTotal' => 'getTaxTotal', -'ratePercent' => 'getRatePercent' ]; - - /** - * 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['compound'] = isset($data['compound']) ? $data['compound'] : null; - $this->container['label'] = isset($data['label']) ? $data['label'] : null; - $this->container['metaData'] = isset($data['metaData']) ? $data['metaData'] : null; - $this->container['rateCode'] = isset($data['rateCode']) ? $data['rateCode'] : null; - $this->container['rateId'] = isset($data['rateId']) ? $data['rateId'] : null; - $this->container['shippingTaxTotal'] = isset($data['shippingTaxTotal']) ? $data['shippingTaxTotal'] : null; - $this->container['taxTotal'] = isset($data['taxTotal']) ? $data['taxTotal'] : null; - $this->container['ratePercent'] = isset($data['ratePercent']) ? $data['ratePercent'] : 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['compound'] === null) { - $invalidProperties[] = "'compound' can't be null"; - } - if ($this->container['label'] === null) { - $invalidProperties[] = "'label' can't be null"; - } - if ($this->container['metaData'] === null) { - $invalidProperties[] = "'metaData' can't be null"; - } - if ($this->container['rateCode'] === null) { - $invalidProperties[] = "'rateCode' can't be null"; - } - if ($this->container['rateId'] === null) { - $invalidProperties[] = "'rateId' can't be null"; - } - if ($this->container['shippingTaxTotal'] === null) { - $invalidProperties[] = "'shippingTaxTotal' can't be null"; - } - if ($this->container['taxTotal'] === null) { - $invalidProperties[] = "'taxTotal' 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 compound - * - * @return bool - */ - public function getCompound() - { - return $this->container['compound']; - } - - /** - * Sets compound - * - * @param bool $compound compound - * - * @return $this - */ - public function setCompound($compound) - { - $this->container['compound'] = $compound; - - return $this; - } - - /** - * Gets label - * - * @return string - */ - public function getLabel() - { - return $this->container['label']; - } - - /** - * Sets label - * - * @param string $label label - * - * @return $this - */ - public function setLabel($label) - { - $this->container['label'] = $label; - - 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; - } - - /** - * Gets rateCode - * - * @return string - */ - public function getRateCode() - { - return $this->container['rateCode']; - } - - /** - * Sets rateCode - * - * @param string $rateCode rateCode - * - * @return $this - */ - public function setRateCode($rateCode) - { - $this->container['rateCode'] = $rateCode; - - return $this; - } - - /** - * Gets rateId - * - * @return int - */ - public function getRateId() - { - return $this->container['rateId']; - } - - /** - * Sets rateId - * - * @param int $rateId rateId - * - * @return $this - */ - public function setRateId($rateId) - { - $this->container['rateId'] = $rateId; - - return $this; - } - - /** - * Gets shippingTaxTotal - * - * @return string - */ - public function getShippingTaxTotal() - { - return $this->container['shippingTaxTotal']; - } - - /** - * Sets shippingTaxTotal - * - * @param string $shippingTaxTotal shippingTaxTotal - * - * @return $this - */ - public function setShippingTaxTotal($shippingTaxTotal) - { - $this->container['shippingTaxTotal'] = $shippingTaxTotal; - - return $this; - } - - /** - * Gets taxTotal - * - * @return string - */ - public function getTaxTotal() - { - return $this->container['taxTotal']; - } - - /** - * Sets taxTotal - * - * @param string $taxTotal taxTotal - * - * @return $this - */ - public function setTaxTotal($taxTotal) - { - $this->container['taxTotal'] = $taxTotal; - - return $this; - } - - /** - * Gets ratePercent - * - * @return int - */ - public function getRatePercent() - { - return $this->container['ratePercent']; - } - - /** - * Sets ratePercent - * - * @param int $ratePercent ratePercent - * - * @return $this - */ - public function setRatePercent($ratePercent) - { - $this->container['ratePercent'] = $ratePercent; - - 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/Transaction.php b/src/Model/Transaction.php deleted file mode 100644 index c31bd50..0000000 --- a/src/Model/Transaction.php +++ /dev/null @@ -1,360 +0,0 @@ - 'int', -'refundedAmount' => 'int', -'refunds' => 'string[]' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'capturedAmount' => null, -'refundedAmount' => null, -'refunds' => 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 = [ - 'capturedAmount' => 'capturedAmount', -'refundedAmount' => 'refundedAmount', -'refunds' => 'refunds' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'capturedAmount' => 'setCapturedAmount', -'refundedAmount' => 'setRefundedAmount', -'refunds' => 'setRefunds' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'capturedAmount' => 'getCapturedAmount', -'refundedAmount' => 'getRefundedAmount', -'refunds' => 'getRefunds' ]; - - /** - * 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['capturedAmount'] = isset($data['capturedAmount']) ? $data['capturedAmount'] : null; - $this->container['refundedAmount'] = isset($data['refundedAmount']) ? $data['refundedAmount'] : null; - $this->container['refunds'] = isset($data['refunds']) ? $data['refunds'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['capturedAmount'] === null) { - $invalidProperties[] = "'capturedAmount' can't be null"; - } - if ($this->container['refundedAmount'] === null) { - $invalidProperties[] = "'refundedAmount' can't be null"; - } - if ($this->container['refunds'] === null) { - $invalidProperties[] = "'refunds' 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 capturedAmount - * - * @return int - */ - public function getCapturedAmount() - { - return $this->container['capturedAmount']; - } - - /** - * Sets capturedAmount - * - * @param int $capturedAmount capturedAmount - * - * @return $this - */ - public function setCapturedAmount($capturedAmount) - { - $this->container['capturedAmount'] = $capturedAmount; - - return $this; - } - - /** - * Gets refundedAmount - * - * @return int - */ - public function getRefundedAmount() - { - return $this->container['refundedAmount']; - } - - /** - * Sets refundedAmount - * - * @param int $refundedAmount refundedAmount - * - * @return $this - */ - public function setRefundedAmount($refundedAmount) - { - $this->container['refundedAmount'] = $refundedAmount; - - return $this; - } - - /** - * Gets refunds - * - * @return string[] - */ - public function getRefunds() - { - return $this->container['refunds']; - } - - /** - * Sets refunds - * - * @param string[] $refunds refunds - * - * @return $this - */ - public function setRefunds($refunds) - { - $this->container['refunds'] = $refunds; - - 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/TransactionDataDto.php b/src/Model/TransactionDataDto.php deleted file mode 100644 index 44b8b0d..0000000 --- a/src/Model/TransactionDataDto.php +++ /dev/null @@ -1,459 +0,0 @@ - 'string', -'paymentId' => 'string', -'createdOn' => 'string', -'updatedOn' => 'string', -'paid' => 'bool', -'transactionObject' => '\Yoast\MyYoastApiClient\Model\Transaction' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'transactionId' => null, -'paymentId' => null, -'createdOn' => null, -'updatedOn' => null, -'paid' => null, -'transactionObject' => 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 = [ - 'transactionId' => 'transactionId', -'paymentId' => 'paymentId', -'createdOn' => 'createdOn', -'updatedOn' => 'updatedOn', -'paid' => 'paid', -'transactionObject' => 'transactionObject' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'transactionId' => 'setTransactionId', -'paymentId' => 'setPaymentId', -'createdOn' => 'setCreatedOn', -'updatedOn' => 'setUpdatedOn', -'paid' => 'setPaid', -'transactionObject' => 'setTransactionObject' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'transactionId' => 'getTransactionId', -'paymentId' => 'getPaymentId', -'createdOn' => 'getCreatedOn', -'updatedOn' => 'getUpdatedOn', -'paid' => 'getPaid', -'transactionObject' => 'getTransactionObject' ]; - - /** - * 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['transactionId'] = isset($data['transactionId']) ? $data['transactionId'] : null; - $this->container['paymentId'] = isset($data['paymentId']) ? $data['paymentId'] : null; - $this->container['createdOn'] = isset($data['createdOn']) ? $data['createdOn'] : null; - $this->container['updatedOn'] = isset($data['updatedOn']) ? $data['updatedOn'] : null; - $this->container['paid'] = isset($data['paid']) ? $data['paid'] : null; - $this->container['transactionObject'] = isset($data['transactionObject']) ? $data['transactionObject'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['transactionId'] === null) { - $invalidProperties[] = "'transactionId' can't be null"; - } - if ($this->container['paymentId'] === null) { - $invalidProperties[] = "'paymentId' can't be null"; - } - if ($this->container['createdOn'] === null) { - $invalidProperties[] = "'createdOn' can't be null"; - } - if ($this->container['updatedOn'] === null) { - $invalidProperties[] = "'updatedOn' can't be null"; - } - if ($this->container['paid'] === null) { - $invalidProperties[] = "'paid' can't be null"; - } - if ($this->container['transactionObject'] === null) { - $invalidProperties[] = "'transactionObject' 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 transactionId - * - * @return string - */ - public function getTransactionId() - { - return $this->container['transactionId']; - } - - /** - * Sets transactionId - * - * @param string $transactionId transactionId - * - * @return $this - */ - public function setTransactionId($transactionId) - { - $this->container['transactionId'] = $transactionId; - - return $this; - } - - /** - * Gets paymentId - * - * @return string - */ - public function getPaymentId() - { - return $this->container['paymentId']; - } - - /** - * Sets paymentId - * - * @param string $paymentId paymentId - * - * @return $this - */ - public function setPaymentId($paymentId) - { - $this->container['paymentId'] = $paymentId; - - return $this; - } - - /** - * Gets createdOn - * - * @return string - */ - public function getCreatedOn() - { - return $this->container['createdOn']; - } - - /** - * Sets createdOn - * - * @param string $createdOn createdOn - * - * @return $this - */ - public function setCreatedOn($createdOn) - { - $this->container['createdOn'] = $createdOn; - - return $this; - } - - /** - * Gets updatedOn - * - * @return string - */ - public function getUpdatedOn() - { - return $this->container['updatedOn']; - } - - /** - * Sets updatedOn - * - * @param string $updatedOn updatedOn - * - * @return $this - */ - public function setUpdatedOn($updatedOn) - { - $this->container['updatedOn'] = $updatedOn; - - return $this; - } - - /** - * Gets paid - * - * @return bool - */ - public function getPaid() - { - return $this->container['paid']; - } - - /** - * Sets paid - * - * @param bool $paid paid - * - * @return $this - */ - public function setPaid($paid) - { - $this->container['paid'] = $paid; - - return $this; - } - - /** - * Gets transactionObject - * - * @return \Yoast\MyYoastApiClient\Model\Transaction - */ - public function getTransactionObject() - { - return $this->container['transactionObject']; - } - - /** - * Sets transactionObject - * - * @param \Yoast\MyYoastApiClient\Model\Transaction $transactionObject transactionObject - * - * @return $this - */ - public function setTransactionObject($transactionObject) - { - $this->container['transactionObject'] = $transactionObject; - - 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/TransferAdmissionDto.php b/src/Model/TransferAdmissionDto.php deleted file mode 100644 index cc4fc24..0000000 --- a/src/Model/TransferAdmissionDto.php +++ /dev/null @@ -1,327 +0,0 @@ - 'string', -'toCustomerId' => 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'fromCustomerId' => null, -'toCustomerId' => 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 = [ - 'fromCustomerId' => 'fromCustomerId', -'toCustomerId' => 'toCustomerId' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'fromCustomerId' => 'setFromCustomerId', -'toCustomerId' => 'setToCustomerId' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'fromCustomerId' => 'getFromCustomerId', -'toCustomerId' => 'getToCustomerId' ]; - - /** - * 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['fromCustomerId'] = isset($data['fromCustomerId']) ? $data['fromCustomerId'] : null; - $this->container['toCustomerId'] = isset($data['toCustomerId']) ? $data['toCustomerId'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['fromCustomerId'] === null) { - $invalidProperties[] = "'fromCustomerId' can't be null"; - } - if ($this->container['toCustomerId'] === null) { - $invalidProperties[] = "'toCustomerId' 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 fromCustomerId - * - * @return string - */ - public function getFromCustomerId() - { - return $this->container['fromCustomerId']; - } - - /** - * Sets fromCustomerId - * - * @param string $fromCustomerId fromCustomerId - * - * @return $this - */ - public function setFromCustomerId($fromCustomerId) - { - $this->container['fromCustomerId'] = $fromCustomerId; - - return $this; - } - - /** - * Gets toCustomerId - * - * @return string - */ - public function getToCustomerId() - { - return $this->container['toCustomerId']; - } - - /** - * Sets toCustomerId - * - * @param string $toCustomerId toCustomerId - * - * @return $this - */ - public function setToCustomerId($toCustomerId) - { - $this->container['toCustomerId'] = $toCustomerId; - - 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/TransferDto.php b/src/Model/TransferDto.php deleted file mode 100644 index 4dc73d6..0000000 --- a/src/Model/TransferDto.php +++ /dev/null @@ -1,327 +0,0 @@ - 'int', -'toSourceId' => 'int' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'fromSourceId' => null, -'toSourceId' => 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 = [ - 'fromSourceId' => 'fromSourceId', -'toSourceId' => 'toSourceId' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'fromSourceId' => 'setFromSourceId', -'toSourceId' => 'setToSourceId' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'fromSourceId' => 'getFromSourceId', -'toSourceId' => 'getToSourceId' ]; - - /** - * 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['fromSourceId'] = isset($data['fromSourceId']) ? $data['fromSourceId'] : null; - $this->container['toSourceId'] = isset($data['toSourceId']) ? $data['toSourceId'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['fromSourceId'] === null) { - $invalidProperties[] = "'fromSourceId' can't be null"; - } - if ($this->container['toSourceId'] === null) { - $invalidProperties[] = "'toSourceId' 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 fromSourceId - * - * @return int - */ - public function getFromSourceId() - { - return $this->container['fromSourceId']; - } - - /** - * Sets fromSourceId - * - * @param int $fromSourceId fromSourceId - * - * @return $this - */ - public function setFromSourceId($fromSourceId) - { - $this->container['fromSourceId'] = $fromSourceId; - - return $this; - } - - /** - * Gets toSourceId - * - * @return int - */ - public function getToSourceId() - { - return $this->container['toSourceId']; - } - - /** - * Sets toSourceId - * - * @param int $toSourceId toSourceId - * - * @return $this - */ - public function setToSourceId($toSourceId) - { - $this->container['toSourceId'] = $toSourceId; - - 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/TransferOwnershipDto.php b/src/Model/TransferOwnershipDto.php deleted file mode 100644 index 2aa95aa..0000000 --- a/src/Model/TransferOwnershipDto.php +++ /dev/null @@ -1,327 +0,0 @@ - 'string', -'toCustomerId' => 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'fromCustomerId' => null, -'toCustomerId' => 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 = [ - 'fromCustomerId' => 'fromCustomerId', -'toCustomerId' => 'toCustomerId' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'fromCustomerId' => 'setFromCustomerId', -'toCustomerId' => 'setToCustomerId' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'fromCustomerId' => 'getFromCustomerId', -'toCustomerId' => 'getToCustomerId' ]; - - /** - * 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['fromCustomerId'] = isset($data['fromCustomerId']) ? $data['fromCustomerId'] : null; - $this->container['toCustomerId'] = isset($data['toCustomerId']) ? $data['toCustomerId'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['fromCustomerId'] === null) { - $invalidProperties[] = "'fromCustomerId' can't be null"; - } - if ($this->container['toCustomerId'] === null) { - $invalidProperties[] = "'toCustomerId' 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 fromCustomerId - * - * @return string - */ - public function getFromCustomerId() - { - return $this->container['fromCustomerId']; - } - - /** - * Sets fromCustomerId - * - * @param string $fromCustomerId fromCustomerId - * - * @return $this - */ - public function setFromCustomerId($fromCustomerId) - { - $this->container['fromCustomerId'] = $fromCustomerId; - - return $this; - } - - /** - * Gets toCustomerId - * - * @return string - */ - public function getToCustomerId() - { - return $this->container['toCustomerId']; - } - - /** - * Sets toCustomerId - * - * @param string $toCustomerId toCustomerId - * - * @return $this - */ - public function setToCustomerId($toCustomerId) - { - $this->container['toCustomerId'] = $toCustomerId; - - 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/TransferSiteDto.php b/src/Model/TransferSiteDto.php deleted file mode 100644 index 2f6f154..0000000 --- a/src/Model/TransferSiteDto.php +++ /dev/null @@ -1,327 +0,0 @@ - 'int', -'toSourceId' => 'int' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'fromSourceId' => null, -'toSourceId' => 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 = [ - 'fromSourceId' => 'fromSourceId', -'toSourceId' => 'toSourceId' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'fromSourceId' => 'setFromSourceId', -'toSourceId' => 'setToSourceId' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'fromSourceId' => 'getFromSourceId', -'toSourceId' => 'getToSourceId' ]; - - /** - * 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['fromSourceId'] = isset($data['fromSourceId']) ? $data['fromSourceId'] : null; - $this->container['toSourceId'] = isset($data['toSourceId']) ? $data['toSourceId'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['fromSourceId'] === null) { - $invalidProperties[] = "'fromSourceId' can't be null"; - } - if ($this->container['toSourceId'] === null) { - $invalidProperties[] = "'toSourceId' 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 fromSourceId - * - * @return int - */ - public function getFromSourceId() - { - return $this->container['fromSourceId']; - } - - /** - * Sets fromSourceId - * - * @param int $fromSourceId fromSourceId - * - * @return $this - */ - public function setFromSourceId($fromSourceId) - { - $this->container['fromSourceId'] = $fromSourceId; - - return $this; - } - - /** - * Gets toSourceId - * - * @return int - */ - public function getToSourceId() - { - return $this->container['toSourceId']; - } - - /** - * Sets toSourceId - * - * @param int $toSourceId toSourceId - * - * @return $this - */ - public function setToSourceId($toSourceId) - { - $this->container['toSourceId'] = $toSourceId; - - 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/UnsubscribeDto.php b/src/Model/UnsubscribeDto.php deleted file mode 100644 index 42c6022..0000000 --- a/src/Model/UnsubscribeDto.php +++ /dev/null @@ -1,327 +0,0 @@ - 'string', -'list' => 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'email' => null, -'list' => 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', -'list' => 'list' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'email' => 'setEmail', -'list' => 'setList' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'email' => 'getEmail', -'list' => 'getList' ]; - - /** - * 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['list'] = isset($data['list']) ? $data['list'] : 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"; - } - if ($this->container['list'] === null) { - $invalidProperties[] = "'list' 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 list - * - * @return string - */ - public function getList() - { - return $this->container['list']; - } - - /** - * Sets list - * - * @param string $list list - * - * @return $this - */ - public function setList($list) - { - $this->container['list'] = $list; - - 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/UnsubscribeFromNewsletterDto.php b/src/Model/UnsubscribeFromNewsletterDto.php deleted file mode 100644 index 78f2cee..0000000 --- a/src/Model/UnsubscribeFromNewsletterDto.php +++ /dev/null @@ -1,294 +0,0 @@ - '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/UpdateAllKVRequestDto.php b/src/Model/UpdateAllKVRequestDto.php deleted file mode 100644 index 054577d..0000000 --- a/src/Model/UpdateAllKVRequestDto.php +++ /dev/null @@ -1,351 +0,0 @@ - 'string[]', -'pageSize' => 'int', -'page' => 'int' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'urls' => null, -'pageSize' => null, -'page' => 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 = [ - 'urls' => 'urls', -'pageSize' => 'pageSize', -'page' => 'page' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'urls' => 'setUrls', -'pageSize' => 'setPageSize', -'page' => 'setPage' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'urls' => 'getUrls', -'pageSize' => 'getPageSize', -'page' => 'getPage' ]; - - /** - * 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['urls'] = isset($data['urls']) ? $data['urls'] : null; - $this->container['pageSize'] = isset($data['pageSize']) ? $data['pageSize'] : null; - $this->container['page'] = isset($data['page']) ? $data['page'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets urls - * - * @return string[] - */ - public function getUrls() - { - return $this->container['urls']; - } - - /** - * Sets urls - * - * @param string[] $urls urls - * - * @return $this - */ - public function setUrls($urls) - { - $this->container['urls'] = $urls; - - return $this; - } - - /** - * Gets pageSize - * - * @return int - */ - public function getPageSize() - { - return $this->container['pageSize']; - } - - /** - * Sets pageSize - * - * @param int $pageSize pageSize - * - * @return $this - */ - public function setPageSize($pageSize) - { - $this->container['pageSize'] = $pageSize; - - return $this; - } - - /** - * Gets page - * - * @return int - */ - public function getPage() - { - return $this->container['page']; - } - - /** - * Sets page - * - * @param int $page page - * - * @return $this - */ - public function setPage($page) - { - $this->container['page'] = $page; - - 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/UpdateDownloadDto.php b/src/Model/UpdateDownloadDto.php deleted file mode 100644 index a5980a1..0000000 --- a/src/Model/UpdateDownloadDto.php +++ /dev/null @@ -1,360 +0,0 @@ - 'string', -'downloadUrl' => 'string', -'versionNumber' => 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'slug' => null, -'downloadUrl' => null, -'versionNumber' => 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 = [ - 'slug' => 'slug', -'downloadUrl' => 'downloadUrl', -'versionNumber' => 'versionNumber' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'slug' => 'setSlug', -'downloadUrl' => 'setDownloadUrl', -'versionNumber' => 'setVersionNumber' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'slug' => 'getSlug', -'downloadUrl' => 'getDownloadUrl', -'versionNumber' => 'getVersionNumber' ]; - - /** - * 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['slug'] = isset($data['slug']) ? $data['slug'] : null; - $this->container['downloadUrl'] = isset($data['downloadUrl']) ? $data['downloadUrl'] : null; - $this->container['versionNumber'] = isset($data['versionNumber']) ? $data['versionNumber'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['slug'] === null) { - $invalidProperties[] = "'slug' can't be null"; - } - if ($this->container['downloadUrl'] === null) { - $invalidProperties[] = "'downloadUrl' can't be null"; - } - if ($this->container['versionNumber'] === null) { - $invalidProperties[] = "'versionNumber' 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 slug - * - * @return string - */ - public function getSlug() - { - return $this->container['slug']; - } - - /** - * Sets slug - * - * @param string $slug The slug of the product group to update the download for. - * - * @return $this - */ - public function setSlug($slug) - { - $this->container['slug'] = $slug; - - return $this; - } - - /** - * Gets downloadUrl - * - * @return string - */ - public function getDownloadUrl() - { - return $this->container['downloadUrl']; - } - - /** - * Sets downloadUrl - * - * @param string $downloadUrl The download url to set for the product group. - * - * @return $this - */ - public function setDownloadUrl($downloadUrl) - { - $this->container['downloadUrl'] = $downloadUrl; - - return $this; - } - - /** - * Gets versionNumber - * - * @return string - */ - public function getVersionNumber() - { - return $this->container['versionNumber']; - } - - /** - * Sets versionNumber - * - * @param string $versionNumber The version number to set for the product group. - * - * @return $this - */ - public function setVersionNumber($versionNumber) - { - $this->container['versionNumber'] = $versionNumber; - - 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/UpdateDto.php b/src/Model/UpdateDto.php deleted file mode 100644 index 12c481f..0000000 --- a/src/Model/UpdateDto.php +++ /dev/null @@ -1,294 +0,0 @@ - '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 deleted file mode 100644 index 4f41a13..0000000 --- a/src/Model/UpdateFileDto.php +++ /dev/null @@ -1,324 +0,0 @@ - 'string', -'overwrite' => 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'version' => null, -'overwrite' => 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 = [ - 'version' => 'version', -'overwrite' => 'overwrite' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'version' => 'setVersion', -'overwrite' => 'setOverwrite' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'version' => 'getVersion', -'overwrite' => 'getOverwrite' ]; - - /** - * 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['version'] = isset($data['version']) ? $data['version'] : null; - $this->container['overwrite'] = isset($data['overwrite']) ? $data['overwrite'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['version'] === null) { - $invalidProperties[] = "'version' 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 version - * - * @return string - */ - public function getVersion() - { - return $this->container['version']; - } - - /** - * Sets version - * - * @param string $version version - * - * @return $this - */ - public function setVersion($version) - { - $this->container['version'] = $version; - - return $this; - } - - /** - * Gets overwrite - * - * @return string - */ - public function getOverwrite() - { - return $this->container['overwrite']; - } - - /** - * Sets overwrite - * - * @param string $overwrite overwrite - * - * @return $this - */ - public function setOverwrite($overwrite) - { - $this->container['overwrite'] = $overwrite; - - 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/UpdateSiteDto.php b/src/Model/UpdateSiteDto.php deleted file mode 100644 index 324e53d..0000000 --- a/src/Model/UpdateSiteDto.php +++ /dev/null @@ -1,294 +0,0 @@ - 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'type' => 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 = [ - 'type' => 'type' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'type' => 'setType' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'type' => 'getType' ]; - - /** - * 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['type'] = isset($data['type']) ? $data['type'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['type'] === null) { - $invalidProperties[] = "'type' 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 type - * - * @return string - */ - public function getType() - { - return $this->container['type']; - } - - /** - * Sets type - * - * @param string $type type - * - * @return $this - */ - public function setType($type) - { - $this->container['type'] = $type; - - 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/UpdateUserDto.php b/src/Model/UpdateUserDto.php deleted file mode 100644 index 40cadfb..0000000 --- a/src/Model/UpdateUserDto.php +++ /dev/null @@ -1,423 +0,0 @@ - 'string', -'userFirstName' => 'string', -'userLastName' => 'string', -'userAvatarUrl' => 'string', -'enabled' => 'bool' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'userEmail' => null, -'userFirstName' => null, -'userLastName' => null, -'userAvatarUrl' => null, -'enabled' => 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 = [ - 'userEmail' => 'userEmail', -'userFirstName' => 'userFirstName', -'userLastName' => 'userLastName', -'userAvatarUrl' => 'userAvatarUrl', -'enabled' => 'enabled' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'userEmail' => 'setUserEmail', -'userFirstName' => 'setUserFirstName', -'userLastName' => 'setUserLastName', -'userAvatarUrl' => 'setUserAvatarUrl', -'enabled' => 'setEnabled' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'userEmail' => 'getUserEmail', -'userFirstName' => 'getUserFirstName', -'userLastName' => 'getUserLastName', -'userAvatarUrl' => 'getUserAvatarUrl', -'enabled' => 'getEnabled' ]; - - /** - * 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['userEmail'] = isset($data['userEmail']) ? $data['userEmail'] : null; - $this->container['userFirstName'] = isset($data['userFirstName']) ? $data['userFirstName'] : null; - $this->container['userLastName'] = isset($data['userLastName']) ? $data['userLastName'] : null; - $this->container['userAvatarUrl'] = isset($data['userAvatarUrl']) ? $data['userAvatarUrl'] : null; - $this->container['enabled'] = isset($data['enabled']) ? $data['enabled'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['userEmail'] === null) { - $invalidProperties[] = "'userEmail' can't be null"; - } - if ($this->container['userFirstName'] === null) { - $invalidProperties[] = "'userFirstName' can't be null"; - } - if ($this->container['userLastName'] === null) { - $invalidProperties[] = "'userLastName' can't be null"; - } - if ($this->container['userAvatarUrl'] === null) { - $invalidProperties[] = "'userAvatarUrl' 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 userEmail - * - * @return string - */ - public function getUserEmail() - { - return $this->container['userEmail']; - } - - /** - * Sets userEmail - * - * @param string $userEmail userEmail - * - * @return $this - */ - public function setUserEmail($userEmail) - { - $this->container['userEmail'] = $userEmail; - - return $this; - } - - /** - * Gets userFirstName - * - * @return string - */ - public function getUserFirstName() - { - return $this->container['userFirstName']; - } - - /** - * Sets userFirstName - * - * @param string $userFirstName userFirstName - * - * @return $this - */ - public function setUserFirstName($userFirstName) - { - $this->container['userFirstName'] = $userFirstName; - - return $this; - } - - /** - * Gets userLastName - * - * @return string - */ - public function getUserLastName() - { - return $this->container['userLastName']; - } - - /** - * Sets userLastName - * - * @param string $userLastName userLastName - * - * @return $this - */ - public function setUserLastName($userLastName) - { - $this->container['userLastName'] = $userLastName; - - return $this; - } - - /** - * Gets userAvatarUrl - * - * @return string - */ - public function getUserAvatarUrl() - { - return $this->container['userAvatarUrl']; - } - - /** - * Sets userAvatarUrl - * - * @param string $userAvatarUrl userAvatarUrl - * - * @return $this - */ - public function setUserAvatarUrl($userAvatarUrl) - { - $this->container['userAvatarUrl'] = $userAvatarUrl; - - return $this; - } - - /** - * Gets enabled - * - * @return bool - */ - public function getEnabled() - { - return $this->container['enabled']; - } - - /** - * Sets enabled - * - * @param bool $enabled enabled - * - * @return $this - */ - public function setEnabled($enabled) - { - $this->container['enabled'] = $enabled; - - 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/UpdateUserToWordpressDto.php b/src/Model/UpdateUserToWordpressDto.php deleted file mode 100644 index db16268..0000000 --- a/src/Model/UpdateUserToWordpressDto.php +++ /dev/null @@ -1,360 +0,0 @@ - 'string', -'firstName' => 'string', -'lastName' => 'string' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'email' => 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 = [ - 'email' => 'email', -'firstName' => 'first_name', -'lastName' => 'last_name' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'email' => 'setEmail', -'firstName' => 'setFirstName', -'lastName' => 'setLastName' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'email' => 'getEmail', -'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['email'] = isset($data['email']) ? $data['email'] : 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['email'] === null) { - $invalidProperties[] = "'email' 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 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 firstName - * - * @return string - */ - public function getFirstName() - { - return $this->container['firstName']; - } - - /** - * Sets firstName - * - * @param string $firstName firstName - * - * @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 lastName - * - * @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/UpsertChangelogDto.php b/src/Model/UpsertChangelogDto.php deleted file mode 100644 index af9b4db..0000000 --- a/src/Model/UpsertChangelogDto.php +++ /dev/null @@ -1,354 +0,0 @@ - 'string', -'id' => 'string', -'sourceId' => 'int' ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $swaggerFormats = [ - 'content' => null, -'id' => null, -'sourceId' => 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 = [ - 'content' => 'content', -'id' => 'id', -'sourceId' => 'sourceId' ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'content' => 'setContent', -'id' => 'setId', -'sourceId' => 'setSourceId' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'content' => 'getContent', -'id' => 'getId', -'sourceId' => 'getSourceId' ]; - - /** - * 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['content'] = isset($data['content']) ? $data['content'] : null; - $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['sourceId'] = isset($data['sourceId']) ? $data['sourceId'] : null; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['content'] === null) { - $invalidProperties[] = "'content' 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 content - * - * @return string - */ - public function getContent() - { - return $this->container['content']; - } - - /** - * Sets content - * - * @param string $content content - * - * @return $this - */ - public function setContent($content) - { - $this->container['content'] = $content; - - return $this; - } - - /** - * 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 sourceId - * - * @return int - */ - public function getSourceId() - { - return $this->container['sourceId']; - } - - /** - * Sets sourceId - * - * @param int $sourceId sourceId - * - * @return $this - */ - public function setSourceId($sourceId) - { - $this->container['sourceId'] = $sourceId; - - 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/UserIdentity.php b/src/Model/UserIdentity.php deleted file mode 100644 index da2d407..0000000 --- a/src/Model/UserIdentity.php +++ /dev/null @@ -1,624 +0,0 @@ - 'int', -'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 - * - * @var string[] - */ - 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' ]; - - /** - * 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', -'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) - * - * @var string[] - */ - 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' ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - 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' ]; - - /** - * 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['provider'] = isset($data['provider']) ? $data['provider'] : null; - $this->container['authScheme'] = isset($data['authScheme']) ? $data['authScheme'] : null; - $this->container['externalId'] = isset($data['externalId']) ? $data['externalId'] : null; - $this->container['profile'] = isset($data['profile']) ? $data['profile'] : null; - $this->container['credentials'] = isset($data['credentials']) ? $data['credentials'] : null; - $this->container['created'] = isset($data['created']) ? $data['created'] : null; - $this->container['modified'] = isset($data['modified']) ? $data['modified'] : null; - $this->container['createdAt'] = isset($data['createdAt']) ? $data['createdAt'] : null; - $this->container['modifiedAt'] = isset($data['modifiedAt']) ? $data['modifiedAt'] : 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['provider'] === null) { - $invalidProperties[] = "'provider' can't be null"; - } - if ($this->container['authScheme'] === null) { - $invalidProperties[] = "'authScheme' can't be null"; - } - if ($this->container['externalId'] === null) { - $invalidProperties[] = "'externalId' can't be null"; - } - if ($this->container['profile'] === null) { - $invalidProperties[] = "'profile' can't be null"; - } - if ($this->container['credentials'] === null) { - $invalidProperties[] = "'credentials' 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"; - } - 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['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 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 provider - * - * @return string - */ - public function getProvider() - { - return $this->container['provider']; - } - - /** - * Sets provider - * - * @param string $provider provider - * - * @return $this - */ - public function setProvider($provider) - { - $this->container['provider'] = $provider; - - return $this; - } - - /** - * Gets authScheme - * - * @return string - */ - public function getAuthScheme() - { - return $this->container['authScheme']; - } - - /** - * Sets authScheme - * - * @param string $authScheme authScheme - * - * @return $this - */ - public function setAuthScheme($authScheme) - { - $this->container['authScheme'] = $authScheme; - - return $this; - } - - /** - * Gets externalId - * - * @return string - */ - public function getExternalId() - { - return $this->container['externalId']; - } - - /** - * Sets externalId - * - * @param string $externalId externalId - * - * @return $this - */ - public function setExternalId($externalId) - { - $this->container['externalId'] = $externalId; - - return $this; - } - - /** - * Gets profile - * - * @return object - */ - public function getProfile() - { - return $this->container['profile']; - } - - /** - * Sets profile - * - * @param object $profile profile - * - * @return $this - */ - public function setProfile($profile) - { - $this->container['profile'] = $profile; - - return $this; - } - - /** - * Gets credentials - * - * @return object - */ - public function getCredentials() - { - return $this->container['credentials']; - } - - /** - * Sets credentials - * - * @param object $credentials credentials - * - * @return $this - */ - public function setCredentials($credentials) - { - $this->container['credentials'] = $credentials; - - 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; - } - - /** - * 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 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/ObjectSerializer.php b/src/ObjectSerializer.php deleted file mode 100644 index 8ddc96a..0000000 --- a/src/ObjectSerializer.php +++ /dev/null @@ -1,318 +0,0 @@ -format('Y-m-d') : $data->format(\DateTime::ATOM); - } elseif (is_array($data)) { - foreach ($data as $property => $value) { - $data[$property] = self::sanitizeForSerialization($value); - } - return $data; - } elseif (is_object($data)) { - $values = []; - $formats = $data::swaggerFormats(); - foreach ($data::swaggerTypes() as $property => $swaggerType) { - $getter = $data::getters()[$property]; - $value = $data->$getter(); - 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())) { - $imploded = implode("', '", $swaggerType::getAllowableEnumValues()); - throw new \InvalidArgumentException("Invalid value for enum '$swaggerType', must be one of: '$imploded'"); - } - if ($value !== null) { - $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $swaggerType, $formats[$property]); - } - } - return (object)$values; - } else { - return (string)$data; - } - } - - /** - * Sanitize filename by removing path. - * e.g. ../../sun.gif becomes sun.gif - * - * @param string $filename filename to be sanitized - * - * @return string the sanitized filename - */ - public static function sanitizeFilename($filename) - { - if (preg_match("/.*[\/\\\\](.*)$/", $filename, $match)) { - return $match[1]; - } else { - return $filename; - } - } - - /** - * Take value and turn it into a string suitable for inclusion in - * the path, by url-encoding. - * - * @param string $value a string which will be part of the path - * - * @return string the serialized object - */ - public static function toPathValue($value) - { - return rawurlencode(self::toString($value)); - } - - /** - * Take value and turn it into a string suitable for inclusion in - * the query, by imploding comma-separated if it's an object. - * If it's a string, pass through unchanged. It will be url-encoded - * later. - * - * @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, $format = null) - { - if (is_array($object)) { - return implode(',', $object); - } else { - 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 RFC3339 - * - * @param string $value a string which will be part of the header - * - * @return string the header string - */ - public static function toHeaderValue($value) - { - return self::toString($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 RFC3339 - * - * @param string|\SplFileObject $value the value of the form parameter - * - * @return string the form string - */ - public static function toFormValue($value) - { - if ($value instanceof \SplFileObject) { - return $value->getRealPath(); - } else { - return self::toString($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 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, $format = null) - { - if ($value instanceof \DateTime) { - return ($format === 'date') ? $value->format('Y-m-d') : $value->format(\DateTime::ATOM); - } else { - return $value; - } - } - - /** - * Serialize an array to a string. - * - * @param array $collection collection to serialize to a string - * @param string $collectionFormat the format use for serialization (csv, - * ssv, tsv, pipes, multi) - * @param bool $allowCollectionFormatMulti allow collection format to be a multidimensional array - * - * @return string - */ - public static function serializeCollection(array $collection, $collectionFormat, $allowCollectionFormatMulti = false) - { - if ($allowCollectionFormatMulti && ('multi' === $collectionFormat)) { - // http_build_query() almost does the job for us. We just - // need to fix the result of multidimensional arrays. - return preg_replace('/%5B[0-9]+%5D=/', '=', http_build_query($collection, '', '&')); - } - switch ($collectionFormat) { - case 'pipes': - return implode('|', $collection); - - case 'tsv': - return implode("\t", $collection); - - case 'ssv': - return implode(' ', $collection); - - case 'csv': - // Deliberate fall through. CSV is default format. - default: - return implode(',', $collection); - } - } - - /** - * Deserialize a JSON string into an object - * - * @param mixed $data object or primitive to be deserialized - * @param string $class class name is passed as a string - * @param string[] $httpHeaders HTTP headers - * @param string $discriminator discriminator if polymorphism is used - * - * @return object|array|null an single or an array of $class instances - */ - public static function deserialize($data, $class, $httpHeaders = null) - { - if (null === $data) { - return null; - } elseif (substr($class, 0, 4) === 'map[') { // for associative array e.g. map[string,int] - $inner = substr($class, 4, -1); - $deserialized = []; - if (strrpos($inner, ",") !== false) { - $subClass_array = explode(',', $inner, 2); - $subClass = $subClass_array[1]; - foreach ($data as $key => $value) { - $deserialized[$key] = self::deserialize($value, $subClass, null); - } - } - return $deserialized; - } elseif (strcasecmp(substr($class, -2), '[]') === 0) { - $subClass = substr($class, 0, -2); - $values = []; - foreach ($data as $key => $value) { - $values[] = self::deserialize($value, $subClass, null); - } - return $values; - } elseif ($class === 'object') { - settype($data, 'array'); - return $data; - } elseif ($class === '\DateTime') { - // Some API's return an invalid, empty string as a - // date-time property. DateTime::__construct() will return - // the current time for empty input which is probably not - // what is meant. The invalid empty string is probably to - // be interpreted as a missing field/value. Let's handle - // this graceful. - if (!empty($data)) { - return new \DateTime($data); - } else { - return null; - } - } elseif (in_array($class, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { - settype($data, $class); - return $data; - } elseif ($class === '\SplFileObject') { - /** @var \Psr\Http\Message\StreamInterface $data */ - - // determine file name - if (array_key_exists('Content-Disposition', $httpHeaders) && - preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match)) { - $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]); - } else { - $filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), ''); - } - - $file = fopen($filename, 'w'); - while ($chunk = $data->read(200)) { - fwrite($file, $chunk); - } - fclose($file); - - return new \SplFileObject($filename, 'r'); - } elseif (method_exists($class, 'getAllowableEnumValues')) { - if (!in_array($data, $class::getAllowableEnumValues())) { - $imploded = implode("', '", $class::getAllowableEnumValues()); - throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'"); - } - return $data; - } else { - // 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 = '{{invokerPackage}}\Model\\' . $data->{$discriminator}; - if (is_subclass_of($subclass, $class)) { - $class = $subclass; - } - } - $instance = new $class(); - foreach ($instance::swaggerTypes() as $property => $type) { - $propertySetter = $instance::setters()[$property]; - - if (!isset($propertySetter) || !isset($data->{$instance::attributeMap()[$property]})) { - continue; - } - - $propertyValue = $data->{$instance::attributeMap()[$property]}; - if (isset($propertyValue)) { - $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); - } - } - return $instance; - } - } -} diff --git a/test/Api/AdmissionApiTest.php b/test/Api/AdmissionApiTest.php deleted file mode 100644 index b493886..0000000 --- a/test/Api/AdmissionApiTest.php +++ /dev/null @@ -1,132 +0,0 @@ -