Skip to content

Commit e22b9f1

Browse files
committed
Updated amazon models
1 parent 282004c commit e22b9f1

File tree

861 files changed

+779
-23073
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

861 files changed

+779
-23073
lines changed

composer.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/php-amazon-selling-partner-api/model.mustache

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,6 @@
11
<?php
22
{{#models}}
33
{{#model}}
4-
/**
5-
* {{classname}}
6-
*
7-
* PHP version 7.4
8-
*
9-
* @category Class
10-
* @package {{invokerPackage}}
11-
* @author OpenAPI Generator team
12-
* @link https://openapi-generator.tech
13-
*/
14-
15-
{{>partial_header}}
16-
/**
17-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
18-
* https://openapi-generator.tech
19-
* Do not edit the class manually.
20-
*/
214

225
namespace {{modelPackage}};
236
{{^isEnum}}

src/AmazonPHP/SellingPartner/Api/MessagingApi/MessagingSDK.php

Lines changed: 230 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ final class MessagingSDK
7070

7171
public const OPERATION_GETMESSAGINGACTIONSFORORDER_PATH = '/messaging/v1/orders/{amazonOrderId}';
7272

73+
public const OPERATION_SENDINVOICE = 'sendInvoice';
74+
75+
public const OPERATION_SENDINVOICE_PATH = '/messaging/v1/orders/{amazonOrderId}/messages/invoice';
76+
7377
private ClientInterface $client;
7478

7579
private HttpFactory $httpFactory;
@@ -2746,4 +2750,230 @@ public function getMessagingActionsForOrderRequest(AccessToken $accessToken, str
27462750
$request
27472751
);
27482752
}
2753+
2754+
/**
2755+
* Operation sendInvoice.
2756+
*
2757+
* @param AccessToken $accessToken
2758+
* @param string $amazon_order_id An Amazon order identifier. This specifies the order for which a message is sent. (required)
2759+
* @param string[] $marketplace_ids A marketplace identifier. This specifies the marketplace in which the order was placed. Only one marketplace can be specified. (required)
2760+
* @param \AmazonPHP\SellingPartner\Model\Messaging\InvoiceRequest $body body (required)
2761+
*
2762+
* @throws \AmazonPHP\SellingPartner\Exception\ApiException on non-2xx response
2763+
* @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
2764+
*/
2765+
public function sendInvoice(AccessToken $accessToken, string $region, string $amazon_order_id, array $marketplace_ids, \AmazonPHP\SellingPartner\Model\Messaging\InvoiceRequest $body) : \AmazonPHP\SellingPartner\Model\Messaging\InvoiceResponse
2766+
{
2767+
$request = $this->sendInvoiceRequest($accessToken, $region, $amazon_order_id, $marketplace_ids, $body);
2768+
2769+
$this->configuration->extensions()->preRequest('Messaging', 'sendInvoice', $request);
2770+
2771+
try {
2772+
$correlationId = \uuid_create(UUID_TYPE_RANDOM);
2773+
2774+
if ($this->configuration->loggingEnabled('Messaging', 'sendInvoice')) {
2775+
$sanitizedRequest = $request;
2776+
2777+
foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
2778+
$sanitizedRequest = $sanitizedRequest->withoutHeader($sensitiveHeader);
2779+
}
2780+
2781+
$this->logger->log(
2782+
$this->configuration->logLevel('Messaging', 'sendInvoice'),
2783+
'Amazon Selling Partner API pre request',
2784+
[
2785+
'api' => 'Messaging',
2786+
'operation' => 'sendInvoice',
2787+
'request_correlation_id' => $correlationId,
2788+
'request_body' => (string) $sanitizedRequest->getBody(),
2789+
'request_headers' => $sanitizedRequest->getHeaders(),
2790+
'request_uri' => (string) $sanitizedRequest->getUri(),
2791+
]
2792+
);
2793+
}
2794+
2795+
$response = $this->client->sendRequest($request);
2796+
2797+
$this->configuration->extensions()->postRequest('Messaging', 'sendInvoice', $request, $response);
2798+
2799+
if ($this->configuration->loggingEnabled('Messaging', 'sendInvoice')) {
2800+
$sanitizedResponse = $response;
2801+
2802+
foreach ($this->configuration->loggingSkipHeaders() as $sensitiveHeader) {
2803+
$sanitizedResponse = $sanitizedResponse->withoutHeader($sensitiveHeader);
2804+
}
2805+
2806+
$this->logger->log(
2807+
$this->configuration->logLevel('Messaging', 'sendInvoice'),
2808+
'Amazon Selling Partner API post request',
2809+
[
2810+
'api' => 'Messaging',
2811+
'operation' => 'sendInvoice',
2812+
'response_correlation_id' => $correlationId,
2813+
'response_body' => (string) $sanitizedResponse->getBody(),
2814+
'response_headers' => $sanitizedResponse->getHeaders(),
2815+
'response_status_code' => $sanitizedResponse->getStatusCode(),
2816+
]
2817+
);
2818+
}
2819+
} catch (ClientExceptionInterface $e) {
2820+
throw new ApiException(
2821+
"[{$e->getCode()}] {$e->getMessage()}",
2822+
(int) $e->getCode(),
2823+
null,
2824+
null,
2825+
$e
2826+
);
2827+
}
2828+
2829+
$statusCode = $response->getStatusCode();
2830+
2831+
if ($statusCode < 200 || $statusCode > 299) {
2832+
throw new ApiException(
2833+
\sprintf(
2834+
'[%d] Error connecting to the API (%s)',
2835+
$statusCode,
2836+
(string) $request->getUri()
2837+
),
2838+
$statusCode,
2839+
$response->getHeaders(),
2840+
(string) $response->getBody()
2841+
);
2842+
}
2843+
2844+
return ObjectSerializer::deserialize(
2845+
$this->configuration,
2846+
(string) $response->getBody(),
2847+
'\AmazonPHP\SellingPartner\Model\Messaging\InvoiceResponse',
2848+
[]
2849+
);
2850+
}
2851+
2852+
/**
2853+
* Create request for operation 'sendInvoice'.
2854+
*
2855+
* @param AccessToken $accessToken
2856+
* @param string $amazon_order_id An Amazon order identifier. This specifies the order for which a message is sent. (required)
2857+
* @param string[] $marketplace_ids A marketplace identifier. This specifies the marketplace in which the order was placed. Only one marketplace can be specified. (required)
2858+
* @param \AmazonPHP\SellingPartner\Model\Messaging\InvoiceRequest $body (required)
2859+
*
2860+
* @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
2861+
*/
2862+
public function sendInvoiceRequest(AccessToken $accessToken, string $region, string $amazon_order_id, array $marketplace_ids, \AmazonPHP\SellingPartner\Model\Messaging\InvoiceRequest $body) : RequestInterface
2863+
{
2864+
// verify the required parameter 'amazon_order_id' is set
2865+
if ($amazon_order_id === null || (\is_array($amazon_order_id) && \count($amazon_order_id) === 0)) {
2866+
throw new InvalidArgumentException(
2867+
'Missing the required parameter $amazon_order_id when calling sendInvoice'
2868+
);
2869+
}
2870+
// verify the required parameter 'marketplace_ids' is set
2871+
if ($marketplace_ids === null || (\is_array($marketplace_ids) && \count($marketplace_ids) === 0)) {
2872+
throw new InvalidArgumentException(
2873+
'Missing the required parameter $marketplace_ids when calling sendInvoice'
2874+
);
2875+
}
2876+
2877+
if (\count($marketplace_ids) > 1) {
2878+
throw new InvalidArgumentException('invalid value for "$marketplace_ids" when calling MessagingApi.sendInvoice, number of items must be less than or equal to 1.');
2879+
}
2880+
2881+
// verify the required parameter 'body' is set
2882+
if ($body === null || (\is_array($body) && \count($body) === 0)) {
2883+
throw new InvalidArgumentException(
2884+
'Missing the required parameter $body when calling sendInvoice'
2885+
);
2886+
}
2887+
2888+
$resourcePath = '/messaging/v1/orders/{amazonOrderId}/messages/invoice';
2889+
$formParams = [];
2890+
$queryParams = [];
2891+
$headerParams = [];
2892+
$multipart = false;
2893+
$query = '';
2894+
2895+
// query params
2896+
if (\is_array($marketplace_ids)) {
2897+
$marketplace_ids = ObjectSerializer::serializeCollection($marketplace_ids, 'form', true);
2898+
}
2899+
2900+
if ($marketplace_ids !== null) {
2901+
$queryParams['marketplaceIds'] = ObjectSerializer::toString($marketplace_ids);
2902+
}
2903+
2904+
if (\count($queryParams)) {
2905+
$query = \http_build_query($queryParams);
2906+
}
2907+
2908+
// path params
2909+
if ($amazon_order_id !== null) {
2910+
$resourcePath = \str_replace(
2911+
'{' . 'amazonOrderId' . '}',
2912+
ObjectSerializer::toPathValue($amazon_order_id),
2913+
$resourcePath
2914+
);
2915+
}
2916+
2917+
if ($multipart) {
2918+
$headers = [
2919+
'accept' => ['application/json'],
2920+
'host' => [$this->configuration->apiHost($region)],
2921+
'user-agent' => [$this->configuration->userAgent()],
2922+
];
2923+
} else {
2924+
$headers = [
2925+
'content-type' => ['application/json'],
2926+
'accept' => ['application/json'],
2927+
'host' => [$this->configuration->apiHost($region)],
2928+
'user-agent' => [$this->configuration->userAgent()],
2929+
];
2930+
}
2931+
2932+
$request = $this->httpFactory->createRequest(
2933+
'POST',
2934+
$this->configuration->apiURL($region) . $resourcePath . '?' . $query
2935+
);
2936+
2937+
// for model (json/xml)
2938+
if (isset($body)) {
2939+
if ($headers['content-type'] === ['application/json']) {
2940+
$httpBody = \json_encode(ObjectSerializer::sanitizeForSerialization($body), JSON_THROW_ON_ERROR);
2941+
} else {
2942+
$httpBody = $body;
2943+
}
2944+
2945+
$request = $request->withBody($this->httpFactory->createStreamFromString($httpBody));
2946+
} elseif (\count($formParams) > 0) {
2947+
if ($multipart) {
2948+
$multipartContents = [];
2949+
2950+
foreach ($formParams as $formParamName => $formParamValue) {
2951+
$formParamValueItems = \is_array($formParamValue) ? $formParamValue : [$formParamValue];
2952+
2953+
foreach ($formParamValueItems as $formParamValueItem) {
2954+
$multipartContents[] = [
2955+
'name' => $formParamName,
2956+
'contents' => $formParamValueItem,
2957+
];
2958+
}
2959+
}
2960+
$request = $request->withParsedBody($multipartContents);
2961+
} elseif ($headers['content-type'] === ['application/json']) {
2962+
$request = $request->withBody($this->httpFactory->createStreamFromString(\json_encode($formParams, JSON_THROW_ON_ERROR)));
2963+
} else {
2964+
$request = $request->withParsedBody($formParams);
2965+
}
2966+
}
2967+
2968+
foreach (\array_merge($headerParams, $headers) as $name => $header) {
2969+
$request = $request->withHeader($name, $header);
2970+
}
2971+
2972+
return HttpSignatureHeaders::forConfig(
2973+
$this->configuration,
2974+
$accessToken,
2975+
$region,
2976+
$request
2977+
);
2978+
}
27492979
}

src/AmazonPHP/SellingPartner/Api/ShipmentApi/OrdersSDK.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function __construct(ClientInterface $client, HttpFactory $requestFactory
4747
*
4848
* @param AccessToken $accessToken
4949
* @param string $order_id An Amazon-defined order identifier, in 3-7-7 format. (required)
50-
* @param \AmazonPHP\SellingPartner\Model\Orders\UpdateShipmentStatusRequest $payload Request to update the shipment status. (required)
50+
* @param \AmazonPHP\SellingPartner\Model\Orders\UpdateShipmentStatusRequest $payload The request body for the updateShipmentStatus operation. (required)
5151
*
5252
* @throws \AmazonPHP\SellingPartner\Exception\ApiException on non-2xx response
5353
* @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
@@ -139,7 +139,7 @@ public function updateShipmentStatus(AccessToken $accessToken, string $region, s
139139
*
140140
* @param AccessToken $accessToken
141141
* @param string $order_id An Amazon-defined order identifier, in 3-7-7 format. (required)
142-
* @param \AmazonPHP\SellingPartner\Model\Orders\UpdateShipmentStatusRequest $payload Request to update the shipment status. (required)
142+
* @param \AmazonPHP\SellingPartner\Model\Orders\UpdateShipmentStatusRequest $payload The request body for the updateShipmentStatus operation. (required)
143143
*
144144
* @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException
145145
*/

src/AmazonPHP/SellingPartner/Api/UploadsApi/UploadsSDK.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function __construct(ClientInterface $client, HttpFactory $requestFactory
4848
* @param AccessToken $accessToken
4949
* @param string[] $marketplace_ids A list of marketplace identifiers. This specifies the marketplaces where the upload will be available. Only one marketplace can be specified. (required)
5050
* @param string $content_md5 An MD5 hash of the content to be submitted to the upload destination. This value is used to determine if the data has been corrupted or tampered with during transit. (required)
51-
* @param string $resource The resource for the upload destination that you are creating. For example, if you are creating an upload destination for the createLegalDisclosure operation of the Messaging API, the {resource} would be /messaging/v1/orders/{amazonOrderId}/messages/legalDisclosure, and the entire path would be /uploads/2020-11-01/uploadDestinations/messaging/v1/orders/{amazonOrderId}/messages/legalDisclosure. (required)
51+
* @param string $resource The resource for the upload destination that you are creating. For example, if you are creating an upload destination for the createLegalDisclosure operation of the Messaging API, the &#x60;{resource}&#x60; would be &#x60;/messaging/v1/orders/{amazonOrderId}/messages/legalDisclosure&#x60;, and the entire path would be &#x60;/uploads/2020-11-01/uploadDestinations/messaging/v1/orders/{amazonOrderId}/messages/legalDisclosure&#x60;. If you are creating an upload destination for an Aplus content document, the &#x60;{resource}&#x60; would be &#x60;aplus/2020-11-01/contentDocuments&#x60; and the path would be &#x60;/uploads/v1/uploadDestinations/aplus/2020-11-01/contentDocuments&#x60;. (required)
5252
* @param string $content_type The content type of the file to be uploaded. (optional)
5353
*
5454
* @throws \AmazonPHP\SellingPartner\Exception\ApiException on non-2xx response
@@ -147,7 +147,7 @@ public function createUploadDestinationForResource(AccessToken $accessToken, str
147147
* @param AccessToken $accessToken
148148
* @param string[] $marketplace_ids A list of marketplace identifiers. This specifies the marketplaces where the upload will be available. Only one marketplace can be specified. (required)
149149
* @param string $content_md5 An MD5 hash of the content to be submitted to the upload destination. This value is used to determine if the data has been corrupted or tampered with during transit. (required)
150-
* @param string $resource The resource for the upload destination that you are creating. For example, if you are creating an upload destination for the createLegalDisclosure operation of the Messaging API, the {resource} would be /messaging/v1/orders/{amazonOrderId}/messages/legalDisclosure, and the entire path would be /uploads/2020-11-01/uploadDestinations/messaging/v1/orders/{amazonOrderId}/messages/legalDisclosure. (required)
150+
* @param string $resource The resource for the upload destination that you are creating. For example, if you are creating an upload destination for the createLegalDisclosure operation of the Messaging API, the &#x60;{resource}&#x60; would be &#x60;/messaging/v1/orders/{amazonOrderId}/messages/legalDisclosure&#x60;, and the entire path would be &#x60;/uploads/2020-11-01/uploadDestinations/messaging/v1/orders/{amazonOrderId}/messages/legalDisclosure&#x60;. If you are creating an upload destination for an Aplus content document, the &#x60;{resource}&#x60; would be &#x60;aplus/2020-11-01/contentDocuments&#x60; and the path would be &#x60;/uploads/v1/uploadDestinations/aplus/2020-11-01/contentDocuments&#x60;. (required)
151151
* @param string $content_type The content type of the file to be uploaded. (optional)
152152
*
153153
* @throws \AmazonPHP\SellingPartner\Exception\InvalidArgumentException

src/AmazonPHP/SellingPartner/Model/APlus/AplusPaginatedResponse.php

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,4 @@
11
<?php declare(strict_types=1);
2-
/**
3-
* AplusPaginatedResponse.
4-
*
5-
* PHP version 7.4
6-
*
7-
* @category Class
8-
*
9-
* @author OpenAPI Generator team
10-
*
11-
* @link https://openapi-generator.tech
12-
*/
13-
14-
/**
15-
* Selling Partner API for A+ Content Management.
16-
*
17-
* With the A+ Content API, you can build applications that help selling partners add rich marketing content to their Amazon product detail pages. A+ content helps selling partners share their brand and product story, which helps buyers make informed purchasing decisions. Selling partners assemble content by choosing from content modules and adding images and text.
18-
*
19-
* The version of the OpenAPI document: 2020-11-01
20-
* Generated by: https://openapi-generator.tech
21-
* OpenAPI Generator version: 6.0.1-SNAPSHOT
22-
*/
23-
24-
/**
25-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
26-
* https://openapi-generator.tech
27-
* Do not edit the class manually.
28-
*/
292

303
namespace AmazonPHP\SellingPartner\Model\APlus;
314

src/AmazonPHP/SellingPartner/Model/APlus/AplusPaginatedResponseAllOf.php

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,4 @@
11
<?php declare(strict_types=1);
2-
/**
3-
* AplusPaginatedResponseAllOf.
4-
*
5-
* PHP version 7.4
6-
*
7-
* @category Class
8-
*
9-
* @author OpenAPI Generator team
10-
*
11-
* @link https://openapi-generator.tech
12-
*/
13-
14-
/**
15-
* Selling Partner API for A+ Content Management.
16-
*
17-
* With the A+ Content API, you can build applications that help selling partners add rich marketing content to their Amazon product detail pages. A+ content helps selling partners share their brand and product story, which helps buyers make informed purchasing decisions. Selling partners assemble content by choosing from content modules and adding images and text.
18-
*
19-
* The version of the OpenAPI document: 2020-11-01
20-
* Generated by: https://openapi-generator.tech
21-
* OpenAPI Generator version: 6.0.1-SNAPSHOT
22-
*/
23-
24-
/**
25-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
26-
* https://openapi-generator.tech
27-
* Do not edit the class manually.
28-
*/
292

303
namespace AmazonPHP\SellingPartner\Model\APlus;
314

0 commit comments

Comments
 (0)