Skip to content

Commit 0baa35b

Browse files
authored
Merge pull request #10 from stepanov-va/DEV-1913_add_get_client_offers_method
DEV-1913: added get_client_offers functionality
2 parents abb7db6 + 99864bf commit 0baa35b

4 files changed

Lines changed: 262 additions & 0 deletions

File tree

lib/Client.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
use CloudLoyalty\Api\Generated\Model\GetPurchaseHistoryResponse;
2323
use CloudLoyalty\Api\Generated\Model\GetSettingsRequest;
2424
use CloudLoyalty\Api\Generated\Model\GetSettingsResponse;
25+
use CloudLoyalty\Api\Generated\Model\GetClientOffersRequest;
26+
use CloudLoyalty\Api\Generated\Model\GetClientOffersResponse;
2527
use CloudLoyalty\Api\Generated\Model\GiftCardQuery;
2628
use CloudLoyalty\Api\Generated\Model\IssuePromocodeRequest;
2729
use CloudLoyalty\Api\Generated\Model\IssuePromocodeResponse;
@@ -77,6 +79,9 @@ class Client
7779
'CloudLoyalty\Api\Generated\Model\GetBalanceResponse' => [
7880
'bonuses' => 'CloudLoyalty\Api\Generated\Model\ClientBonusExpirationItem'
7981
],
82+
'CloudLoyalty\Api\Generated\Model\GetClientOffersResponse' => [
83+
'counters' => 'CloudLoyalty\Api\Generated\Model\ClientOfferCounter'
84+
],
8085
'CloudLoyalty\Api\Generated\Model\NewClientResponse' => [
8186
'bonuses' => 'CloudLoyalty\Api\Generated\Model\ClientBonusExpirationItem'
8287
],
@@ -283,6 +288,17 @@ public function getBalance(ClientQuery $request)
283288
return $this->call('get-balance', $request, 'CloudLoyalty\Api\Generated\Model\GetBalanceResponse');
284289
}
285290

