This repository has been archived by the owner on Jun 13, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 346
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
43 changed files
with
1,871 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
Oops, something went wrong.