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

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
David T. Sadler committed Jun 28, 2018
2 parents fefee1b + a7884cb commit 42714ad
Show file tree
Hide file tree
Showing 43 changed files with 1,871 additions and 1 deletion.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# CHANGELOG

## 18.0.0 - 2018-06-28

### Features

* Support Compliance API version v1.1.0

### Fixes

* Ensure type attribute exist for ProductID.

## 17.0.0 - 2018-06-12

### Features
Expand Down
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ sync_catalog:
rsync -rtvu --delete --exclude *BaseService.php ../ebay-api-sdk-php/dist/Catalog/src/Catalog/ src/Catalog/
rsync -rtvu --delete --exclude /Mocks/ --exclude /Services/ ../ebay-api-sdk-php/dist/Catalog/test/Catalog/ test/Catalog/

sync_compliance:
rsync -rtvu --delete --exclude *BaseService.php ../ebay-api-sdk-php/dist/Compliance/src/Compliance/ src/Compliance/
rsync -rtvu --delete --exclude /Mocks/ --exclude /Services/ ../ebay-api-sdk-php/dist/Compliance/test/Compliance/ test/Compliance/

sync_feed:
rsync -rtvu --delete --exclude *BaseService.php ../ebay-api-sdk-php/dist/Feed/src/Feed/ src/Feed/
rsync -rtvu --delete --exclude /Mocks/ --exclude /Services/ ../ebay-api-sdk-php/dist/Feed/test/Feed/ test/Feed/
Expand Down Expand Up @@ -195,6 +199,7 @@ sync_all: sync_account \
sync_bulk \
sync_bus \
sync_catalog \
sync_compliance \
sync_feedback \
sync_file \
sync_finding \
Expand Down
18 changes: 18 additions & 0 deletions src/Compliance/Enums/ComplianceTypeEnum.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?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\Compliance\Enums;

class ComplianceTypeEnum
{
const C_HTTPS = 'HTTPS';
const C_OUTSIDE_EBAY_BUYING_AND_SELLING = 'OUTSIDE_EBAY_BUYING_AND_SELLING';
const C_PRODUCT_ADOPTION = 'PRODUCT_ADOPTION';
}
56 changes: 56 additions & 0 deletions src/Compliance/Enums/MarketplaceIdEnum.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?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\Compliance\Enums;

class MarketplaceIdEnum
{
const C_EBAY_AT = 'EBAY_AT';
const C_EBAY_AU = 'EBAY_AU';
const C_EBAY_BE = 'EBAY_BE';
const C_EBAY_CA = 'EBAY_CA';
const C_EBAY_CH = 'EBAY_CH';
const C_EBAY_CN = 'EBAY_CN';
const C_EBAY_CZ = 'EBAY_CZ';
const C_EBAY_DE = 'EBAY_DE';
const C_EBAY_DK = 'EBAY_DK';
const C_EBAY_ES = 'EBAY_ES';
const C_EBAY_FI = 'EBAY_FI';
const C_EBAY_FR = 'EBAY_FR';
const C_EBAY_GB = 'EBAY_GB';
const C_EBAY_GR = 'EBAY_GR';
const C_EBAY_HALF_US = 'EBAY_HALF_US';
const C_EBAY_HK = 'EBAY_HK';
const C_EBAY_HU = 'EBAY_HU';
const C_EBAY_ID = 'EBAY_ID';
const C_EBAY_IE = 'EBAY_IE';
const C_EBAY_IL = 'EBAY_IL';
const C_EBAY_IN = 'EBAY_IN';
const C_EBAY_IT = 'EBAY_IT';
const C_EBAY_JP = 'EBAY_JP';
const C_EBAY_MOTORS_US = 'EBAY_MOTORS_US';
const C_EBAY_MY = 'EBAY_MY';
const C_EBAY_NL = 'EBAY_NL';
const C_EBAY_NO = 'EBAY_NO';
const C_EBAY_NZ = 'EBAY_NZ';
const C_EBAY_PE = 'EBAY_PE';
const C_EBAY_PH = 'EBAY_PH';
const C_EBAY_PL = 'EBAY_PL';
const C_EBAY_PR = 'EBAY_PR';
const C_EBAY_PT = 'EBAY_PT';
const C_EBAY_RU = 'EBAY_RU';
const C_EBAY_SE = 'EBAY_SE';
const C_EBAY_SG = 'EBAY_SG';
const C_EBAY_TH = 'EBAY_TH';
const C_EBAY_TW = 'EBAY_TW';
const C_EBAY_US = 'EBAY_US';
const C_EBAY_VN = 'EBAY_VN';
const C_EBAY_ZA = 'EBAY_ZA';
}
79 changes: 79 additions & 0 deletions src/Compliance/Services/ComplianceBaseService.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?php
namespace DTS\eBaySDK\Compliance\Services;

