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

Commit 42714ad

Browse files
author
David T. Sadler
committed
Merge branch 'develop'
2 parents fefee1b + a7884cb commit 42714ad

Some content is hidden

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

43 files changed

+1871
-1
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# CHANGELOG
22

3+
## 18.0.0 - 2018-06-28
4+
5+
### Features
6+
7+
* Support Compliance API version v1.1.0
8+
9+
### Fixes
10+
11+
* Ensure type attribute exist for ProductID.
12+
313
## 17.0.0 - 2018-06-12
414

515
### Features

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ sync_catalog:
103103
rsync -rtvu --delete --exclude *BaseService.php ../ebay-api-sdk-php/dist/Catalog/src/Catalog/ src/Catalog/
104104
rsync -rtvu --delete --exclude /Mocks/ --exclude /Services/ ../ebay-api-sdk-php/dist/Catalog/test/Catalog/ test/Catalog/
105105

106+
sync_compliance:
107+
rsync -rtvu --delete --exclude *BaseService.php ../ebay-api-sdk-php/dist/Compliance/src/Compliance/ src/Compliance/
108+
rsync -rtvu --delete --exclude /Mocks/ --exclude /Services/ ../ebay-api-sdk-php/dist/Compliance/test/Compliance/ test/Compliance/
109+
106110
sync_feed:
107111
rsync -rtvu --delete --exclude *BaseService.php ../ebay-api-sdk-php/dist/Feed/src/Feed/ src/Feed/
108112
rsync -rtvu --delete --exclude /Mocks/ --exclude /Services/ ../ebay-api-sdk-php/dist/Feed/test/Feed/ test/Feed/
@@ -195,6 +199,7 @@ sync_all: sync_account \
195199
sync_bulk \
196200
sync_bus \
197201
sync_catalog \
202+
sync_compliance \
198203
sync_feedback \
199204
sync_file \
200205
sync_finding \
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
/**
3+
* DO NOT EDIT THIS FILE!
4+
*
5+
* This file was automatically generated from external sources.
6+
*
7+
* Any manual change here will be lost the next time the SDK
8+
* is updated. You've been warned!
9+
*/
10+
11+
namespace DTS\eBaySDK\Compliance\Enums;
12+
13+
class ComplianceTypeEnum
14+
{
15+
const C_HTTPS = 'HTTPS';
16+
const C_OUTSIDE_EBAY_BUYING_AND_SELLING = 'OUTSIDE_EBAY_BUYING_AND_SELLING';
17+
const C_PRODUCT_ADOPTION = 'PRODUCT_ADOPTION';
18+
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?php
2+
/**
3+
* DO NOT EDIT THIS FILE!
4+
*
5+
* This file was automatically generated from external sources.
6+
*
7+
* Any manual change here will be lost the next time the SDK
8+
* is updated. You've been warned!
9+
*/
10+
11+
namespace DTS\eBaySDK\Compliance\Enums;
12+
13+
class MarketplaceIdEnum
14+
{
15+
const C_EBAY_AT = 'EBAY_AT';
16+
const C_EBAY_AU = 'EBAY_AU';
17+
const C_EBAY_BE = 'EBAY_BE';
18+
const C_EBAY_CA = 'EBAY_CA';
19+
const C_EBAY_CH = 'EBAY_CH';
20+
const C_EBAY_CN = 'EBAY_CN';
21+
const C_EBAY_CZ = 'EBAY_CZ';
22+
const C_EBAY_DE = 'EBAY_DE';
23+
const C_EBAY_DK = 'EBAY_DK';
24+
const C_EBAY_ES = 'EBAY_ES';
25+
const C_EBAY_FI = 'EBAY_FI';
26+
const C_EBAY_FR = 'EBAY_FR';
27+
const C_EBAY_GB = 'EBAY_GB';
28+
const C_EBAY_GR = 'EBAY_GR';
29+
const C_EBAY_HALF_US = 'EBAY_HALF_US';
30+
const C_EBAY_HK = 'EBAY_HK';
31+
const C_EBAY_HU = 'EBAY_HU';
32+
const C_EBAY_ID = 'EBAY_ID';
33+
const C_EBAY_IE = 'EBAY_IE';
34+
const C_EBAY_IL = 'EBAY_IL';
35+
const C_EBAY_IN = 'EBAY_IN';
36+
const C_EBAY_IT = 'EBAY_IT';
37+
const C_EBAY_JP = 'EBAY_JP';
38+
const C_EBAY_MOTORS_US = 'EBAY_MOTORS_US';
39+
const C_EBAY_MY = 'EBAY_MY';
40+
const C_EBAY_NL = 'EBAY_NL';
41+
const C_EBAY_NO = 'EBAY_NO';
42+
const C_EBAY_NZ = 'EBAY_NZ';
43+
const C_EBAY_PE = 'EBAY_PE';
44+
const C_EBAY_PH = 'EBAY_PH';
45+
const C_EBAY_PL = 'EBAY_PL';
46+
const C_EBAY_PR = 'EBAY_PR';
47+
const C_EBAY_PT = 'EBAY_PT';
48+
const C_EBAY_RU = 'EBAY_RU';
49+
const C_EBAY_SE = 'EBAY_SE';
50+
const C_EBAY_SG = 'EBAY_SG';
51+
const C_EBAY_TH = 'EBAY_TH';
52+
const C_EBAY_TW = 'EBAY_TW';
53+
const C_EBAY_US = 'EBAY_US';
54+
const C_EBAY_VN = 'EBAY_VN';
55+
const C_EBAY_ZA = 'EBAY_ZA';
56+
}
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
<?php
2+
namespace DTS\eBaySDK\Compliance\Services;
3+
4+
/**
5+
* Base class for the Compliance service.
6+
*/
7+
class ComplianceBaseService extends \DTS\eBaySDK\Services\BaseRestService
8+
{
9+
/**
10+
* @var array $endPoints The API endpoints.
11+
*/
12+
protected static $endPoints = [
13+
'sandbox' => 'https://api.sandbox.ebay.com/sell/compliance',
14+
'production' => 'https://api.ebay.com/sell/compliance'
15+
];
16+
17+
/**
18+
* HTTP header constant. The Authentication Token that is used to validate the caller has permission to access the eBay servers.
19+
*/
20+
const HDR_AUTHORIZATION = 'Authorization';
21+
22+
/**
23+
* HTTP header constant. The global ID of the eBay site on which the transaction took place.
24+
*/
25+
const HDR_MARKETPLACE_ID = 'X-EBAY-C-MARKETPLACE-ID';
26+
27+
/**
28+
* @param array $config Configuration option values.
29+
*/
30+
public function __construct(array $config)
31+
{
32+
parent::__construct($config);
33+
}
34+
35+
/**
36+
* Returns definitions for each configuration option that is supported.
37+
*
38+
* @return array An associative array of configuration definitions.
39+
*/
40+
public static function getConfigDefinitions()
41+
{
42+
$definitions = parent::getConfigDefinitions();
43+
44+
return $definitions + [
45+
'apiVersion' => [
46+
'valid' => ['string'],
47+
'default' => \DTS\eBaySDK\Compliance\Services\ComplianceService::API_VERSION,
48+
'required' => true
49+
],
50+
'authorization' => [
51+
'valid' => ['string'],
52+
'required' => true
53+
],
54+
'marketplaceId' => [
55+
'valid' => ['string']
56+
]
57+
];
58+
}
59+
60+
/**
61+
* Builds the needed eBay HTTP headers.
62+
*
63+
* @return array An associative array of eBay HTTP headers.
64+
*/
65+
protected function getEbayHeaders()
66+
{
67+
$headers = [];
68+
69+
// Add required headers first.
70+
$headers[self::HDR_AUTHORIZATION] = 'Bearer '.$this->getConfig('authorization');
71+
72+
// Add optional headers.
73+
if ($this->getConfig('marketplaceId')) {
74+
$headers[self::HDR_MARKETPLACE_ID] = $this->getConfig('marketplaceId');
75+
}
76+
77+
return $headers;
78+
}
79+
}
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
<?php
2+
/**
3+
* DO NOT EDIT THIS FILE!
4+
*
5+
* This file was automatically generated from external sources.
6+
*
7+
* Any manual change here will be lost the next time the SDK
8+
* is updated. You've been warned!
9+
*/
10+
11+
namespace DTS\eBaySDK\Compliance\Services;
12+
13+
class ComplianceService extends \DTS\eBaySDK\Compliance\Services\ComplianceBaseService
14+
{
15+
const API_VERSION = 'v1';
16+
17+
/**
18+
* @property array $operations Associative array of operations provided by the service.
19+
*/
20+
protected static $operations = [
21+
'GetListingViolationsSummary' => [
22+
'method' => 'GET',
23+
'resource' => 'listing_violation_summary',
24+
'responseClass' => '\DTS\eBaySDK\Compliance\Types\GetListingViolationsSummaryRestResponse',
25+
'params' => [
26+
'compliance_type' => [
27+
'valid' => ['string']
28+
]
29+
]
30+
],
31+
'GetListingViolations' => [
32+
'method' => 'GET',
33+
'resource' => 'listing_violation',
34+
'responseClass' => '\DTS\eBaySDK\Compliance\Types\GetListingViolationsRestResponse',
35+
'params' => [
36+
'limit' => [
37+
'valid' => ['integer']
38+
],
39+
'listing_id' => [
40+
'valid' => ['string']
41+
],
42+
'offset' => [
43+
'valid' => ['integer']
44+
],
45+
'compliance_type' => [
46+
'valid' => ['string']
47+
]
48+
]
49+
]
50+
];
51+
52+
/**
53+
* @param array $config Configuration option values.
54+
*/
55+
public function __construct(array $config = [])
56+
{
57+
parent::__construct($config);
58+
}
59+
60+
/**
61+
* @param \DTS\eBaySDK\Compliance\Types\GetListingViolationsSummaryRestRequest $request
62+
* @return \DTS\eBaySDK\Compliance\Types\GetListingViolationsSummaryRestResponse
63+
*/
64+
public function getListingViolationsSummary(\DTS\eBaySDK\Compliance\Types\GetListingViolationsSummaryRestRequest $request)
65+
{
66+
return $this->getListingViolationsSummaryAsync($request)->wait();
67+
}
68+
69+
/**
70+
* @param \DTS\eBaySDK\Compliance\Types\GetListingViolationsSummaryRestRequest $request
71+
* @return \GuzzleHttp\Promise\PromiseInterface
72+
*/
73+
public function getListingViolationsSummaryAsync(\DTS\eBaySDK\Compliance\Types\GetListingViolationsSummaryRestRequest $request)
74+
{
75+
return $this->callOperationAsync('GetListingViolationsSummary', $request);
76+
}
77+
78+
/**
79+
* @param \DTS\eBaySDK\Compliance\Types\GetListingViolationsRestRequest $request
80+
* @return \DTS\eBaySDK\Compliance\Types\GetListingViolationsRestResponse
81+
*/
82+
public function getListingViolations(\DTS\eBaySDK\Compliance\Types\GetListingViolationsRestRequest $request)
83+
{
84+
return $this->getListingViolationsAsync($request)->wait();
85+
}
86+
87+
/**
88+
* @param \DTS\eBaySDK\Compliance\Types\GetListingViolationsRestRequest $request
89+
* @return \GuzzleHttp\Promise\PromiseInterface
90+
*/
91+
public function getListingViolationsAsync(\DTS\eBaySDK\Compliance\Types\GetListingViolationsRestRequest $request)
92+
{
93+
return $this->callOperationAsync('GetListingViolations', $request);
94+
}
95+
}
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
<?php
2+
/**
3+
* DO NOT EDIT THIS FILE!
4+
*
5+
* This file was automatically generated from external sources.
6+
*
7+
* Any manual change here will be lost the next time the SDK
8+
* is updated. You've been warned!
9+
*/
10+
11+
namespace DTS\eBaySDK\Compliance\Types;
12+
13+
/**
14+
*
15+
* @property string $reasonCode
16+
* @property string $message
17+
* @property \DTS\eBaySDK\Compliance\Types\VariationDetails $variation
18+
* @property \DTS\eBaySDK\Compliance\Types\NameValueList[] $violationData
19+
* @property \DTS\eBaySDK\Compliance\Types\CorrectiveRecommendations $correctiveRecommendations
20+
*/
21+
class ComplianceDetail extends \DTS\eBaySDK\Types\BaseType
22+
{
23+
/**
24+
* @var array Properties belonging to objects of this class.
25+
*/
26+
private static $propertyTypes = [
27+
'reasonCode' => [
28+
'type' => 'string',
29+
'repeatable' => false,
30+
'attribute' => false,
31+
'elementName' => 'reasonCode'
32+
],
33+
'message' => [
34+
'type' => 'string',
35+
'repeatable' => false,
36+
'attribute' => false,
37+
'elementName' => 'message'
38+
],
39+
'variation' => [
40+
'type' => 'DTS\eBaySDK\Compliance\Types\VariationDetails',
41+
'repeatable' => false,
42+
'attribute' => false,
43+
'elementName' => 'variation'
44+
],
45+
'violationData' => [
46+
'type' => 'DTS\eBaySDK\Compliance\Types\NameValueList',
47+
'repeatable' => true,
48+
'attribute' => false,
49+
'elementName' => 'violationData'
50+
],
51+
'correctiveRecommendations' => [
52+
'type' => 'DTS\eBaySDK\Compliance\Types\CorrectiveRecommendations',
53+
'repeatable' => false,
54+
'attribute' => false,
55+
'elementName' => 'correctiveRecommendations'
56+
]
57+
];
58+
59+
/**
60+
* @param array $values Optional properties and values to assign to the object.
61+
*/
62+
public function __construct(array $values = [])
63+
{
64+
list($parentValues, $childValues) = self::getParentValues(self::$propertyTypes, $values);
65+
66+
parent::__construct($parentValues);
67+
68+
if (!array_key_exists(__CLASS__, self::$properties)) {
69+
self::$properties[__CLASS__] = array_merge(self::$properties[get_parent_class()], self::$propertyTypes);
70+
}
71+
72+
$this->setValues(__CLASS__, $childValues);
73+
}
74+
}

0 commit comments

Comments
 (0)