commercetools-sdk-php-v2  master
The platform, import-api and ml-api PHP sdks generated from our api reference.
ResourceByProjectKeyProductDiscounts.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}/product-discounts', $args, $client);
27  }
28 
32  {
33  $args = $this->getArgs();
34 
35  return new ResourceByProjectKeyProductDiscountsMatching($args, $this->getClient());
36  }
39  public function withKey(string $key = null): ResourceByProjectKeyProductDiscountsKeyByKey
40  {
41  $args = $this->getArgs();
42  if (!is_null($key)) {
43  $args['key'] = $key;
44  }
45 
46  return new ResourceByProjectKeyProductDiscountsKeyByKey($args, $this->getClient());
47  }
50  public function withId(string $ID = null): ResourceByProjectKeyProductDiscountsByID
51  {
52  $args = $this->getArgs();
53  if (!is_null($ID)) {
54  $args['ID'] = $ID;
55  }
56 
57  return new ResourceByProjectKeyProductDiscountsByID($args, $this->getClient());
58  }
59 
64  public function get($body = null, array $headers = []): ByProjectKeyProductDiscountsGet
65  {
66  $args = $this->getArgs();
67 
68  return new ByProjectKeyProductDiscountsGet($args['projectKey'], $body, $headers, $this->getClient());
69  }
74  public function head($body = null, array $headers = []): ByProjectKeyProductDiscountsHead
75  {
76  $args = $this->getArgs();
77 
78  return new ByProjectKeyProductDiscountsHead($args['projectKey'], $body, $headers, $this->getClient());
79  }
84  public function post(?ProductDiscountDraft $body = null, array $headers = []): ByProjectKeyProductDiscountsPost
85  {
86  $args = $this->getArgs();
87 
88  return new ByProjectKeyProductDiscountsPost($args['projectKey'], $body, $headers, $this->getClient());
89  }
90 }