commercetools-sdk-php-v2  master
The platform, import-api and ml-api PHP sdks generated from our api reference.
ResourceByProjectKeyShippingMethods.php
1 <?php
2 
3 declare(strict_types=1);
10 
13 use GuzzleHttp\ClientInterface;
14 use Psr\Http\Message\UploadedFileInterface;
15 
20 {
24  public function __construct(array $args = [], ClientInterface $client = null)
25  {
26  parent::__construct('/{projectKey}/shipping-methods', $args, $client);
27  }
28 
31  public function withKey(string $key = null): ResourceByProjectKeyShippingMethodsKeyByKey
32  {
33  $args = $this->getArgs();
34  if (!is_null($key)) {
35  $args['key'] = $key;
36  }
37 
38  return new ResourceByProjectKeyShippingMethodsKeyByKey($args, $this->getClient());
39  }
43  {
44  $args = $this->getArgs();
45 
47  }
51  {
52  $args = $this->getArgs();
53 
55  }
59  {
60  $args = $this->getArgs();
61 
63  }
67  {
68  $args = $this->getArgs();
69 
71  }
74  public function withId(string $ID = null): ResourceByProjectKeyShippingMethodsByID
75  {
76  $args = $this->getArgs();
77  if (!is_null($ID)) {
78  $args['ID'] = $ID;
79  }
80 
81  return new ResourceByProjectKeyShippingMethodsByID($args, $this->getClient());
82  }
83 
88  public function get($body = null, array $headers = []): ByProjectKeyShippingMethodsGet
89  {
90  $args = $this->getArgs();
91 
92  return new ByProjectKeyShippingMethodsGet($args['projectKey'], $body, $headers, $this->getClient());
93  }
98  public function head($body = null, array $headers = []): ByProjectKeyShippingMethodsHead
99  {
100  $args = $this->getArgs();
101 
102  return new ByProjectKeyShippingMethodsHead($args['projectKey'], $body, $headers, $this->getClient());
103  }
108  public function post(?ShippingMethodDraft $body = null, array $headers = []): ByProjectKeyShippingMethodsPost
109  {
110  $args = $this->getArgs();
111 
112  return new ByProjectKeyShippingMethodsPost($args['projectKey'], $body, $headers, $this->getClient());
113  }
114 }