Skip to content
This repository has been archived by the owner on Jun 13, 2021. It is now read-only.

Commit

Permalink
Merge branch 'release-13.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
David T. Sadler committed Sep 24, 2017
2 parents 00785e2 + 3a4c07e commit 0928850
Show file tree
Hide file tree
Showing 9 changed files with 292 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,11 @@
# CHANGELOG

## 13.1.0 - 2017-09-24

###

* Added withdrawOffer to Inventory service.

## 13.0.3 - 2017-09-07

## Fixes
Expand Down
29 changes: 29 additions & 0 deletions src/Inventory/Services/InventoryService.php
Expand Up @@ -260,6 +260,17 @@ class InventoryService extends \DTS\eBaySDK\Inventory\Services\InventoryBaseServ
]
]
],
'WithdrawOffer' => [
'method' => 'POST',
'resource' => 'offer/{offerId}/withdraw',
'responseClass' => '\DTS\eBaySDK\Inventory\Types\WithdrawOfferRestResponse',
'params' => [
'offerId' => [
'valid' => ['string'],
'required' => true
]
]
],
'UpdateOffer' => [
'method' => 'PUT',
'resource' => 'offer/{offerId}',
Expand Down Expand Up @@ -710,6 +721,24 @@ public function publishOfferAsync(\DTS\eBaySDK\Inventory\Types\PublishOfferRestR
return $this->callOperationAsync('PublishOffer', $request);
}

/**
* @param \DTS\eBaySDK\Inventory\Types\WithdrawOfferRestRequest $request
* @return \DTS\eBaySDK\Inventory\Types\WithdrawOfferRestResponse
*/
public function withdrawOffer(\DTS\eBaySDK\Inventory\Types\WithdrawOfferRestRequest $request)
{
return $this->withdrawOfferAsync($request)->wait();
}

/**
* @param \DTS\eBaySDK\Inventory\Types\WithdrawOfferRestRequest $request
* @return \GuzzleHttp\Promise\PromiseInterface
*/
public function withdrawOfferAsync(\DTS\eBaySDK\Inventory\Types\WithdrawOfferRestRequest $request)
{
return $this->callOperationAsync('WithdrawOffer', $request);
}

/**
* @param \DTS\eBaySDK\Inventory\Types\UpdateOfferRestRequest $request
* @return \DTS\eBaySDK\Inventory\Types\UpdateOfferRestResponse
Expand Down
46 changes: 46 additions & 0 deletions src/Inventory/Types/WithdrawOfferRestRequest.php
@@ -0,0 +1,46 @@
<?php
/**
* DO NOT EDIT THIS FILE!
*
* This file was automatically generated from external sources.
*
* Any manual change here will be lost the next time the SDK
* is updated. You've been warned!
*/

namespace DTS\eBaySDK\Inventory\Types;

/**
*
* @property string $offerId
*/
class WithdrawOfferRestRequest extends \DTS\eBaySDK\Types\BaseType
{
/**
* @var array Properties belonging to objects of this class.
*/
private static $propertyTypes = [
'offerId' => [
'type' => 'string',
'repeatable' => false,
'attribute' => false,
'elementName' => 'offerId'
]
];

/**
* @param array $values Optional properties and values to assign to the object.
*/
public function __construct(array $values = [])
{
list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values);

parent::__construct($parentValues);

if (!array_key_exists(__CLASS__, self::$properties)) {
self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes);
}

$this->setValues(__CLASS__, $childValues);
}
}
65 changes: 65 additions & 0 deletions src/Inventory/Types/WithdrawOfferRestResponse.php
@@ -0,0 +1,65 @@
<?php
/**
* DO NOT EDIT THIS FILE!
*
* This file was automatically generated from external sources.
*
* Any manual change here will be lost the next time the SDK
* is updated. You've been warned!
*/

namespace DTS\eBaySDK\Inventory\Types;

use DTS\eBaySDK\StatusCodeTrait;
use DTS\eBaySDK\HttpHeadersTrait;

/**
*
* @property \DTS\eBaySDK\Inventory\Types\ErrorDetailV3[] $errors
* @property \DTS\eBaySDK\Inventory\Types\ErrorDetailV3[] $warnings
*/
class WithdrawOfferRestResponse extends \DTS\eBaySDK\Inventory\Types\WithdrawResponse
{
use StatusCodeTrait;
use HttpHeadersTrait;

/**
* @var array Properties belonging to objects of this class.
*/
private static $propertyTypes = [
'errors' => [
'type' => 'DTS\eBaySDK\Inventory\Types\ErrorDetailV3',
'repeatable' => true,
'attribute' => false,
'elementName' => 'errors'
],
'warnings' => [
'type' => 'DTS\eBaySDK\Inventory\Types\ErrorDetailV3',
'repeatable' => true,
'attribute' => false,
'elementName' => 'warnings'
]
];

/**
* @param array $values Optional properties and values to assign to the object.
* @param int $statusCode Status code
* @param array $headers HTTP Response headers.
*/
public function __construct(array $values = [], $statusCode = 200, array $headers = [])
{
list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values);

parent::__construct($parentValues);

if (!array_key_exists(__CLASS__, self::$properties)) {
self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes);
}