291+
/**
292+
* @param GetClientOffersRequest $request
293+
* @return GetClientOffersResponse
294+
* @throws ProcessingException
295+
* @throws TransportException
296+
*/
297+
public function getClientOffers(GetClientOffersRequest $request)
298+
{
299+
return $this->call('get-client-offers', $request, 'CloudLoyalty\Api\Generated\Model\GetClientOffersResponse');
300+
}
301+
286302
/**
287303
* @param UpdateClientRequest $request
288304
* @return NewClientResponse
Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
<?php
2+
3+
/*
4+
* This file has been auto generated by Jane,
5+
*
6+
* Do no edit it directly.
7+
*/
8+
9+
namespace CloudLoyalty\Api\Generated\Model;
10+
11+
class ClientOfferCounter
12+
{
13+
/**
14+
* Название счетчика
15+
*
16+
* @var string
17+
*/
18+
protected $name;
19+
20+
/**
21+
* Текущее значение счетчика
22+
*
23+
* @var int
24+
*/
25+
protected $value;
26+
27+
/**
28+
* Значение счетчика, при котором клиент получает награду
29+
*
30+
* @var int
31+
*/
32+
protected $targetValue;
33+
34+
/**
35+
* Дата, до которой нужно накопить счетчик
36+
*
37+
* @var \DateTime|null
38+
*/
39+
protected $targetDate;
40+
41+
/**
42+
* Количество неиспользованных наград по счетчику
43+
*
44+
* @var int
45+
*/
46+
protected $coupons;
47+
48+
/**
49+
* Название счетчика
50+
*
51+
* @return string
52+
*/
53+
public function getName()
54+
{
55+
return $this->name;
56+
}
57+
58+
/**
59+
* Название счетчика
60+
*
61+
* @param string $name
62+
*
63+
* @return self
64+
*/
65+
public function setName($name)
66+
{
67+
$this->name = $name;
68+
return $this;
69+
}
70+
71+
/**
72+
* Текущее значение счетчика
73+
*
74+
* @return int
75+
*/
76+
public function getValue()
77+
{
78+
return $this->value;
79+
}
80+
81+
/**
82+
* Текущее значение счетчика
83+
*
84+
* @param int $value
85+
*
86+
* @return self
87+
*/
88+
public function setValue($value)
89+
{
90+
$this->value = $value;
91+
return $this;
92+
}
93+
94+
/**
95+
* Значение счетчика, при котором клиент получает награду
96+
*
97+
* @return int
98+
*/
99+
public function getTargetValue()
100+
{
101+
return $this->targetValue;
102+
}
103+
104+
/**
105+
* Значение счетчика, при котором клиент получает награду
106+
*
107+
* @param int $targetValue
108+
*
109+
* @return self
110+
*/
111+
public function setTargetValue($targetValue)
112+
{
113+
$this->targetValue = $targetValue;
114+
return $this;
115+
}
116+
117+
/**
118+
* Дата, до которой нужно накопить счетчик
119+
*
120+
* @return \DateTime|null
121+
*/
122+
public function getTargetDate()
123+
{
124+
return $this->targetDate;
125+
}
126+
127+
/**
128+
* Дата, до которой нужно накопить счетчик
129+
*
130+
* @param \DateTime|null $targetDate
131+
*
132+
* @return self
133+
*/
134+
public function setTargetDate(\DateTime $targetDate = null)
135+
{
136+
$this->targetDate = $targetDate;
137+
return $this;
138+
}
139+
140+
/**
141+
* Количество неиспользованных наград по счетчику
142+
*
143+
* @return int
144+
*/
145+
public function getCoupons()
146+
{
147+
return $this->coupons;
148+
}
149+
150+
/**
151+
* Количество неиспользованных наград по счетчику
152+
*
153+
* @param int $coupons
154+
*
155+
* @return self
156+
*/
157+
public function setCoupons($coupons)
158+
{
159+
$this->coupons = $coupons;
160+
return $this;
161+
}
162+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php
2+
3+
/*
4+
* This file has been auto generated by Jane,
5+
*
6+
* Do no edit it directly.
7+
*/
8+
9+
namespace CloudLoyalty\Api\Generated\Model;
10+
11+
class GetClientOffersRequest
12+
{
13+
/**
14+
* Данные о клиенте, для которого делается запрос.
15+
*
16+
* @var ClientQuery
17+
*/
18+
protected $client;
19+
20+
/**
21+
* Данные о клиенте, для которого делается запрос.
22+
*
23+
* @return ClientQuery
24+
*/
25+
public function getClient()
26+
{
27+
return $this->client;
28+
}
29+
30+
/**
31+
* Данные о клиенте, для которого делается запрос.
32+
*
33+
* @param ClientQuery $client
34+
*
35+
* @return self
36+
*/
37+
public function setClient(ClientQuery $client)
38+
{
39+
$this->client = $client;
40+
return $this;
41+
}
42+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php
2+
3+
/*
4+
* This file has been auto generated by Jane,
5+
*
6+
* Do no edit it directly.
7+
*/
8+
9+
namespace CloudLoyalty\Api\Generated\Model;
10+
11+
class GetClientOffersResponse
12+
{
13+
/**
14+
* Счетчики клиента
15+
*
16+
* @var ClientOfferCounter[]
17+
*/
18+
protected $counters;
19+
20+
/**
21+
* Счетчики клиента
22+
*
23+
* @return ClientOfferCounter[]
24+
*/
25+
public function getCounters()
26+
{
27+
return $this->counters;
28+
}
29+
30+
/**
31+
* Счетчики клиента
32+
*
33+
* @param ClientOfferCounter[] $counters
34+
*
35+
* @return self
36+
*/
37+
public function setCounters(array $counters)
38+
{
39+
$this->counters = $counters;
40+
return $this;
41+
}
42+
}

0 commit comments

Comments
 (0)