Skip to content

Commit

Permalink
Fix ShippingV2 schema, update ObjectSerializer array deserialization (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jlevers committed Jan 20, 2023
1 parent eb21487 commit 1e563ad
Show file tree
Hide file tree
Showing 46 changed files with 430 additions and 233 deletions.
9 changes: 9 additions & 0 deletions docs/Model/ShippingV2/ErrorList.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## ErrorList

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**errors** | [**\SellingPartnerApi\Model\ShippingV2\Error[]**](Error.md) | A list of error responses returned when a request is unsuccessful. | [optional]

[[ShippingV2 Models]](../) [[API list]](../../Api) [[README]](../../../README.md)
378 changes: 189 additions & 189 deletions lib/Api/ShippingV2Api.php

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/Model/ShippingV2/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class Address extends BaseModel implements ModelInterface, ArrayAccess, \JsonSer
* @var string[]
*/
protected static $setters = [
'name' => 'setName',
'name' => 'setName',
'address_line1' => 'setAddressLine1',
'address_line2' => 'setAddressLine2',
'address_line3' => 'setAddressLine3',
Expand Down
2 changes: 1 addition & 1 deletion lib/Model/ShippingV2/AmazonOrderDetails.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class AmazonOrderDetails extends BaseModel implements ModelInterface, ArrayAcces
* @var string[]
*/
protected static $setters = [
'order_id' => 'setOrderId'
'order_id' => 'setOrderId'
];

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/Model/ShippingV2/AmazonShipmentDetails.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class AmazonShipmentDetails extends BaseModel implements ModelInterface, ArrayAc
* @var string[]
*/
protected static $setters = [
'shipment_id' => 'setShipmentId'
'shipment_id' => 'setShipmentId'
];

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/Model/ShippingV2/AvailableValueAddedServiceGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class AvailableValueAddedServiceGroup extends BaseModel implements ModelInterfac
* @var string[]
*/
protected static $setters = [
'group_id' => 'setGroupId',
'group_id' => 'setGroupId',
'group_description' => 'setGroupDescription',
'is_required' => 'setIsRequired',
'value_added_services' => 'setValueAddedServices'
Expand Down
2 changes: 1 addition & 1 deletion lib/Model/ShippingV2/ChannelDetails.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class ChannelDetails extends BaseModel implements ModelInterface, ArrayAccess, \
* @var string[]
*/
protected static $setters = [
'channel_type' => 'setChannelType',
'channel_type' => 'setChannelType',
'amazon_order_details' => 'setAmazonOrderDetails',
'amazon_shipment_details' => 'setAmazonShipmentDetails'
];
Expand Down
2 changes: 1 addition & 1 deletion lib/Model/ShippingV2/ChargeComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class ChargeComponent extends BaseModel implements ModelInterface, ArrayAccess,
* @var string[]
*/
protected static $setters = [
'amount' => 'setAmount',
'amount' => 'setAmount',
'charge_type' => 'setChargeType'
];

Expand Down
2 changes: 1 addition & 1 deletion lib/Model/ShippingV2/CollectOnDelivery.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class CollectOnDelivery extends BaseModel implements ModelInterface, ArrayAccess
* @var string[]
*/
protected static $setters = [
'amount' => 'setAmount'
'amount' => 'setAmount'
];

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/Model/ShippingV2/Currency.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class Currency extends BaseModel implements ModelInterface, ArrayAccess, \JsonSe
* @var string[]
*/
protected static $setters = [
'value' => 'setValue',
'value' => 'setValue',
'unit' => 'setUnit'
];

Expand Down
2 changes: 1 addition & 1 deletion lib/Model/ShippingV2/Dimensions.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class Dimensions extends BaseModel implements ModelInterface, ArrayAccess, \Json
* @var string[]
*/
protected static $setters = [
'length' => 'setLength',
'length' => 'setLength',
'width' => 'setWidth',
'height' => 'setHeight',
'unit' => 'setUnit'
Expand Down
2 changes: 1 addition & 1 deletion lib/Model/ShippingV2/DirectFulfillmentItemIdentifiers.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class DirectFulfillmentItemIdentifiers extends BaseModel implements ModelInterfa
* @var string[]
*/
protected static $setters = [
'line_item_id' => 'setLineItemId',
'line_item_id' => 'setLineItemId',
'piece_number' => 'setPieceNumber'
];

Expand Down
2 changes: 1 addition & 1 deletion lib/Model/ShippingV2/DirectPurchaseRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class DirectPurchaseRequest extends BaseModel implements ModelInterface, ArrayAc
* @var string[]
*/
protected static $setters = [
'ship_to' => 'setShipTo',
'ship_to' => 'setShipTo',
'ship_from' => 'setShipFrom',
'return_to' => 'setReturnTo',
'packages' => 'setPackages',
Expand Down
2 changes: 1 addition & 1 deletion lib/Model/ShippingV2/DirectPurchaseResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class DirectPurchaseResult extends BaseModel implements ModelInterface, ArrayAcc
* @var string[]
*/
protected static $setters = [
'shipment_id' => 'setShipmentId',
'shipment_id' => 'setShipmentId',
'package_document_detail_list' => 'setPackageDocumentDetailList'
];

Expand Down
2 changes: 1 addition & 1 deletion lib/Model/ShippingV2/DocumentSize.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class DocumentSize extends BaseModel implements ModelInterface, ArrayAccess, \Js
* @var string[]
*/
protected static $setters = [
'width' => 'setWidth',
'width' => 'setWidth',
'length' => 'setLength',
'unit' => 'setUnit'
];
Expand Down
2 changes: 1 addition & 1 deletion lib/Model/ShippingV2/Error.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class Error extends BaseModel implements ModelInterface, ArrayAccess, \JsonSeria
* @var string[]
*/
protected static $setters = [
'code' => 'setCode',
'code' => 'setCode',
'message' => 'setMessage',
'details' => 'setDetails'
];
Expand Down
188 changes: 188 additions & 0 deletions lib/Model/ShippingV2/ErrorList.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
<?php
/**
* ErrorList
*
* PHP version 7.3
*
* @category Class
* @package SellingPartnerApi
*/

/**
* Amazon Shipping API
*
* The Amazon Shipping API is designed to support outbound shipping use cases both for orders originating on Amazon-owned marketplaces as well as external channels/marketplaces. With these APIs, you can request shipping rates, create shipments, cancel shipments, and track shipments.
*
* The version of the OpenAPI document: v2
* Contact: [email protected]
* Generated by: https://openapi-generator.tech
* OpenAPI Generator version: 5.0.1
*/

/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/

namespace SellingPartnerApi\Model\ShippingV2;
use ArrayAccess;
use SellingPartnerApi\Model\BaseModel;
use SellingPartnerApi\Model\ModelInterface;
use SellingPartnerApi\ObjectSerializer;

/**
* ErrorList Class Doc Comment
*
* @category Class
* @description A list of error responses returned when a request is unsuccessful.
* @package SellingPartnerApi
* @group
* @implements \ArrayAccess<TKey, TValue>
* @template TKey int|null
* @template TValue mixed|null
*/
class ErrorList extends BaseModel implements ModelInterface, ArrayAccess, \JsonSerializable, \IteratorAggregate
{
public const DISCRIMINATOR = null;

/**
* The original name of the model.
*
* @var string
*/
protected static $openAPIModelName = 'ErrorList';

/**
* Array of property to type mappings. Used for (de)serialization
*
* @var string[]
*/
protected static $openAPITypes = [
'errors' => '\SellingPartnerApi\Model\ShippingV2\Error[]'
];

/**
* Array of property to format mappings. Used for (de)serialization
*
* @var string[]
* @phpstan-var array<string, string|null>
* @psalm-var array<string, string|null>
*/
protected static $openAPIFormats = [
'errors' => null
];



/**
* Array of attributes where the key is the local name,
* and the value is the original name
*
* @var string[]
*/
protected static $attributeMap = [
'headers' => 'headers',
'errors' => 'errors'
];

/**
* Array of attributes to setter functions (for deserialization of responses)
*
* @var string[]
*/
protected static $setters = [
'headers' => 'setHeaders',
'errors' => 'setErrors'
];

/**
* Array of attributes to getter functions (for serialization of requests)
*
* @var string[]
*/
protected static $getters = [
'headers' => 'getHeaders',
'errors' => 'getErrors'
];



/**
* 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['errors'] = $data['errors'] ?? null;
}

/**
* Show all the invalid properties with reasons.
*
* @return array invalid properties with reasons
*/
public function listInvalidProperties()
{
$invalidProperties = [];
return $invalidProperties;
}

/**
* Gets API response headers
*
* @return array[string]
*/
public function getHeaders()
{
return $this->container['headers'];
}

/**
* Sets API response headers (only relevant to response models)
*
* @param array[string => string] $headers Associative array of response headers.
*
* @return self
*/
public function setHeaders($headers)
{
$this->container['headers'] = $headers;
return $this;
}

/**
* Gets errors
*
* @return \SellingPartnerApi\Model\ShippingV2\Error[]|null
*/
public function getErrors()
{
return $this->container['errors'];
}

/**
* Sets errors
*
* @param \SellingPartnerApi\Model\ShippingV2\Error[]|null $errors A list of error responses returned when a request is unsuccessful.
*
* @return self
*/
public function setErrors($errors)
{
$this->container['errors'] = $errors;

return $this;
}
}


2 changes: 1 addition & 1 deletion lib/Model/ShippingV2/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class Event extends BaseModel implements ModelInterface, ArrayAccess, \JsonSeria
* @var string[]
*/
protected static $setters = [
'event_code' => 'setEventCode',
'event_code' => 'setEventCode',
'location' => 'setLocation',
'event_time' => 'setEventTime'
];
Expand Down
2 changes: 1 addition & 1 deletion lib/Model/ShippingV2/GetRatesRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class GetRatesRequest extends BaseModel implements ModelInterface, ArrayAccess,
* @var string[]
*/
protected static $setters = [
'ship_to' => 'setShipTo',
'ship_to' => 'setShipTo',
'ship_from' => 'setShipFrom',
'return_to' => 'setReturnTo',
'ship_date' => 'setShipDate',
Expand Down
2 changes: 1 addition & 1 deletion lib/Model/ShippingV2/GetRatesResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class GetRatesResult extends BaseModel implements ModelInterface, ArrayAccess, \
* @var string[]
*/
protected static $setters = [
'request_token' => 'setRequestToken',
'request_token' => 'setRequestToken',
'rates' => 'setRates',
'ineligible_rates' => 'setIneligibleRates'
];
Expand Down
2 changes: 1 addition & 1 deletion lib/Model/ShippingV2/GetShipmentDocumentsResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class GetShipmentDocumentsResult extends BaseModel implements ModelInterface, Ar
* @var string[]
*/
protected static $setters = [
'shipment_id' => 'setShipmentId',
'shipment_id' => 'setShipmentId',
'package_document_detail' => 'setPackageDocumentDetail'
];

Expand Down
2 changes: 1 addition & 1 deletion lib/Model/ShippingV2/GetTrackingResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class GetTrackingResult extends BaseModel implements ModelInterface, ArrayAccess
* @var string[]
*/
protected static $setters = [
'tracking_id' => 'setTrackingId',
'tracking_id' => 'setTrackingId',
'alternate_leg_tracking_id' => 'setAlternateLegTrackingId',
'event_history' => 'setEventHistory',
'promised_delivery_date' => 'setPromisedDeliveryDate',
Expand Down
2 changes: 1 addition & 1 deletion lib/Model/ShippingV2/IneligibilityReason.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class IneligibilityReason extends BaseModel implements ModelInterface, ArrayAcce
* @var string[]
*/
protected static $setters = [
'code' => 'setCode',
'code' => 'setCode',
'message' => 'setMessage'
];

Expand Down
2 changes: 1 addition & 1 deletion lib/Model/ShippingV2/IneligibleRate.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class IneligibleRate extends BaseModel implements ModelInterface, ArrayAccess, \
* @var string[]
*/
protected static $setters = [
'service_id' => 'setServiceId',
'service_id' => 'setServiceId',
'service_name' => 'setServiceName',
'carrier_name' => 'setCarrierName',
'carrier_id' => 'setCarrierId',
Expand Down
2 changes: 1 addition & 1 deletion lib/Model/ShippingV2/InvoiceDetails.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class InvoiceDetails extends BaseModel implements ModelInterface, ArrayAccess, \
* @var string[]
*/
protected static $setters = [
'invoice_number' => 'setInvoiceNumber',
'invoice_number' => 'setInvoiceNumber',
'invoice_date' => 'setInvoiceDate'
];

Expand Down
Loading

0 comments on commit 1e563ad

Please sign in to comment.