Skip to content

ChangeOrderRequest: can't send ShipOrder data #7

@emanuelefantin

Description

@emanuelefantin

As written in issue #4 it's impossible to send a "ShipOrder" request (don't know why was closed and not resolved).
Here is the full class that I use now, rewritten with corrections and working (package is Beezup, because Swagger collided with other libraries):

`<?php

/**

namespace Beezup\Client\Model;

use \ArrayAccess;
use \Beezup\Client\ObjectSerializer;

/**

  • ChangeOrderRequest Class Doc Comment

  • @category Class

  • @description All properties with the prefix order_ are translated in the list of values /user/lov#OrderMetaInfoPosted

  • @Package Beezup\Client

  • @author Beezup Codegen team

  • @link https://github.com/swagger-api/swagger-codegen
    */
    class ChangeOrderRequest implements ModelInterface, ArrayAccess
    {
    const DISCRIMINATOR = null;

    /**

    • The original name of the model.
    • @var string
      */
      protected static $swaggerModelName = 'changeOrderRequest';

    /**

    • Array of property to type mappings. Used for (de)serialization
    • @var string[]
      */
      protected static $swaggerTypes = [
      'order_shipping_method' => 'string',
      'order_shipping_fulfillment_date' => 'DateTime',
      'order_shipping_estimated_delivery_date' => 'DateTime',
      'order_shipping_shipper_tracking_number' => 'string',
      'order_shipping_shipping_url' => 'string',
      'order_shipping_carrier_name' => 'string'
      ];

    /**

    • Array of property to format mappings. Used for (de)serialization
    • @var string[]
      */
      protected static $swaggerFormats = [
      'order_shipping_method' => null,
      'order_shipping_fulfillment_date' => null,
      'order_shipping_estimated_delivery_date' => null,
      'order_shipping_shipper_tracking_number' => null,
      'order_shipping_shipping_url' => null,
      'order_shipping_carrier_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 = [
      'order_shipping_method' => 'order_Shipping_Method',
      'order_shipping_fulfillment_date' => 'order_Shipping_FulfillmentDate',
      'order_shipping_estimated_delivery_date' => 'order_Shipping_EstimatedDeliveryDate',
      'order_shipping_shipper_tracking_number' => 'order_Shipping_ShipperTrackingNumber',
      'order_shipping_shipping_url' => 'order_Shipping_ShippingUrl',
      'order_shipping_carrier_name' => 'order_Shipping_CarrierName'
      ];

    /**

    • Array of attributes to setter functions (for deserialization of responses)
    • @var string[]
      */
      protected static $setters = [
      'order_shipping_method' => 'setOrderShippingMethod',
      'order_shipping_fulfillment_date' => 'setOrderShippingFulfillmentDate',
      'order_shipping_estimated_delivery_date' => 'setOrderShippingEstimatedDeliveryDate',
      'order_shipping_shipper_tracking_number' => 'setOrderShippingShipperTrackingNumber',
      'order_shipping_shipping_url' => 'setOrderShippingShippingUrl',
      'order_shipping_carrier_name' => 'setOrderShippingCarrierName'
      ];

    /**

    • Array of attributes to getter functions (for serialization of requests)
    • @var string[]
      */
      protected static $getters = [
      'order_shipping_method' => 'getOrderShippingMethod',
      'order_shipping_fulfillment_date' => 'getOrderShippingFulfillmentDate',
      'order_shipping_estimated_delivery_date' => 'getOrderShippingEstimatedDeliveryDate',
      'order_shipping_shipper_tracking_number' => 'getOrderShippingShipperTrackingNumber',
      'order_shipping_shipping_url' => 'getOrderShippingShippingUrl',
      'order_shipping_carrier_name' => 'getOrderShippingCarrierName'
      ];

    /**

    • 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)
    {
    }

    /**

    • Show all the invalid properties with reasons.

    • @return array invalid properties with reasons
      */
      public function listInvalidProperties()
      {
      $invalidProperties = parent::listInvalidProperties();

      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()
      {
      if (!parent::valid()) {
      return false;
      }

      return true;
      }

    /**

    • 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));
      }

    /**

    • Set order_Shipping_Method
    • @param string $data
    • @return void
      */
      public function setOrderShippingMethod($data)
      {
      if (empty($data)) {
      return $this;
      }
      $this->container['order_Shipping_Method'] = $data;
      return $this;
      }

    /**

    • Get order_Shipping_Method
    • @return string
      */
      public function getOrderShippingMethod()
      {
      return $this->container['order_Shipping_Method'];
      }

    /**

    • Set order_Shipping_FulfillmentDate
    • @param string $data
    • @return void
      */
      public function setOrderShippingFulfillmentDate($data)
      {
      if (empty($data)) {
      return $this;
      }
      $this->container['order_Shipping_FulfillmentDate'] = $data;
      return $this;
      }

    /**

    • Get order_Shipping_FulfillmentDate
    • @return string
      */
      public function getOrderShippingFulfillmentDate()
      {
      return $this->container['order_Shipping_FulfillmentDate'];
      }

    /**

    • Set order_Shipping_EstimatedDeliveryDate
    • @param string $data
    • @return void
      */
      public function setOrderShippingEstimatedDeliveryDate($data)
      {
      if (empty($data)) {
      return $this;
      }
      $this->container['order_Shipping_EstimatedDeliveryDate'] = $data;
      return $this;
      }

    /**

    • Get order_Shipping_EstimatedDeliveryDate
    • @return string
      */
      public function getOrderShippingEstimatedDeliveryDate()
      {
      return $this->container['order_Shipping_EstimatedDeliveryDate'];
      }

    /**

    • Set order_Shipping_ShipperTrackingNumber
    • @param string $data
    • @return void
      */
      public function setOrderShippingShipperTrackingNumber($data)
      {
      if (empty($data)) {
      return $this;
      }
      $this->container['order_Shipping_ShipperTrackingNumber'] = $data;
      return $this;
      }

    /**

    • Get order_Shipping_ShipperTrackingNumber
    • @return string
      */
      public function getOrderShippingShipperTrackingNumber()
      {
      return $this->container['order_Shipping_ShipperTrackingNumber'];
      }

    /**

    • Set order_Shipping_ShippingUrl
    • @param string $data
    • @return void
      */
      public function setOrderShippingShippingUrl($data)
      {
      if (empty($data)) {
      return $this;
      }
      $this->container['order_Shipping_ShippingUrl'] = $data;
      return $this;
      }

    /**

    • Get order_Shipping_ShippingUrl
    • @return string
      */
      public function getOrderShippingShippingUrl()
      {
      return $this->container['order_Shipping_ShippingUrl'];
      }

    /**

    • Set order_Shipping_CarrierName
    • @param string $data
    • @return void
      */
      public function setOrderShippingCarrierName($data)
      {
      if (empty($data)) {
      return $this;
      }
      $this->container['order_Shipping_CarrierName'] = $data;
      return $this;
      }

    /**

    • Get order_Shipping_CarrierName
    • @return string
      */
      public function getOrderShippingCarrierName()
      {
      return $this->container['order_Shipping_CarrierName'];
      }
      }
      `

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions