-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathOffersListDto.php
More file actions
284 lines (241 loc) · 6.93 KB
/
OffersListDto.php
File metadata and controls
284 lines (241 loc) · 6.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
<?php
declare(strict_types=1);
namespace Affise\Sdk\Offers;
/**
* Class OffersListDto
*/
class OffersListDto extends BaseOfferDto
{
protected string $advertiser;
protected string $externalOfferId;
protected string $bundleId;
protected bool $hidePayments;
protected string $url;
protected string $crossPostbackUrl;
protected string $urlPreview;
protected string $domainUrl;
protected string $trafficbackUrl;
protected string $status;
/**
* @var array<mixed>
*/
protected array $tags;
protected string $privacy;
protected int $isTop;
/**
* @var array<\Affise\Sdk\Offers\PartnerPaymentDto>
*/
protected array $partnerPayments;
protected ?string $strictlyConnectionType;
protected bool $isRedirectOvercap;
protected int $noticePercentOvercap;
protected float $cr;
protected float $epc;
protected string $notes;
protected string $allowedIp;
protected string $disallowedIp;
protected string $hashPassword;
protected bool $allowDeeplink;
protected ?bool $hideReferer;
protected ?string $startAt;
protected ?int $autoOfferConnect;
protected string $createdAt;
/**
* @var array<array<string, mixed>>
*/
protected array $subAccounts;
/**
* @var array<\Affise\Sdk\Offers\CommissionTierDto>
*/
protected array $commissionTiers;
protected string $updatedAt;
protected bool $allowImpressions;
/**
* @var array<mixed>
*/
protected array $smartlinkCategories;
public function __construct(array $attributes)
{
parent::__construct($attributes);
$this->advertiser = $attributes['advertiser'];
$this->externalOfferId = $attributes['external_offer_id'];
$this->bundleId = $attributes['bundle_id'];
$this->hidePayments = $attributes['hide_payments'];
$this->url = $attributes['url'];
$this->crossPostbackUrl = $attributes['cross_postback_url'];
$this->urlPreview = $attributes['url_preview'];
$this->domainUrl = $attributes['domain_url'];
$this->trafficbackUrl = $attributes['trafficback_url'];
$this->status = $attributes['status'];
$this->tags = $attributes['tags'] ?? [];
$this->privacy = $attributes['privacy'];
$this->isTop = $attributes['is_top'];
$this->partnerPayments = array_map(fn(array $item) => new PartnerPaymentDto($item), $attributes['partner_payments'] ?? []);
$this->strictlyConnectionType = $attributes['strictly_connection_type'] ?? null;
$this->isRedirectOvercap = $attributes['is_redirect_overcap'];
$this->noticePercentOvercap = $attributes['notice_percent_overcap'];
$this->cr = $attributes['cr'];
$this->epc = $attributes['epc'];
$this->notes = $attributes['notes'] ?? '';
$this->allowedIp = $attributes['allowed_ip'];
$this->disallowedIp = $attributes['disallowed_ip'];
$this->hashPassword = $attributes['hash_password'];
$this->allowDeeplink = (bool) $attributes['allow_deeplink'];
$this->hideReferer = $attributes['hide_referer'] ?? null;
$this->startAt = $attributes['start_at'] ?? null;
$this->autoOfferConnect = $attributes['auto_offer_connect'] ?? null;
$this->createdAt = $attributes['created_at'];
$this->subAccounts = $attributes['sub_accounts'] ?? [];
$this->commissionTiers = array_map(fn(array $item) => new CommissionTierDto($item), $attributes['commission_tiers'] ?? []);
$this->updatedAt = $attributes['updated_at'];
$this->allowImpressions = $attributes['allow_impressions'];
$this->smartlinkCategories = $attributes['smartlink_categories'] ?? [];
}
public function getAdvertiser(): string
{
return $this->advertiser;
}
public function getExternalOfferId(): string
{
return $this->externalOfferId;
}
public function getBundleId(): string
{
return $this->bundleId;
}
public function getHidePayments(): bool
{
return $this->hidePayments;
}
public function getUrl(): string
{
return $this->url;
}
public function getCrossPostbackUrl(): string
{
return $this->crossPostbackUrl;
}
public function getUrlPreview(): string
{
return $this->urlPreview;
}
public function getDomainUrl(): string
{
return $this->domainUrl;
}
public function getTrafficbackUrl(): string
{
return $this->trafficbackUrl;
}
public function getStatus(): string
{
return $this->status;
}
/**
* @return array<mixed>
*/
public function getTags(): array
{
return $this->tags;
}
public function getPrivacy(): string
{
return $this->privacy;
}
public function getIsTop(): int
{
return $this->isTop;
}
/**
* @return array<\Affise\Sdk\Offers\PartnerPaymentDto>
*/
public function getPartnerPayments(): array
{
return $this->partnerPayments;
}
public function getStrictlyConnectionType(): ?string
{
return $this->strictlyConnectionType;
}
public function getIsRedirectOvercap(): bool
{
return $this->isRedirectOvercap;
}
public function getNoticePercentOvercap(): int
{
return $this->noticePercentOvercap;
}
public function getCr(): float
{
return $this->cr;
}
public function getEpc(): float
{
return $this->epc;
}
public function getNotes(): string
{
return $this->notes;
}
public function getAllowedIp(): string
{
return $this->allowedIp;
}
public function getDisallowedIp(): string
{
return $this->disallowedIp;
}
public function getHashPassword(): string
{
return $this->hashPassword;
}
public function getAllowDeeplink(): bool
{
return $this->allowDeeplink;
}
public function getHideReferer(): ?bool
{
return $this->hideReferer;
}
public function getStartAt(): ?string
{
return $this->startAt;
}
public function getAutoOfferConnect(): ?int
{
return $this->autoOfferConnect;
}
public function getCreatedAt(): string
{
return $this->createdAt;
}
/**
* @return array<array<string, mixed>>
*/
public function getSubAccounts(): array
{
return $this->subAccounts;
}
/**
* @return array<\Affise\Sdk\Offers\CommissionTierDto>
*/
public function getCommissionTiers(): array
{
return $this->commissionTiers;
}
public function getUpdatedAt(): string
{
return $this->updatedAt;
}
public function getAllowImpressions(): bool
{
return $this->allowImpressions;
}
/**
* @return array<mixed>
*/
public function getSmartlinkCategories(): array
{
return $this->smartlinkCategories;
}
}