commercetools-sdk-php-v2  master
The platform, import-api and ml-api PHP sdks generated from our api reference.
ResourceByProjectKeyCustomers.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}/customers', $args, $client);
27  }
28 
32  {
33  $args = $this->getArgs();
34  if (!is_null($passwordToken)) {
35  $args['passwordToken'] = $passwordToken;
36  }
37 
39  }
42  public function withEmailToken(string $emailToken = null): ResourceByProjectKeyCustomersEmailTokenByEmailToken
43  {
44  $args = $this->getArgs();
45  if (!is_null($emailToken)) {
46  $args['emailToken'] = $emailToken;
47  }
48 
50  }
54  {
55  $args = $this->getArgs();
56 
57  return new ResourceByProjectKeyCustomersEmailToken($args, $this->getClient());
58  }
62  {
63  $args = $this->getArgs();
64 
65  return new ResourceByProjectKeyCustomersEmailConfirm($args, $this->getClient());
66  }
70  {
71  $args = $this->getArgs();
72 
73  return new ResourceByProjectKeyCustomersPassword($args, $this->getClient());
74  }
78  {
79  $args = $this->getArgs();
80 
81  return new ResourceByProjectKeyCustomersPasswordReset($args, $this->getClient());
82  }
86  {
87  $args = $this->getArgs();
88 
89  return new ResourceByProjectKeyCustomersPasswordToken($args, $this->getClient());
90  }
93  public function withKey(string $key = null): ResourceByProjectKeyCustomersKeyByKey
94  {
95  $args = $this->getArgs();
96  if (!is_null($key)) {
97  $args['key'] = $key;
98  }
99 
100  return new ResourceByProjectKeyCustomersKeyByKey($args, $this->getClient());
101  }
104  public function withId(string $ID = null): ResourceByProjectKeyCustomersByID
105  {
106  $args = $this->getArgs();
107  if (!is_null($ID)) {
108  $args['ID'] = $ID;
109  }
110 
111  return new ResourceByProjectKeyCustomersByID($args, $this->getClient());
112  }
113 
118  public function get($body = null, array $headers = []): ByProjectKeyCustomersGet
119  {
120  $args = $this->getArgs();
121 
122  return new ByProjectKeyCustomersGet($args['projectKey'], $body, $headers, $this->getClient());
123  }
128  public function head($body = null, array $headers = []): ByProjectKeyCustomersHead
129  {
130  $args = $this->getArgs();
131 
132  return new ByProjectKeyCustomersHead($args['projectKey'], $body, $headers, $this->getClient());
133  }
138  public function post(?CustomerDraft $body = null, array $headers = []): ByProjectKeyCustomersPost
139  {
140  $args = $this->getArgs();
141 
142  return new ByProjectKeyCustomersPost($args['projectKey'], $body, $headers, $this->getClient());
143  }
144 }