/**
* Base class for the Compliance service.
*/
class ComplianceBaseService extends \DTS\eBaySDK\Services\BaseRestService
{
/**
* @var array $endPoints The API endpoints.
*/
protected static $endPoints = [
'sandbox' => 'https://api.sandbox.ebay.com/sell/compliance',
'production' => 'https://api.ebay.com/sell/compliance'
];

/**
* HTTP header constant. The Authentication Token that is used to validate the caller has permission to access the eBay servers.
*/
const HDR_AUTHORIZATION = 'Authorization';

/**
* HTTP header constant. The global ID of the eBay site on which the transaction took place.
*/
const HDR_MARKETPLACE_ID = 'X-EBAY-C-MARKETPLACE-ID';

/**
* @param array $config Configuration option values.
*/
public function __construct(array $config)
{
parent::__construct($config);
}

/**
* Returns definitions for each configuration option that is supported.
*
* @return array An associative array of configuration definitions.
*/
public static function getConfigDefinitions()
{
$definitions = parent::getConfigDefinitions();

return $definitions + [
'apiVersion' => [
'valid' => ['string'],
'default' => \DTS\eBaySDK\Compliance\Services\ComplianceService::API_VERSION,
'required' => true
],
'authorization' => [
'valid' => ['string'],
'required' => true
],
'marketplaceId' => [
'valid' => ['string']
]
];
}

/**
* Builds the needed eBay HTTP headers.
*
* @return array An associative array of eBay HTTP headers.
*/
protected function getEbayHeaders()
{
$headers = [];

// Add required headers first.
$headers[self::HDR_AUTHORIZATION] = 'Bearer '.$this->getConfig('authorization');

// Add optional headers.
if ($this->getConfig('marketplaceId')) {
$headers[self::HDR_MARKETPLACE_ID] = $this->getConfig('marketplaceId');
}

return $headers;
}
}
95 changes: 95 additions & 0 deletions src/Compliance/Services/ComplianceService.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
<?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\Compliance\Services;

class ComplianceService extends \DTS\eBaySDK\Compliance\Services\ComplianceBaseService
{
const API_VERSION = 'v1';

/**
* @property array $operations Associative array of operations provided by the service.
*/
protected static $operations = [
'GetListingViolationsSummary' => [
'method' => 'GET',
'resource' => 'listing_violation_summary',
'responseClass' => '\DTS\eBaySDK\Compliance\Types\GetListingViolationsSummaryRestResponse',
'params' => [
'compliance_type' => [
'valid' => ['string']
]
]
],
'GetListingViolations' => [
'method' => 'GET',
'resource' => 'listing_violation',
'responseClass' => '\DTS\eBaySDK\Compliance\Types\GetListingViolationsRestResponse',
'params' => [
'limit' => [
'valid' => ['integer']
],
'listing_id' => [
'valid' => ['string']
],
'offset' => [
'valid' => ['integer']
],
'compliance_type' => [
'valid' => ['string']
]
]
]
];

/**
* @param array $config Configuration option values.
*/
public function __construct(array $config = [])
{
parent::__construct($config);
}

/**
* @param \DTS\eBaySDK\Compliance\Types\GetListingViolationsSummaryRestRequest $request
* @return \DTS\eBaySDK\Compliance\Types\GetListingViolationsSummaryRestResponse
*/
public function getListingViolationsSummary(\DTS\eBaySDK\Compliance\Types\GetListingViolationsSummaryRestRequest $request)
{
return $this->getListingViolationsSummaryAsync($request)->wait();
}

/**
* @param \DTS\eBaySDK\Compliance\Types\GetListingViolationsSummaryRestRequest $request
* @return \GuzzleHttp\Promise\PromiseInterface
*/
public function getListingViolationsSummaryAsync(\DTS\eBaySDK\Compliance\Types\GetListingViolationsSummaryRestRequest $request)
{
return $this->callOperationAsync('GetListingViolationsSummary', $request);
}

/**
* @param \DTS\eBaySDK\Compliance\Types\GetListingViolationsRestRequest $request
* @return \DTS\eBaySDK\Compliance\Types\GetListingViolationsRestResponse
*/
public function getListingViolations(\DTS\eBaySDK\Compliance\Types\GetListingViolationsRestRequest $request)
{
return $this->getListingViolationsAsync($request)->wait();
}

/**
* @param \DTS\eBaySDK\Compliance\Types\GetListingViolationsRestRequest $request
* @return \GuzzleHttp\Promise\PromiseInterface
*/
public function getListingViolationsAsync(\DTS\eBaySDK\Compliance\Types\GetListingViolationsRestRequest $request)
{
return $this->callOperationAsync('GetListingViolations', $request);
}
}
74 changes: 74 additions & 0 deletions src/Compliance/Types/ComplianceDetail.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?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\Compliance\Types;

/**
*
* @property string $reasonCode
* @property string $message
* @property \DTS\eBaySDK\Compliance\Types\VariationDetails $variation
* @property \DTS\eBaySDK\Compliance\Types\NameValueList[] $violationData
* @property \DTS\eBaySDK\Compliance\Types\CorrectiveRecommendations $correctiveRecommendations
*/
class ComplianceDetail extends \DTS\eBaySDK\Types\BaseType
{
/**
* @var array Properties belonging to objects of this class.
*/
private static $propertyTypes = [
'reasonCode' => [
'type' => 'string',
'repeatable' => false,
'attribute' => false,
'elementName' => 'reasonCode'
],
'message' => [
'type' => 'string',
'repeatable' => false,
'attribute' => false,
'elementName' => 'message'
],
'variation' => [
'type' => 'DTS\eBaySDK\Compliance\Types\VariationDetails',
'repeatable' => false,
'attribute' => false,
'elementName' => 'variation'
],
'violationData' => [
'type' => 'DTS\eBaySDK\Compliance\Types\NameValueList',
'repeatable' => true,
'attribute' => false,
'elementName' => 'violationData'
],
'correctiveRecommendations' => [
'type' => 'DTS\eBaySDK\Compliance\Types\CorrectiveRecommendations',
'repeatable' => false,
'attribute' => false,
'elementName' => 'correctiveRecommendations'
]
];

/**
* @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);
}
}
Loading

0 comments on commit 42714ad

Please sign in to comment.