-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from MyParcelCOM/feature/shipments
✨ Implemented shipments endpoints
- Loading branch information
Showing
25 changed files
with
1,987 additions
and
191 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,140 @@ | ||
<?php | ||
|
||
namespace MyParcelCom\Sdk\Resources\Proxy; | ||
|
||
use MyParcelCom\Sdk\Resources\Interfaces\RegionInterface; | ||
use MyParcelCom\Sdk\Resources\Interfaces\ResourceInterface; | ||
use MyParcelCom\Sdk\Resources\Interfaces\ResourceProxyInterface; | ||
use MyParcelCom\Sdk\Resources\Traits\JsonSerializable; | ||
use MyParcelCom\Sdk\Resources\Traits\ProxiesResource; | ||
|
||
class RegionProxy implements RegionInterface, ResourceProxyInterface | ||
{ | ||
use JsonSerializable; | ||
use ProxiesResource; | ||
|
||
/** @var string */ | ||
private $id; | ||
/** @var string */ | ||
private $type = ResourceInterface::TYPE_REGION; | ||
|
||
/** | ||
* Set the identifier for this file. | ||
* | ||
* @param string $id | ||
* @return $this | ||
*/ | ||
public function setId($id) | ||
{ | ||
$this->id = $id; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getId() | ||
{ | ||
return $this->id; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getType() | ||
{ | ||
return $this->type; | ||
} | ||
|
||
/** | ||
* @param string $countryCode | ||
* @return $this | ||
*/ | ||
public function setCountryCode($countryCode) | ||
{ | ||
$this->getResource()->setCountryCode($countryCode); | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getCountryCode() | ||
{ | ||
return $this->getResource()->getCountryCode(); | ||
} | ||
|
||
/** | ||
* @param string $regionCode | ||
* @return $this | ||
*/ | ||
public function setRegionCode($regionCode) | ||
{ | ||
$this->getResource()->setRegionCode($regionCode); | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getRegionCode() | ||
{ | ||
return $this->getResource()->getRegionCode(); | ||
} | ||
|
||
/** | ||
* @param string $currency | ||
* @return $this | ||
*/ | ||
public function setCurrency($currency) | ||
{ | ||
$this->getResource()->setCurrency($currency); | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getCurrency() | ||
{ | ||
return $this->getResource()->getCurrency(); | ||
} | ||
|
||
/** | ||
* | ||
* @param string $name | ||
* @return $this | ||
*/ | ||
public function setName($name) | ||
{ | ||
$this->getResource()->setName($name); | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getName() | ||
{ | ||
return $this->getResource()->getName(); | ||
} | ||
|
||
/** | ||
* This function puts all object properties in an array and returns it. | ||
* | ||
* @return array | ||
*/ | ||
public function jsonSerialize() | ||
{ | ||
$values = get_object_vars($this); | ||
unset($values['resource']); | ||
unset($values['api']); | ||
|
||
return $this->arrayValuesToArray($values); | ||
} | ||
} |
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,161 @@ | ||
<?php | ||
|
||
namespace MyParcelCom\Sdk\Resources\Proxy; | ||
|
||
use DateTime; | ||
use MyParcelCom\Sdk\Resources\Interfaces\AddressInterface; | ||
use MyParcelCom\Sdk\Resources\Interfaces\RegionInterface; | ||
use MyParcelCom\Sdk\Resources\Interfaces\ResourceInterface; | ||
use MyParcelCom\Sdk\Resources\Interfaces\ResourceProxyInterface; | ||
use MyParcelCom\Sdk\Resources\Interfaces\ShopInterface; | ||
use MyParcelCom\Sdk\Resources\Traits\JsonSerializable; | ||
use MyParcelCom\Sdk\Resources\Traits\ProxiesResource; | ||
|
||
class ShopProxy implements ShopInterface, ResourceProxyInterface | ||
{ | ||
use JsonSerializable; | ||
use ProxiesResource; | ||
|
||
/** @var string */ | ||
private $id; | ||
/** @var string */ | ||
private $type = ResourceInterface::TYPE_SHOP; | ||
|
||
/** | ||
* Set the identifier for this file. | ||
* | ||
* @param string $id | ||
* @return $this | ||
*/ | ||
public function setId($id) | ||
{ | ||
$this->id = $id; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getId() | ||
{ | ||
return $this->id; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getType() | ||
{ | ||
return $this->type; | ||
} | ||
|
||
/** | ||
* @param $name | ||
* @return $this | ||
*/ | ||
public function setName($name) | ||
{ | ||
$this->getResource()->setName($name); | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getName() | ||
{ | ||
return $this->getResource()->getName(); | ||
} | ||
|
||
/** | ||
* @param AddressInterface $billingAddress | ||
* @return $this | ||
*/ | ||
public function setBillingAddress(AddressInterface $billingAddress) | ||
{ | ||
$this->getResource()->setBillingAddress($billingAddress); | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @return AddressInterface | ||
*/ | ||
public function getBillingAddress() | ||
{ | ||
return $this->getResource()->getBillingAddress(); | ||
} | ||
|
||
/** | ||
* @param AddressInterface $returnAddress | ||
* @return $this | ||
*/ | ||
public function setReturnAddress(AddressInterface $returnAddress) | ||
{ | ||
$this->getResource()->setReturnAddress($returnAddress); | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @return AddressInterface | ||
*/ | ||
public function getReturnAddress() | ||
{ | ||
return $this->getResource()->getReturnAddress(); | ||
} | ||
|
||
/** | ||
* @param RegionInterface $region | ||
* @return $this | ||
*/ | ||
public function setRegion(RegionInterface $region) | ||
{ | ||
$this->getResource()->setRegion($region); | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @return RegionInterface | ||
*/ | ||
public function getRegion() | ||
{ | ||
return $this->getResource()->getRegion(); | ||
} | ||
|
||
/** | ||
* @param int|DateTime $time | ||
* @return $this | ||
*/ | ||
public function setCreatedAt($time) | ||
{ | ||
$this->getResource()->setCreatedAt($time); | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* @return DateTime | ||
*/ | ||
public function getCreatedAt() | ||
{ | ||
return $this->getResource()->getCreatedAt(); | ||
} | ||
|
||
/** | ||
* This function puts all object properties in an array and returns it. | ||
* | ||
* @return array | ||
*/ | ||
public function jsonSerialize() | ||
{ | ||
$values = get_object_vars($this); | ||
unset($values['resource']); | ||
unset($values['api']); | ||
|
||
return $this->arrayValuesToArray($values); | ||
} | ||
} |
Oops, something went wrong.