$this->setValues(__CLASS__, $childValues);

$this->statusCode = (int)$statusCode;

$this->setHeaders($headers);
}
}
46 changes: 46 additions & 0 deletions src/Inventory/Types/WithdrawResponse.php
@@ -0,0 +1,46 @@
<?php
/**
* DO NOT EDIT THIS FILE!
*
* This file was automatically generated from external sources.
*
* Any manual change here will be lost the next time the SDK
* is updated. You've been warned!
*/

namespace DTS\eBaySDK\Inventory\Types;

/**
*
* @property string $listingId
*/
class WithdrawResponse extends \DTS\eBaySDK\Types\BaseType
{
/**
* @var array Properties belonging to objects of this class.
*/
private static $propertyTypes = [
'listingId' => [
'type' => 'string',
'repeatable' => false,
'attribute' => false,
'elementName' => 'listingId'
]
];

/**
* @param array $values Optional properties and values to assign to the object.
*/
public function __construct(array $values = [])
{
list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values);

parent::__construct($parentValues);

if (!array_key_exists(__CLASS__, self::$properties)) {
self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes);
}

$this->setValues(__CLASS__, $childValues);
}
}
2 changes: 1 addition & 1 deletion src/Sdk.php
Expand Up @@ -30,7 +30,7 @@
*/
class Sdk
{
const VERSION = '13.0.3';
const VERSION = '13.1.0';

/**
* @var bool Controls if the SDK should enforce strict types
Expand Down
33 changes: 33 additions & 0 deletions test/Inventory/Types/WithdrawOfferRestRequestTest.php
@@ -0,0 +1,33 @@
<?php
/**
* DO NOT EDIT THIS FILE!
*
* This file was automatically generated from external sources.
*
* Any manual change here will be lost the next time the SDK
* is updated. You've been warned!
*/

namespace DTS\eBaySDK\Test\Inventory\Types;

use DTS\eBaySDK\Inventory\Types\WithdrawOfferRestRequest;

class WithdrawOfferRestRequestTest extends \PHPUnit_Framework_TestCase
{
private $obj;

protected function setUp()
{
$this->obj = new WithdrawOfferRestRequest();
}

public function testCanBeCreated()
{
$this->assertInstanceOf('\DTS\eBaySDK\Inventory\Types\WithdrawOfferRestRequest', $this->obj);
}

public function testExtendsBaseType()
{
$this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj);
}
}
33 changes: 33 additions & 0 deletions test/Inventory/Types/WithdrawOfferRestResponseTest.php
@@ -0,0 +1,33 @@
<?php
/**
* DO NOT EDIT THIS FILE!
*
* This file was automatically generated from external sources.
*
* Any manual change here will be lost the next time the SDK
* is updated. You've been warned!
*/

namespace DTS\eBaySDK\Test\Inventory\Types;

use DTS\eBaySDK\Inventory\Types\WithdrawOfferRestResponse;

class WithdrawOfferRestResponseTest extends \PHPUnit_Framework_TestCase
{
private $obj;

protected function setUp()
{
$this->obj = new WithdrawOfferRestResponse();
}

public function testCanBeCreated()
{
$this->assertInstanceOf('\DTS\eBaySDK\Inventory\Types\WithdrawOfferRestResponse', $this->obj);
}

public function testExtendsWithdrawResponse()
{
$this->assertInstanceOf('\DTS\eBaySDK\Inventory\Types\WithdrawResponse', $this->obj);
}
}
33 changes: 33 additions & 0 deletions test/Inventory/Types/WithdrawResponseTest.php
@@ -0,0 +1,33 @@
<?php
/**
* DO NOT EDIT THIS FILE!
*
* This file was automatically generated from external sources.
*
* Any manual change here will be lost the next time the SDK
* is updated. You've been warned!
*/

namespace DTS\eBaySDK\Test\Inventory\Types;

use DTS\eBaySDK\Inventory\Types\WithdrawResponse;

class WithdrawResponseTest extends \PHPUnit_Framework_TestCase
{
private $obj;

protected function setUp()
{
$this->obj = new WithdrawResponse();
}

public function testCanBeCreated()
{
$this->assertInstanceOf('\DTS\eBaySDK\Inventory\Types\WithdrawResponse', $this->obj);
}

public function testExtendsBaseType()
{
$this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj);
}
}

0 comments on commit 0928850

Please sign in to comment.