commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
Loading...
Searching...
No Matches
lib
commercetools-api
src
Client
Resource
ResourceByProjectKeyCartDiscounts.php
1
<?php
2
3
declare(strict_types=1);
9
namespace
Commercetools\Api\Client\Resource
;
10
11
use
Commercetools\Api\Models\CartDiscount\CartDiscountDraft
;
12
use
Commercetools\Client\ApiResource
;
13
use GuzzleHttp\ClientInterface;
14
use Psr\Http\Message\UploadedFileInterface;
15
19
class
ResourceByProjectKeyCartDiscounts
extends
ApiResource
20
{
24
public
function
__construct
(array $args = [], ClientInterface $client =
null
)
25
{
26
parent::__construct(
'/{projectKey}/cart-discounts'
, $args, $client);
27
}
28
31
public
function
withKey
(
string
$key =
null
):
ResourceByProjectKeyCartDiscountsKeyByKey
32
{
33
$args = $this->
getArgs
();
34
if
(!is_null($key)) {
35
$args[
'key'
] = $key;
36
}
37
38
return
new
ResourceByProjectKeyCartDiscountsKeyByKey
($args, $this->
getClient
());
39
}
42
public
function
withId
(
string
$ID =
null
):
ResourceByProjectKeyCartDiscountsByID
43
{
44
$args = $this->
getArgs
();
45
if
(!is_null($ID)) {
46
$args[
'ID'
] = $ID;
47
}
48
49
return
new
ResourceByProjectKeyCartDiscountsByID
($args, $this->
getClient
());
50
}
51
56
public
function
get
($body =
null
, array $headers = []):
ByProjectKeyCartDiscountsGet
57
{
58
$args = $this->
getArgs
();
59
60
return
new
ByProjectKeyCartDiscountsGet
($args[
'projectKey'
], $body, $headers, $this->
getClient
());
61
}
66
public
function
head
($body =
null
, array $headers = []):
ByProjectKeyCartDiscountsHead
67
{
68
$args = $this->
getArgs
();
69
70
return
new
ByProjectKeyCartDiscountsHead
($args[
'projectKey'
], $body, $headers, $this->
getClient
());
71
}
76
public
function
post
(?
CartDiscountDraft
$body =
null
, array $headers = []):
ByProjectKeyCartDiscountsPost
77
{
78
$args = $this->
getArgs
();
79
80
return
new
ByProjectKeyCartDiscountsPost
($args[
'projectKey'
], $body, $headers, $this->
getClient
());
81
}
82
}
Commercetools\Api\Client\Resource\ByProjectKeyCartDiscountsGet
Definition
ByProjectKeyCartDiscountsGet.php:41
Commercetools\Api\Client\Resource\ByProjectKeyCartDiscountsHead
Definition
ByProjectKeyCartDiscountsHead.php:35
Commercetools\Api\Client\Resource\ByProjectKeyCartDiscountsPost
Definition
ByProjectKeyCartDiscountsPost.php:38
Commercetools\Api\Client\Resource\ResourceByProjectKeyCartDiscountsByID
Definition
ResourceByProjectKeyCartDiscountsByID.php:20
Commercetools\Api\Client\Resource\ResourceByProjectKeyCartDiscounts
Definition
ResourceByProjectKeyCartDiscounts.php:20
Commercetools\Api\Client\Resource\ResourceByProjectKeyCartDiscounts\withId
withId(string $ID=null)
Definition
ResourceByProjectKeyCartDiscounts.php:42
Commercetools\Api\Client\Resource\ResourceByProjectKeyCartDiscounts\__construct
__construct(array $args=[], ClientInterface $client=null)
Definition
ResourceByProjectKeyCartDiscounts.php:24
Commercetools\Api\Client\Resource\ResourceByProjectKeyCartDiscounts\head
head($body=null, array $headers=[])
Definition
ResourceByProjectKeyCartDiscounts.php:66
Commercetools\Api\Client\Resource\ResourceByProjectKeyCartDiscounts\post
post(?CartDiscountDraft $body=null, array $headers=[])
Definition
ResourceByProjectKeyCartDiscounts.php:76
Commercetools\Api\Client\Resource\ResourceByProjectKeyCartDiscounts\withKey
withKey(string $key=null)
Definition
ResourceByProjectKeyCartDiscounts.php:31
Commercetools\Api\Client\Resource\ResourceByProjectKeyCartDiscountsKeyByKey
Definition
ResourceByProjectKeyCartDiscountsKeyByKey.php:20
Commercetools\Client\ApiResource
Definition
ApiResource.php:15
Commercetools\Client\ApiResource\getClient
getClient()
Definition
ApiResource.php:61
Commercetools\Client\ApiResource\getArgs
getArgs()
Definition
ApiResource.php:56
Commercetools\Api\Models\CartDiscount\CartDiscountDraft
Definition
CartDiscountDraft.php:19
Commercetools\Api\Client\Resource
Definition
ByProjectKeyApiClientsByIDDelete.php:9
Generated by
1.9.8