pushizo 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,4221 @@
1
+ # Bu dosya api/openapi.yaml'dan sdk/scripts/generate-server-sdks.mjs ile üretilmiştir; elle düzenlemeyin.
2
+ # frozen_string_literal: true
3
+
4
+ module Pushizo
5
+ # API kaynakları; her metot bir OpenAPI işlemine karşılık gelir.
6
+ module Resources
7
+ # Bildirim gönderme, durum, iptal, teslimatlar ve geçmiş dışa aktarımı.
8
+ class Notifications < Pushizo::BaseResource
9
+ # Bildirim oluştur (202, asenkron teslimat)
10
+ #
11
+ # POST /v1/notifications
12
+ #
13
+ # Idempotency-Key: idempotency_key:, gövdedeki idempotency_key veya otomatik UUID.
14
+ def create(body, app_id: nil, idempotency_key: nil, request_options: nil)
15
+ @client.call(
16
+ :post, "/v1/notifications",
17
+ path_params: {},
18
+ body: body,
19
+ app_id: app_id,
20
+ body_app_id: true,
21
+ idempotent: true,
22
+ idempotency_key: idempotency_key,
23
+ response: "CreateNotificationResult",
24
+ request_options: request_options
25
+ )
26
+ end
27
+
28
+ # Mesaj listesi (app_id zorunlu)
29
+ #
30
+ # GET /v1/notifications
31
+ #
32
+ # @param source Değerler: "campaign", "api", "journey", "test".
33
+ # @param kind Değerler: "campaign", "api", "journey", "test".
34
+ # @param status Değerler: "queued", "processing", "completed", "cancelled", "failed".
35
+ # @param sort Değerler: "created_at", "-created_at".
36
+ def list(limit: nil, cursor: nil, source: nil, kind: nil, status: nil, sort: nil, label: nil, app_id: nil, request_options: nil)
37
+ @client.call(
38
+ :get, "/v1/notifications",
39
+ path_params: {},
40
+ query: { "limit" => limit, "cursor" => cursor, "source" => source, "kind" => kind, "status" => status, "sort" => sort, "label" => label },
41
+ app_id: app_id,
42
+ query_app_id: true,
43
+ response: "MessageList",
44
+ request_options: request_options
45
+ )
46
+ end
47
+
48
+ # list sonuçlarını next_cursor ile tüm sayfalar boyunca tek tek dolaşan Enumerator döndürür (sayfalar tembel yüklenir).
49
+ def list_all(limit: nil, cursor: nil, source: nil, kind: nil, status: nil, sort: nil, label: nil, app_id: nil, request_options: nil)
50
+ @client.paginate(cursor) do |cursor_value|
51
+ list(limit: limit, source: source, kind: kind, status: status, sort: sort, label: label, app_id: app_id, request_options: request_options, cursor: cursor_value)
52
+ end
53
+ end
54
+
55
+ # Kaydedilmemiş hedef için alıcı sayısı (gönderim yapmaz)
56
+ #
57
+ # POST /v1/notifications/estimate
58
+ def estimate(body, app_id: nil, request_options: nil)
59
+ @client.call(
60
+ :post, "/v1/notifications/estimate",
61
+ path_params: {},
62
+ body: body,
63
+ app_id: app_id,
64
+ body_app_id: true,
65
+ response: "EstimateAudienceResult",
66
+ request_options: request_options
67
+ )
68
+ end
69
+
70
+ # Mesaj durumu ve sayaçları
71
+ #
72
+ # GET /v1/notifications/{messageId}
73
+ def get(message_id, app_id: nil, request_options: nil)
74
+ @client.call(
75
+ :get, "/v1/notifications/{messageId}",
76
+ path_params: { "messageId" => message_id },
77
+ app_id: app_id,
78
+ query_app_id: true,
79
+ response: "Message",
80
+ request_options: request_options
81
+ )
82
+ end
83
+
84
+ # Zamanlanmış/kuyruktaki mesajı iptal et
85
+ #
86
+ # DELETE /v1/notifications/{messageId}
87
+ def cancel(message_id, app_id: nil, request_options: nil)
88
+ @client.call(
89
+ :delete, "/v1/notifications/{messageId}",
90
+ path_params: { "messageId" => message_id },
91
+ app_id: app_id,
92
+ query_app_id: true,
93
+ response: "Message",
94
+ request_options: request_options
95
+ )
96
+ end
97
+
98
+ # Abone bazlı teslimat sonuçları (cursor)
99
+ #
100
+ # GET /v1/notifications/{messageId}/deliveries
101
+ #
102
+ # @param status Değerler: "pending", "sent", "delivered", "failed", "bounced", "suppressed", "expired", "cancelled".
103
+ def deliveries(message_id, limit: nil, cursor: nil, status: nil, app_id: nil, request_options: nil)
104
+ @client.call(
105
+ :get, "/v1/notifications/{messageId}/deliveries",
106
+ path_params: { "messageId" => message_id },
107
+ query: { "limit" => limit, "cursor" => cursor, "status" => status },
108
+ app_id: app_id,
109
+ query_app_id: true,
110
+ response: "DeliveryList",
111
+ request_options: request_options
112
+ )
113
+ end
114
+
115
+ # deliveries sonuçlarını next_cursor ile tüm sayfalar boyunca tek tek dolaşan Enumerator döndürür (sayfalar tembel yüklenir).
116
+ def deliveries_all(message_id, limit: nil, cursor: nil, status: nil, app_id: nil, request_options: nil)
117
+ @client.paginate(cursor) do |cursor_value|
118
+ deliveries(message_id, limit: limit, status: status, app_id: app_id, request_options: request_options, cursor: cursor_value)
119
+ end
120
+ end
121
+
122
+ # Bildirim geçmişi CSV işi (teslimatlar; tamamlanınca download_url)
123
+ #
124
+ # GET /v1/notifications/{messageId}/history
125
+ def history(message_id, app_id: nil, request_options: nil)
126
+ @client.call(
127
+ :get, "/v1/notifications/{messageId}/history",
128
+ path_params: { "messageId" => message_id },
129
+ app_id: app_id,
130
+ query_app_id: true,
131
+ response: "Export",
132
+ request_options: request_options
133
+ )
134
+ end
135
+
136
+ # Mesaj olay CSV işi (gönderildi/teslim/açıldı/tıklandı/bounce…; tamamlanınca download_url)
137
+ #
138
+ # POST /v1/notifications/{messageId}/export_events
139
+ def export_events(message_id, app_id: nil, request_options: nil)
140
+ @client.call(
141
+ :post, "/v1/notifications/{messageId}/export_events",
142
+ path_params: { "messageId" => message_id },
143
+ app_id: app_id,
144
+ query_app_id: true,
145
+ response: "Export",
146
+ request_options: request_options
147
+ )
148
+ end
149
+ end
150
+
151
+ # Kullanıcı oluşturma/güncelleme (tag, özellik), arama ve abonelik ekleme.
152
+ class Users < Pushizo::BaseResource
153
+ # Kullanıcı listesi
154
+ #
155
+ # GET /v1/apps/{appId}/users
156
+ #
157
+ # @param sort Değerler: "last_active_at", "-last_active_at".
158
+ def list(limit: nil, cursor: nil, sort: nil, q: nil, tag: nil, last_active_after: nil, last_active_before: nil, app_id: nil, request_options: nil)
159
+ @client.call(
160
+ :get, "/v1/apps/{appId}/users",
161
+ path_params: {},
162
+ query: { "limit" => limit, "cursor" => cursor, "sort" => sort, "q" => q, "tag" => tag, "last_active_after" => last_active_after, "last_active_before" => last_active_before },
163
+ app_id: app_id,
164
+ response: "UserList",
165
+ request_options: request_options
166
+ )
167
+ end
168
+
169
+ # list sonuçlarını next_cursor ile tüm sayfalar boyunca tek tek dolaşan Enumerator döndürür (sayfalar tembel yüklenir).
170
+ def list_all(limit: nil, cursor: nil, sort: nil, q: nil, tag: nil, last_active_after: nil, last_active_before: nil, app_id: nil, request_options: nil)
171
+ @client.paginate(cursor) do |cursor_value|
172
+ list(limit: limit, sort: sort, q: q, tag: tag, last_active_after: last_active_after, last_active_before: last_active_before, app_id: app_id, request_options: request_options, cursor: cursor_value)
173
+ end
174
+ end
175
+
176
+ # Kullanıcı oluştur/güncelle (external_id ile, isteğe bağlı aboneliklerle)
177
+ #
178
+ # POST /v1/apps/{appId}/users
179
+ #
180
+ # Idempotency-Key: idempotency_key:, gövdedeki idempotency_key veya otomatik UUID.
181
+ def upsert(body, app_id: nil, idempotency_key: nil, request_options: nil)
182
+ @client.call(
183
+ :post, "/v1/apps/{appId}/users",
184
+ path_params: {},
185
+ body: body,
186
+ app_id: app_id,
187
+ idempotent: true,
188
+ idempotency_key: idempotency_key,
189
+ response: "UserDetail",
190
+ request_options: request_options
191
+ )
192
+ end
193
+
194
+ # Segment tanımı ile kullanıcı arama
195
+ #
196
+ # POST /v1/apps/{appId}/users/search
197
+ def search(body, app_id: nil, request_options: nil)
198
+ @client.call(
199
+ :post, "/v1/apps/{appId}/users/search",
200
+ path_params: {},
201
+ body: body,
202
+ app_id: app_id,
203
+ response: "UserList",
204
+ request_options: request_options
205
+ )
206
+ end
207
+
208
+ # Alias ile kullanıcı (hs_id, external_id veya özel etiket)
209
+ #
210
+ # GET /v1/apps/{appId}/users/by/{label}/{value}
211
+ def get_by_alias(label, value, app_id: nil, request_options: nil)
212
+ @client.call(
213
+ :get, "/v1/apps/{appId}/users/by/{label}/{value}",
214
+ path_params: { "label" => label, "value" => value },
215
+ app_id: app_id,
216
+ response: "UserDetail",
217
+ request_options: request_options
218
+ )
219
+ end
220
+
221
+ # Tag/property merge-patch ve deltas
222
+ #
223
+ # PATCH /v1/apps/{appId}/users/by/{label}/{value}
224
+ def update(label, value, body, app_id: nil, request_options: nil)
225
+ @client.call(
226
+ :patch, "/v1/apps/{appId}/users/by/{label}/{value}",
227
+ path_params: { "label" => label, "value" => value },
228
+ body: body,
229
+ app_id: app_id,
230
+ response: "UserDetail",
231
+ request_options: request_options
232
+ )
233
+ end
234
+
235
+ # Kullanıcıyı sil (abonelikler silinir, olaylar anonimleşir)
236
+ #
237
+ # DELETE /v1/apps/{appId}/users/by/{label}/{value}
238
+ def delete(label, value, app_id: nil, request_options: nil)
239
+ @client.call(
240
+ :delete, "/v1/apps/{appId}/users/by/{label}/{value}",
241
+ path_params: { "label" => label, "value" => value },
242
+ app_id: app_id,
243
+ response: "Ok",
244
+ request_options: request_options
245
+ )
246
+ end
247
+
248
+ # Kullanıcının tüm kimlikleri (hs_id, external_id, özel alias'lar)
249
+ #
250
+ # GET /v1/apps/{appId}/users/by/{label}/{value}/identity
251
+ def get_identity(label, value, app_id: nil, request_options: nil)
252
+ @client.call(
253
+ :get, "/v1/apps/{appId}/users/by/{label}/{value}/identity",
254
+ path_params: { "label" => label, "value" => value },
255
+ app_id: app_id,
256
+ response: "UserIdentity",
257
+ request_options: request_options
258
+ )
259
+ end
260
+
261
+ # Kullanıcı verisini dışa aktar (KVKK/GDPR taşınabilirlik): profil, alias, abonelik, son olaylar
262
+ #
263
+ # GET /v1/apps/{appId}/users/by/{label}/{value}/export
264
+ def export(label, value, app_id: nil, request_options: nil)
265
+ @client.call(
266
+ :get, "/v1/apps/{appId}/users/by/{label}/{value}/export",
267
+ path_params: { "label" => label, "value" => value },
268
+ app_id: app_id,
269
+ response: "UserExport",
270
+ request_options: request_options
271
+ )
272
+ end
273
+
274
+ # Kullanıcıya abonelik ekle
275
+ #
276
+ # POST /v1/apps/{appId}/users/by/{label}/{value}/subscriptions
277
+ def add_subscription(label, value, body, app_id: nil, request_options: nil)
278
+ @client.call(
279
+ :post, "/v1/apps/{appId}/users/by/{label}/{value}/subscriptions",
280
+ path_params: { "label" => label, "value" => value },
281
+ body: body,
282
+ app_id: app_id,
283
+ response: "Subscription",
284
+ request_options: request_options
285
+ )
286
+ end
287
+ end
288
+
289
+ # Kullanıcı kimlikleri (alias): ekleme ve kaldırma.
290
+ class Aliases < Pushizo::BaseResource
291
+ # Alias ekle
292
+ #
293
+ # PATCH /v1/apps/{appId}/users/by/{label}/{value}/identity
294
+ def add(label, value, body, app_id: nil, request_options: nil)
295
+ @client.call(
296
+ :patch, "/v1/apps/{appId}/users/by/{label}/{value}/identity",
297
+ path_params: { "label" => label, "value" => value },
298
+ body: body,
299
+ app_id: app_id,
300
+ response: "UserDetail",
301
+ request_options: request_options
302
+ )
303
+ end
304
+
305
+ # Alias kaldır
306
+ #
307
+ # DELETE /v1/apps/{appId}/users/by/{label}/{value}/identity/{aliasLabel}
308
+ def delete(label, value, alias_label, app_id: nil, request_options: nil)
309
+ @client.call(
310
+ :delete, "/v1/apps/{appId}/users/by/{label}/{value}/identity/{aliasLabel}",
311
+ path_params: { "label" => label, "value" => value, "aliasLabel" => alias_label },
312
+ app_id: app_id,
313
+ response: "UserDetail",
314
+ request_options: request_options
315
+ )
316
+ end
317
+ end
318
+
319
+ # Abonelik (cihaz/e-posta/SMS) okuma, güncelleme, silme ve sahip atama.
320
+ class Subscriptions < Pushizo::BaseResource
321
+ # Abonelik detayı
322
+ #
323
+ # GET /v1/apps/{appId}/subscriptions/{subscriptionId}
324
+ def get(subscription_id, app_id: nil, request_options: nil)
325
+ @client.call(
326
+ :get, "/v1/apps/{appId}/subscriptions/{subscriptionId}",
327
+ path_params: { "subscriptionId" => subscription_id },
328
+ app_id: app_id,
329
+ response: "Subscription",
330
+ request_options: request_options
331
+ )
332
+ end
333
+
334
+ # Abonelik güncelle
335
+ #
336
+ # PATCH /v1/apps/{appId}/subscriptions/{subscriptionId}
337
+ def update(subscription_id, body, app_id: nil, request_options: nil)
338
+ @client.call(
339
+ :patch, "/v1/apps/{appId}/subscriptions/{subscriptionId}",
340
+ path_params: { "subscriptionId" => subscription_id },
341
+ body: body,
342
+ app_id: app_id,
343
+ response: "Subscription",
344
+ request_options: request_options
345
+ )
346
+ end
347
+
348
+ # Aboneliği sil
349
+ #
350
+ # DELETE /v1/apps/{appId}/subscriptions/{subscriptionId}
351
+ def delete(subscription_id, app_id: nil, request_options: nil)
352
+ @client.call(
353
+ :delete, "/v1/apps/{appId}/subscriptions/{subscriptionId}",
354
+ path_params: { "subscriptionId" => subscription_id },
355
+ app_id: app_id,
356
+ response: "Ok",
357
+ request_options: request_options
358
+ )
359
+ end
360
+
361
+ # Aboneliğin sahibi kullanıcının kimlikleri
362
+ #
363
+ # GET /v1/apps/{appId}/subscriptions/{subscriptionId}/user/identity
364
+ def get_user_identity(subscription_id, app_id: nil, request_options: nil)
365
+ @client.call(
366
+ :get, "/v1/apps/{appId}/subscriptions/{subscriptionId}/user/identity",
367
+ path_params: { "subscriptionId" => subscription_id },
368
+ app_id: app_id,
369
+ response: "UserIdentity",
370
+ request_options: request_options
371
+ )
372
+ end
373
+
374
+ # Token ile abonelik güncelle (token_type: ios_push, android_push, hms_push, web_push, email, sms veya eski sağlayıcı adları iOSPush, AndroidPush, HuaweiPush, ChromePush, FirefoxPush, SafariPush, Email, SMS)
375
+ #
376
+ # PATCH /v1/apps/{appId}/subscriptions_by_token/{tokenType}/{token}
377
+ def update_by_token(token_type, token, body, app_id: nil, request_options: nil)
378
+ @client.call(
379
+ :patch, "/v1/apps/{appId}/subscriptions_by_token/{tokenType}/{token}",
380
+ path_params: { "tokenType" => token_type, "token" => token },
381
+ body: body,
382
+ app_id: app_id,
383
+ response: "Subscription",
384
+ request_options: request_options
385
+ )
386
+ end
387
+
388
+ # Aboneliği external_id ile kullanıcıya bağla
389
+ #
390
+ # POST /v1/apps/{appId}/subscriptions/{subscriptionId}/owner
391
+ def set_owner(subscription_id, body, app_id: nil, request_options: nil)
392
+ @client.call(
393
+ :post, "/v1/apps/{appId}/subscriptions/{subscriptionId}/owner",
394
+ path_params: { "subscriptionId" => subscription_id },
395
+ body: body,
396
+ app_id: app_id,
397
+ response: "Subscription",
398
+ request_options: request_options
399
+ )
400
+ end
401
+ end
402
+
403
+ # Özel olay gönderimi ve olay tanımları.
404
+ class Events < Pushizo::BaseResource
405
+ # Toplu olay gönder (en fazla 500)
406
+ #
407
+ # POST /v1/apps/{appId}/events
408
+ def send_events(body, app_id: nil, request_options: nil)
409
+ @client.call(
410
+ :post, "/v1/apps/{appId}/events",
411
+ path_params: {},
412
+ body: body,
413
+ app_id: app_id,
414
+ response: "EventsAccepted",
415
+ request_options: request_options
416
+ )
417
+ end
418
+
419
+ # Olay tanımları
420
+ #
421
+ # GET /v1/apps/{appId}/events/definitions
422
+ def list_definitions(limit: nil, cursor: nil, app_id: nil, request_options: nil)
423
+ @client.call(
424
+ :get, "/v1/apps/{appId}/events/definitions",
425
+ path_params: {},
426
+ query: { "limit" => limit, "cursor" => cursor },
427
+ app_id: app_id,
428
+ response: "EventDefinitionList",
429
+ request_options: request_options
430
+ )
431
+ end
432
+
433
+ # list_definitions sonuçlarını next_cursor ile tüm sayfalar boyunca tek tek dolaşan Enumerator döndürür (sayfalar tembel yüklenir).
434
+ def list_definitions_all(limit: nil, cursor: nil, app_id: nil, request_options: nil)
435
+ @client.paginate(cursor) do |cursor_value|
436
+ list_definitions(limit: limit, app_id: app_id, request_options: request_options, cursor: cursor_value)
437
+ end
438
+ end
439
+
440
+ # Olay detayı
441
+ #
442
+ # GET /v1/apps/{appId}/events/definitions/{name}
443
+ def get_definition(name, app_id: nil, request_options: nil)
444
+ @client.call(
445
+ :get, "/v1/apps/{appId}/events/definitions/{name}",
446
+ path_params: { "name" => name },
447
+ app_id: app_id,
448
+ response: "EventDefinitionDetail",
449
+ request_options: request_options
450
+ )
451
+ end
452
+
453
+ # Görünen ad / dönüşüm işareti
454
+ #
455
+ # PATCH /v1/apps/{appId}/events/definitions/{name}
456
+ def update_definition(name, body, app_id: nil, request_options: nil)
457
+ @client.call(
458
+ :patch, "/v1/apps/{appId}/events/definitions/{name}",
459
+ path_params: { "name" => name },
460
+ body: body,
461
+ app_id: app_id,
462
+ response: "EventDefinition",
463
+ request_options: request_options
464
+ )
465
+ end
466
+ end
467
+
468
+ # Segment yönetimi, önizleme ve kitle tahmini.
469
+ class Segments < Pushizo::BaseResource
470
+ # Segment listesi
471
+ #
472
+ # GET /v1/apps/{appId}/segments
473
+ def list(limit: nil, cursor: nil, q: nil, app_id: nil, request_options: nil)
474
+ @client.call(
475
+ :get, "/v1/apps/{appId}/segments",
476
+ path_params: {},
477
+ query: { "limit" => limit, "cursor" => cursor, "q" => q },
478
+ app_id: app_id,
479
+ response: "SegmentPage",
480
+ request_options: request_options
481
+ )
482
+ end
483
+
484
+ # list sonuçlarını next_cursor ile tüm sayfalar boyunca tek tek dolaşan Enumerator döndürür (sayfalar tembel yüklenir).
485
+ def list_all(limit: nil, cursor: nil, q: nil, app_id: nil, request_options: nil)
486
+ @client.paginate(cursor) do |cursor_value|
487
+ list(limit: limit, q: q, app_id: app_id, request_options: request_options, cursor: cursor_value)
488
+ end
489
+ end
490
+
491
+ # Segment oluştur
492
+ #
493
+ # POST /v1/apps/{appId}/segments
494
+ def create(body, app_id: nil, request_options: nil)
495
+ @client.call(
496
+ :post, "/v1/apps/{appId}/segments",
497
+ path_params: {},
498
+ body: body,
499
+ app_id: app_id,
500
+ response: "Segment",
501
+ request_options: request_options
502
+ )
503
+ end
504
+
505
+ # Tanım ile sayım ve örnek kullanıcılar
506
+ #
507
+ # POST /v1/apps/{appId}/segments/preview
508
+ def preview(body, app_id: nil, request_options: nil)
509
+ @client.call(
510
+ :post, "/v1/apps/{appId}/segments/preview",
511
+ path_params: {},
512
+ body: body,
513
+ app_id: app_id,
514
+ response: "SegmentPreview",
515
+ request_options: request_options
516
+ )
517
+ end
518
+
519
+ # Segment detayı
520
+ #
521
+ # GET /v1/apps/{appId}/segments/{segmentId}
522
+ def get(segment_id, app_id: nil, request_options: nil)
523
+ @client.call(
524
+ :get, "/v1/apps/{appId}/segments/{segmentId}",
525
+ path_params: { "segmentId" => segment_id },
526
+ app_id: app_id,
527
+ response: "Segment",
528
+ request_options: request_options
529
+ )
530
+ end
531
+
532
+ # Segment güncelle
533
+ #
534
+ # PATCH /v1/apps/{appId}/segments/{segmentId}
535
+ def update(segment_id, body, app_id: nil, request_options: nil)
536
+ @client.call(
537
+ :patch, "/v1/apps/{appId}/segments/{segmentId}",
538
+ path_params: { "segmentId" => segment_id },
539
+ body: body,
540
+ app_id: app_id,
541
+ response: "Segment",
542
+ request_options: request_options
543
+ )
544
+ end
545
+
546
+ # Segment sil
547
+ #
548
+ # DELETE /v1/apps/{appId}/segments/{segmentId}
549
+ def delete(segment_id, app_id: nil, request_options: nil)
550
+ @client.call(
551
+ :delete, "/v1/apps/{appId}/segments/{segmentId}",
552
+ path_params: { "segmentId" => segment_id },
553
+ app_id: app_id,
554
+ response: "Ok",
555
+ request_options: request_options
556
+ )
557
+ end
558
+
559
+ # Segmenti kullanan kampanyalar
560
+ #
561
+ # GET /v1/apps/{appId}/segments/{segmentId}/campaigns
562
+ def used_by(segment_id, app_id: nil, request_options: nil)
563
+ @client.call(
564
+ :get, "/v1/apps/{appId}/segments/{segmentId}/campaigns",
565
+ path_params: { "segmentId" => segment_id },
566
+ app_id: app_id,
567
+ response: "SegmentCampaigns",
568
+ request_options: request_options
569
+ )
570
+ end
571
+
572
+ # Tahmini sayım
573
+ #
574
+ # POST /v1/apps/{appId}/segments/{segmentId}/estimate
575
+ #
576
+ # @param force true: önbelleği atla, tam sayım Değerler: "true", "false".
577
+ def estimate(segment_id, force: nil, app_id: nil, request_options: nil)
578
+ @client.call(
579
+ :post, "/v1/apps/{appId}/segments/{segmentId}/estimate",
580
+ path_params: { "segmentId" => segment_id },
581
+ query: { "force" => force },
582
+ app_id: app_id,
583
+ response: "SegmentEstimate",
584
+ request_options: request_options
585
+ )
586
+ end
587
+ end
588
+
589
+ # Şablon yönetimi, sürümler ve önizleme.
590
+ class Templates < Pushizo::BaseResource
591
+ # Şablon listesi
592
+ #
593
+ # GET /v1/apps/{appId}/templates
594
+ #
595
+ # @param channel Değerler: "ios_push", "android_push", "hms_push", "web_push", "email", "sms", "whatsapp", "rcs".
596
+ def list(limit: nil, cursor: nil, q: nil, channel: nil, app_id: nil, request_options: nil)
597
+ @client.call(
598
+ :get, "/v1/apps/{appId}/templates",
599
+ path_params: {},
600
+ query: { "limit" => limit, "cursor" => cursor, "q" => q, "channel" => channel },
601
+ app_id: app_id,
602
+ response: "TemplatePage",
603
+ request_options: request_options
604
+ )
605
+ end
606
+
607
+ # list sonuçlarını next_cursor ile tüm sayfalar boyunca tek tek dolaşan Enumerator döndürür (sayfalar tembel yüklenir).
608
+ def list_all(limit: nil, cursor: nil, q: nil, channel: nil, app_id: nil, request_options: nil)
609
+ @client.paginate(cursor) do |cursor_value|
610
+ list(limit: limit, q: q, channel: channel, app_id: app_id, request_options: request_options, cursor: cursor_value)
611
+ end
612
+ end
613
+
614
+ # Şablon oluştur
615
+ #
616
+ # POST /v1/apps/{appId}/templates
617
+ def create(body, app_id: nil, request_options: nil)
618
+ @client.call(
619
+ :post, "/v1/apps/{appId}/templates",
620
+ path_params: {},
621
+ body: body,
622
+ app_id: app_id,
623
+ response: "Template",
624
+ request_options: request_options
625
+ )
626
+ end
627
+
628
+ # Şablon detayı
629
+ #
630
+ # GET /v1/apps/{appId}/templates/{templateId}
631
+ def get(template_id, app_id: nil, request_options: nil)
632
+ @client.call(
633
+ :get, "/v1/apps/{appId}/templates/{templateId}",
634
+ path_params: { "templateId" => template_id },
635
+ app_id: app_id,
636
+ response: "Template",
637
+ request_options: request_options
638
+ )
639
+ end
640
+
641
+ # Şablon güncelle
642
+ #
643
+ # PATCH /v1/apps/{appId}/templates/{templateId}
644
+ def update(template_id, body, app_id: nil, request_options: nil)
645
+ @client.call(
646
+ :patch, "/v1/apps/{appId}/templates/{templateId}",
647
+ path_params: { "templateId" => template_id },
648
+ body: body,
649
+ app_id: app_id,
650
+ response: "Template",
651
+ request_options: request_options
652
+ )
653
+ end
654
+
655
+ # Şablon sil
656
+ #
657
+ # DELETE /v1/apps/{appId}/templates/{templateId}
658
+ def delete(template_id, app_id: nil, request_options: nil)
659
+ @client.call(
660
+ :delete, "/v1/apps/{appId}/templates/{templateId}",
661
+ path_params: { "templateId" => template_id },
662
+ app_id: app_id,
663
+ response: "Ok",
664
+ request_options: request_options
665
+ )
666
+ end
667
+
668
+ # Şablon analitiği
669
+ #
670
+ # GET /v1/apps/{appId}/templates/{templateId}/stats
671
+ def stats(template_id, app_id: nil, request_options: nil)
672
+ @client.call(
673
+ :get, "/v1/apps/{appId}/templates/{templateId}/stats",
674
+ path_params: { "templateId" => template_id },
675
+ app_id: app_id,
676
+ response: "TemplateStats",
677
+ request_options: request_options
678
+ )
679
+ end
680
+
681
+ # Şablonu aynı organizasyondaki başka bir app'e kopyala
682
+ #
683
+ # POST /v1/apps/{appId}/templates/{templateId}/copy_to_app
684
+ def copy_to_app(template_id, body, app_id: nil, request_options: nil)
685
+ @client.call(
686
+ :post, "/v1/apps/{appId}/templates/{templateId}/copy_to_app",
687
+ path_params: { "templateId" => template_id },
688
+ body: body,
689
+ app_id: app_id,
690
+ response: "Template",
691
+ request_options: request_options
692
+ )
693
+ end
694
+
695
+ # Sürüm geçmişi
696
+ #
697
+ # GET /v1/apps/{appId}/templates/{templateId}/versions
698
+ def versions(template_id, app_id: nil, request_options: nil)
699
+ @client.call(
700
+ :get, "/v1/apps/{appId}/templates/{templateId}/versions",
701
+ path_params: { "templateId" => template_id },
702
+ app_id: app_id,
703
+ response: "TemplateVersionList",
704
+ request_options: request_options
705
+ )
706
+ end
707
+
708
+ # Şablonu örnek verilerle render et
709
+ #
710
+ # POST /v1/apps/{appId}/templates/{templateId}/render
711
+ def render(template_id, body, app_id: nil, request_options: nil)
712
+ @client.call(
713
+ :post, "/v1/apps/{appId}/templates/{templateId}/render",
714
+ path_params: { "templateId" => template_id },
715
+ body: body,
716
+ app_id: app_id,
717
+ response: "RenderPreview",
718
+ request_options: request_options
719
+ )
720
+ end
721
+ end
722
+
723
+ # Kampanya yaşam döngüsü (zamanlama, gönderim, duraklatma, onay) ve istatistikler.
724
+ class Campaigns < Pushizo::BaseResource
725
+ # Kampanya listesi
726
+ #
727
+ # GET /v1/apps/{appId}/campaigns
728
+ #
729
+ # @param status Değerler: "draft", "scheduled", "running", "paused", "completed", "cancelled", "failed".
730
+ # @param type Değerler: "one_time", "scheduled", "recurring", "automated", "transactional".
731
+ # @param channel Değerler: "ios_push", "android_push", "hms_push", "web_push", "email", "sms", "whatsapp", "rcs".
732
+ def list(limit: nil, cursor: nil, q: nil, status: nil, type: nil, channel: nil, label: nil, app_id: nil, request_options: nil)
733
+ @client.call(
734
+ :get, "/v1/apps/{appId}/campaigns",
735
+ path_params: {},
736
+ query: { "limit" => limit, "cursor" => cursor, "q" => q, "status" => status, "type" => type, "channel" => channel, "label" => label },
737
+ app_id: app_id,
738
+ response: "CampaignPage",
739
+ request_options: request_options
740
+ )
741
+ end
742
+
743
+ # list sonuçlarını next_cursor ile tüm sayfalar boyunca tek tek dolaşan Enumerator döndürür (sayfalar tembel yüklenir).
744
+ def list_all(limit: nil, cursor: nil, q: nil, status: nil, type: nil, channel: nil, label: nil, app_id: nil, request_options: nil)
745
+ @client.paginate(cursor) do |cursor_value|
746
+ list(limit: limit, q: q, status: status, type: type, channel: channel, label: label, app_id: app_id, request_options: request_options, cursor: cursor_value)
747
+ end
748
+ end
749
+
750
+ # Kampanya oluştur
751
+ #
752
+ # POST /v1/apps/{appId}/campaigns
753
+ def create(body, app_id: nil, request_options: nil)
754
+ @client.call(
755
+ :post, "/v1/apps/{appId}/campaigns",
756
+ path_params: {},
757
+ body: body,
758
+ app_id: app_id,
759
+ response: "Campaign",
760
+ request_options: request_options
761
+ )
762
+ end
763
+
764
+ # Kampanya detayı
765
+ #
766
+ # GET /v1/apps/{appId}/campaigns/{campaignId}
767
+ def get(campaign_id, app_id: nil, request_options: nil)
768
+ @client.call(
769
+ :get, "/v1/apps/{appId}/campaigns/{campaignId}",
770
+ path_params: { "campaignId" => campaign_id },
771
+ app_id: app_id,
772
+ response: "Campaign",
773
+ request_options: request_options
774
+ )
775
+ end
776
+
777
+ # Kampanya güncelle
778
+ #
779
+ # PATCH /v1/apps/{appId}/campaigns/{campaignId}
780
+ def update(campaign_id, body, app_id: nil, request_options: nil)
781
+ @client.call(
782
+ :patch, "/v1/apps/{appId}/campaigns/{campaignId}",
783
+ path_params: { "campaignId" => campaign_id },
784
+ body: body,
785
+ app_id: app_id,
786
+ response: "Campaign",
787
+ request_options: request_options
788
+ )
789
+ end
790
+
791
+ # Kampanya sil
792
+ #
793
+ # DELETE /v1/apps/{appId}/campaigns/{campaignId}
794
+ def delete(campaign_id, app_id: nil, request_options: nil)
795
+ @client.call(
796
+ :delete, "/v1/apps/{appId}/campaigns/{campaignId}",
797
+ path_params: { "campaignId" => campaign_id },
798
+ app_id: app_id,
799
+ response: "Ok",
800
+ request_options: request_options
801
+ )
802
+ end
803
+
804
+ # Zamanla
805
+ #
806
+ # POST /v1/apps/{appId}/campaigns/{campaignId}/schedule
807
+ def schedule(campaign_id, body, app_id: nil, request_options: nil)
808
+ @client.call(
809
+ :post, "/v1/apps/{appId}/campaigns/{campaignId}/schedule",
810
+ path_params: { "campaignId" => campaign_id },
811
+ body: body,
812
+ app_id: app_id,
813
+ response: "Campaign",
814
+ request_options: request_options
815
+ )
816
+ end
817
+
818
+ # Hemen gönder
819
+ #
820
+ # POST /v1/apps/{appId}/campaigns/{campaignId}/send
821
+ def send_campaign(campaign_id, app_id: nil, request_options: nil)
822
+ @client.call(
823
+ :post, "/v1/apps/{appId}/campaigns/{campaignId}/send",
824
+ path_params: { "campaignId" => campaign_id },
825
+ app_id: app_id,
826
+ response: "Campaign",
827
+ request_options: request_options
828
+ )
829
+ end
830
+
831
+ # Duraklat
832
+ #
833
+ # POST /v1/apps/{appId}/campaigns/{campaignId}/pause
834
+ def pause(campaign_id, app_id: nil, request_options: nil)
835
+ @client.call(
836
+ :post, "/v1/apps/{appId}/campaigns/{campaignId}/pause",
837
+ path_params: { "campaignId" => campaign_id },
838
+ app_id: app_id,
839
+ response: "Campaign",
840
+ request_options: request_options
841
+ )
842
+ end
843
+
844
+ # Sürdür
845
+ #
846
+ # POST /v1/apps/{appId}/campaigns/{campaignId}/resume
847
+ def resume(campaign_id, app_id: nil, request_options: nil)
848
+ @client.call(
849
+ :post, "/v1/apps/{appId}/campaigns/{campaignId}/resume",
850
+ path_params: { "campaignId" => campaign_id },
851
+ app_id: app_id,
852
+ response: "Campaign",
853
+ request_options: request_options
854
+ )
855
+ end
856
+
857
+ # İptal
858
+ #
859
+ # POST /v1/apps/{appId}/campaigns/{campaignId}/cancel
860
+ def cancel(campaign_id, app_id: nil, request_options: nil)
861
+ @client.call(
862
+ :post, "/v1/apps/{appId}/campaigns/{campaignId}/cancel",
863
+ path_params: { "campaignId" => campaign_id },
864
+ app_id: app_id,
865
+ response: "Campaign",
866
+ request_options: request_options
867
+ )
868
+ end
869
+
870
+ # Çoğalt
871
+ #
872
+ # POST /v1/apps/{appId}/campaigns/{campaignId}/duplicate
873
+ def duplicate(campaign_id, app_id: nil, request_options: nil)
874
+ @client.call(
875
+ :post, "/v1/apps/{appId}/campaigns/{campaignId}/duplicate",
876
+ path_params: { "campaignId" => campaign_id },
877
+ app_id: app_id,
878
+ response: "Campaign",
879
+ request_options: request_options
880
+ )
881
+ end
882
+
883
+ # Onayla
884
+ #
885
+ # POST /v1/apps/{appId}/campaigns/{campaignId}/approve
886
+ def approve(campaign_id, app_id: nil, request_options: nil)
887
+ @client.call(
888
+ :post, "/v1/apps/{appId}/campaigns/{campaignId}/approve",
889
+ path_params: { "campaignId" => campaign_id },
890
+ app_id: app_id,
891
+ response: "Campaign",
892
+ request_options: request_options
893
+ )
894
+ end
895
+
896
+ # İstatistikler
897
+ #
898
+ # GET /v1/apps/{appId}/campaigns/{campaignId}/stats
899
+ def stats(campaign_id, app_id: nil, request_options: nil)
900
+ @client.call(
901
+ :get, "/v1/apps/{appId}/campaigns/{campaignId}/stats",
902
+ path_params: { "campaignId" => campaign_id },
903
+ app_id: app_id,
904
+ response: "CampaignStats",
905
+ request_options: request_options
906
+ )
907
+ end
908
+
909
+ # A/B varyant karşılaştırması
910
+ #
911
+ # GET /v1/apps/{appId}/campaigns/{campaignId}/variants/stats
912
+ def variant_stats(campaign_id, app_id: nil, request_options: nil)
913
+ @client.call(
914
+ :get, "/v1/apps/{appId}/campaigns/{campaignId}/variants/stats",
915
+ path_params: { "campaignId" => campaign_id },
916
+ app_id: app_id,
917
+ response: "CampaignVariantStats",
918
+ request_options: request_options
919
+ )
920
+ end
921
+
922
+ # A/B kazananını seç
923
+ #
924
+ # POST /v1/apps/{appId}/campaigns/{campaignId}/winner
925
+ def select_winner(campaign_id, body, app_id: nil, request_options: nil)
926
+ @client.call(
927
+ :post, "/v1/apps/{appId}/campaigns/{campaignId}/winner",
928
+ path_params: { "campaignId" => campaign_id },
929
+ body: body,
930
+ app_id: app_id,
931
+ response: "Campaign",
932
+ request_options: request_options
933
+ )
934
+ end
935
+
936
+ # Abone bazlı teslimatlar
937
+ #
938
+ # GET /v1/apps/{appId}/campaigns/{campaignId}/deliveries
939
+ #
940
+ # @param status Değerler: "pending", "sent", "delivered", "failed", "bounced", "suppressed", "expired", "cancelled".
941
+ def deliveries(campaign_id, limit: nil, cursor: nil, status: nil, app_id: nil, request_options: nil)
942
+ @client.call(
943
+ :get, "/v1/apps/{appId}/campaigns/{campaignId}/deliveries",
944
+ path_params: { "campaignId" => campaign_id },
945
+ query: { "limit" => limit, "cursor" => cursor, "status" => status },
946
+ app_id: app_id,
947
+ response: "DeliveryList",
948
+ request_options: request_options
949
+ )
950
+ end
951
+
952
+ # deliveries sonuçlarını next_cursor ile tüm sayfalar boyunca tek tek dolaşan Enumerator döndürür (sayfalar tembel yüklenir).
953
+ def deliveries_all(campaign_id, limit: nil, cursor: nil, status: nil, app_id: nil, request_options: nil)
954
+ @client.paginate(cursor) do |cursor_value|
955
+ deliveries(campaign_id, limit: limit, status: status, app_id: app_id, request_options: request_options, cursor: cursor_value)
956
+ end
957
+ end
958
+
959
+ # Başarısız teslimatlara yeniden gönder
960
+ #
961
+ # POST /v1/apps/{appId}/campaigns/{campaignId}/resend-failed
962
+ def resend_failed(campaign_id, app_id: nil, request_options: nil)
963
+ @client.call(
964
+ :post, "/v1/apps/{appId}/campaigns/{campaignId}/resend-failed",
965
+ path_params: { "campaignId" => campaign_id },
966
+ app_id: app_id,
967
+ response: "Campaign",
968
+ request_options: request_options
969
+ )
970
+ end
971
+
972
+ # Kampanya çalıştırmaları
973
+ #
974
+ # GET /v1/apps/{appId}/campaigns/{campaignId}/messages
975
+ def messages(campaign_id, app_id: nil, request_options: nil)
976
+ @client.call(
977
+ :get, "/v1/apps/{appId}/campaigns/{campaignId}/messages",
978
+ path_params: { "campaignId" => campaign_id },
979
+ app_id: app_id,
980
+ response: "MessageList",
981
+ request_options: request_options
982
+ )
983
+ end
984
+ end
985
+
986
+ # Uygulama içi (in-app) mesaj yönetimi ve durum değişiklikleri.
987
+ class InAppMessages < Pushizo::BaseResource
988
+ # In-app mesajlar (durum filtresi; istatistik dahil)
989
+ #
990
+ # GET /v1/apps/{appId}/in-app-messages
991
+ #
992
+ # @param status Değerler: "draft", "active", "paused", "archived".
993
+ def list(limit: nil, cursor: nil, status: nil, app_id: nil, request_options: nil)
994
+ @client.call(
995
+ :get, "/v1/apps/{appId}/in-app-messages",
996
+ path_params: {},
997
+ query: { "limit" => limit, "cursor" => cursor, "status" => status },
998
+ app_id: app_id,
999
+ response: "InAppMessagePage",
1000
+ request_options: request_options
1001
+ )
1002
+ end
1003
+
1004
+ # list sonuçlarını next_cursor ile tüm sayfalar boyunca tek tek dolaşan Enumerator döndürür (sayfalar tembel yüklenir).
1005
+ def list_all(limit: nil, cursor: nil, status: nil, app_id: nil, request_options: nil)
1006
+ @client.paginate(cursor) do |cursor_value|
1007
+ list(limit: limit, status: status, app_id: app_id, request_options: request_options, cursor: cursor_value)
1008
+ end
1009
+ end
1010
+
1011
+ # In-app mesaj oluştur (taslak)
1012
+ #
1013
+ # POST /v1/apps/{appId}/in-app-messages
1014
+ def create(body, app_id: nil, request_options: nil)
1015
+ @client.call(
1016
+ :post, "/v1/apps/{appId}/in-app-messages",
1017
+ path_params: {},
1018
+ body: body,
1019
+ app_id: app_id,
1020
+ response: "InAppMessage",
1021
+ request_options: request_options
1022
+ )
1023
+ end
1024
+
1025
+ # In-app mesaj detayı ve istatistikleri
1026
+ #
1027
+ # GET /v1/apps/{appId}/in-app-messages/{messageId}
1028
+ def get(message_id, app_id: nil, request_options: nil)
1029
+ @client.call(
1030
+ :get, "/v1/apps/{appId}/in-app-messages/{messageId}",
1031
+ path_params: { "messageId" => message_id },
1032
+ app_id: app_id,
1033
+ response: "InAppMessage",
1034
+ request_options: request_options
1035
+ )
1036
+ end
1037
+
1038
+ # In-app mesajı düzenle
1039
+ #
1040
+ # PATCH /v1/apps/{appId}/in-app-messages/{messageId}
1041
+ def update(message_id, body, app_id: nil, request_options: nil)
1042
+ @client.call(
1043
+ :patch, "/v1/apps/{appId}/in-app-messages/{messageId}",
1044
+ path_params: { "messageId" => message_id },
1045
+ body: body,
1046
+ app_id: app_id,
1047
+ response: "InAppMessage",
1048
+ request_options: request_options
1049
+ )
1050
+ end
1051
+
1052
+ # In-app mesajı sil
1053
+ #
1054
+ # DELETE /v1/apps/{appId}/in-app-messages/{messageId}
1055
+ def delete(message_id, app_id: nil, request_options: nil)
1056
+ @client.call(
1057
+ :delete, "/v1/apps/{appId}/in-app-messages/{messageId}",
1058
+ path_params: { "messageId" => message_id },
1059
+ app_id: app_id,
1060
+ response: "Ok",
1061
+ request_options: request_options
1062
+ )
1063
+ end
1064
+
1065
+ # Yayınla / duraklat / arşivle
1066
+ #
1067
+ # POST /v1/apps/{appId}/in-app-messages/{messageId}/status
1068
+ def status(message_id, body, app_id: nil, request_options: nil)
1069
+ @client.call(
1070
+ :post, "/v1/apps/{appId}/in-app-messages/{messageId}/status",
1071
+ path_params: { "messageId" => message_id },
1072
+ body: body,
1073
+ app_id: app_id,
1074
+ response: "InAppMessage",
1075
+ request_options: request_options
1076
+ )
1077
+ end
1078
+
1079
+ # A/B kazananını elle seç
1080
+ #
1081
+ # POST /v1/apps/{appId}/in-app-messages/{messageId}/winner
1082
+ def select_winner(message_id, body, app_id: nil, request_options: nil)
1083
+ @client.call(
1084
+ :post, "/v1/apps/{appId}/in-app-messages/{messageId}/winner",
1085
+ path_params: { "messageId" => message_id },
1086
+ body: body,
1087
+ app_id: app_id,
1088
+ response: "InAppMessage",
1089
+ request_options: request_options
1090
+ )
1091
+ end
1092
+
1093
+ # A/B kazananını elle seç
1094
+ #
1095
+ # POST /v1/apps/{appId}/in-app-messages/{messageId}/winner
1096
+ #
1097
+ # @deprecated #select_winner kullanın; bu ad geriye dönük uyumluluk için korunur.
1098
+ def winner(message_id, body, app_id: nil, request_options: nil)
1099
+ @client.call(
1100
+ :post, "/v1/apps/{appId}/in-app-messages/{messageId}/winner",
1101
+ path_params: { "messageId" => message_id },
1102
+ body: body,
1103
+ app_id: app_id,
1104
+ response: "InAppMessage",
1105
+ request_options: request_options
1106
+ )
1107
+ end
1108
+ end
1109
+
1110
+ # Kullanıcı bildirim kutusu (inbox): listeleme, okundu işaretleme ve arşivleme.
1111
+ class Inbox < Pushizo::BaseResource
1112
+ # Takımlar
1113
+ #
1114
+ # GET /v1/apps/{appId}/inbox/teams
1115
+ def teams(app_id: nil, request_options: nil)
1116
+ @client.call(
1117
+ :get, "/v1/apps/{appId}/inbox/teams",
1118
+ path_params: {},
1119
+ app_id: app_id,
1120
+ response: "InboxTeamList",
1121
+ request_options: request_options
1122
+ )
1123
+ end
1124
+
1125
+ # Temsilciler ve varlık durumu
1126
+ #
1127
+ # GET /v1/apps/{appId}/inbox/agents
1128
+ def agents(app_id: nil, request_options: nil)
1129
+ @client.call(
1130
+ :get, "/v1/apps/{appId}/inbox/agents",
1131
+ path_params: {},
1132
+ app_id: app_id,
1133
+ response: "InboxAgentList",
1134
+ request_options: request_options
1135
+ )
1136
+ end
1137
+
1138
+ # Gelen kutusu ayarları
1139
+ #
1140
+ # GET /v1/apps/{appId}/inbox/settings
1141
+ def settings(app_id: nil, request_options: nil)
1142
+ @client.call(
1143
+ :get, "/v1/apps/{appId}/inbox/settings",
1144
+ path_params: {},
1145
+ app_id: app_id,
1146
+ response: "InboxSettings",
1147
+ request_options: request_options
1148
+ )
1149
+ end
1150
+
1151
+ # Gelen kutusu ayarlarını güncelle
1152
+ #
1153
+ # PUT /v1/apps/{appId}/inbox/settings
1154
+ def update_settings(body, app_id: nil, request_options: nil)
1155
+ @client.call(
1156
+ :put, "/v1/apps/{appId}/inbox/settings",
1157
+ path_params: {},
1158
+ body: body,
1159
+ app_id: app_id,
1160
+ response: "InboxSettings",
1161
+ request_options: request_options
1162
+ )
1163
+ end
1164
+
1165
+ # Gelen kutusu metrikleri (ilk yanıt/çözüm ort. ve p90, SLA, temsilci tablosu)
1166
+ #
1167
+ # GET /v1/apps/{appId}/inbox/metrics
1168
+ #
1169
+ # @param channel Değerler: "sms", "whatsapp", "rcs", "email", "chat".
1170
+ def metrics(from: nil, to: nil, channel: nil, app_id: nil, request_options: nil)
1171
+ @client.call(
1172
+ :get, "/v1/apps/{appId}/inbox/metrics",
1173
+ path_params: {},
1174
+ query: { "from" => from, "to" => to, "channel" => channel },
1175
+ app_id: app_id,
1176
+ response: "InboxMetrics",
1177
+ request_options: request_options
1178
+ )
1179
+ end
1180
+
1181
+ # Kullanıcının bildirim kutusu (okunmamış sayısı dahil)
1182
+ #
1183
+ # GET /v1/apps/{appId}/users/by/{label}/{value}/inbox
1184
+ #
1185
+ # @param include_archived Değerler: "true", "false".
1186
+ def list(label, value, limit: nil, cursor: nil, include_archived: nil, app_id: nil, request_options: nil)
1187
+ @client.call(
1188
+ :get, "/v1/apps/{appId}/users/by/{label}/{value}/inbox",
1189
+ path_params: { "label" => label, "value" => value },
1190
+ query: { "limit" => limit, "cursor" => cursor, "include_archived" => include_archived },
1191
+ app_id: app_id,
1192
+ response: "InboxPage",
1193
+ request_options: request_options
1194
+ )
1195
+ end
1196
+
1197
+ # list sonuçlarını next_cursor ile tüm sayfalar boyunca tek tek dolaşan Enumerator döndürür (sayfalar tembel yüklenir).
1198
+ def list_all(label, value, limit: nil, cursor: nil, include_archived: nil, app_id: nil, request_options: nil)
1199
+ @client.paginate(cursor) do |cursor_value|
1200
+ list(label, value, limit: limit, include_archived: include_archived, app_id: app_id, request_options: request_options, cursor: cursor_value)
1201
+ end
1202
+ end
1203
+
1204
+ # Tümünü okundu işaretle
1205
+ #
1206
+ # POST /v1/apps/{appId}/users/by/{label}/{value}/inbox/read-all
1207
+ def read_all(label, value, app_id: nil, request_options: nil)
1208
+ @client.call(
1209
+ :post, "/v1/apps/{appId}/users/by/{label}/{value}/inbox/read-all",
1210
+ path_params: { "label" => label, "value" => value },
1211
+ app_id: app_id,
1212
+ response: "InboxReadAllResult",
1213
+ request_options: request_options
1214
+ )
1215
+ end
1216
+
1217
+ # Okundu işaretle
1218
+ #
1219
+ # POST /v1/apps/{appId}/users/by/{label}/{value}/inbox/{itemId}/read
1220
+ def read(label, value, item_id, app_id: nil, request_options: nil)
1221
+ @client.call(
1222
+ :post, "/v1/apps/{appId}/users/by/{label}/{value}/inbox/{itemId}/read",
1223
+ path_params: { "label" => label, "value" => value, "itemId" => item_id },
1224
+ app_id: app_id,
1225
+ response: "InboxItem",
1226
+ request_options: request_options
1227
+ )
1228
+ end
1229
+
1230
+ # Kutudan kaldır (arşivle)
1231
+ #
1232
+ # DELETE /v1/apps/{appId}/users/by/{label}/{value}/inbox/{itemId}
1233
+ def archive(label, value, item_id, app_id: nil, request_options: nil)
1234
+ @client.call(
1235
+ :delete, "/v1/apps/{appId}/users/by/{label}/{value}/inbox/{itemId}",
1236
+ path_params: { "label" => label, "value" => value, "itemId" => item_id },
1237
+ app_id: app_id,
1238
+ response: "Ok",
1239
+ request_options: request_options
1240
+ )
1241
+ end
1242
+ end
1243
+
1244
+ # E-posta/SMS gönderim engeli (suppression) listesi.
1245
+ class Suppressions < Pushizo::BaseResource
1246
+ # Suppression list (e-posta/SMS gönderilmeyecek adresler; kanal/neden/değer filtresi)
1247
+ #
1248
+ # GET /v1/apps/{appId}/suppressions
1249
+ #
1250
+ # @param channel Değerler: "email", "sms", "whatsapp", "rcs".
1251
+ # @param reason Değerler: "bounce", "complaint", "manual", "unsubscribe_link", "stop".
1252
+ def list(limit: nil, cursor: nil, channel: nil, reason: nil, value: nil, app_id: nil, request_options: nil)
1253
+ @client.call(
1254
+ :get, "/v1/apps/{appId}/suppressions",
1255
+ path_params: {},
1256
+ query: { "limit" => limit, "cursor" => cursor, "channel" => channel, "reason" => reason, "value" => value },
1257
+ app_id: app_id,
1258
+ response: "SuppressionPage",
1259
+ request_options: request_options
1260
+ )
1261
+ end
1262
+
1263
+ # list sonuçlarını next_cursor ile tüm sayfalar boyunca tek tek dolaşan Enumerator döndürür (sayfalar tembel yüklenir).
1264
+ def list_all(limit: nil, cursor: nil, channel: nil, reason: nil, value: nil, app_id: nil, request_options: nil)
1265
+ @client.paginate(cursor) do |cursor_value|
1266
+ list(limit: limit, channel: channel, reason: reason, value: value, app_id: app_id, request_options: request_options, cursor: cursor_value)
1267
+ end
1268
+ end
1269
+
1270
+ # Adres ekle (manuel engel; değer saklanmaz, özet + maskeli gösterim)
1271
+ #
1272
+ # POST /v1/apps/{appId}/suppressions
1273
+ def create(body, app_id: nil, request_options: nil)
1274
+ @client.call(
1275
+ :post, "/v1/apps/{appId}/suppressions",
1276
+ path_params: {},
1277
+ body: body,
1278
+ app_id: app_id,
1279
+ response: "Suppression",
1280
+ request_options: request_options
1281
+ )
1282
+ end
1283
+
1284
+ # Kaydı kaldır (adres yeniden gönderim alabilir)
1285
+ #
1286
+ # DELETE /v1/apps/{appId}/suppressions/{suppressionId}
1287
+ def delete(suppression_id, app_id: nil, request_options: nil)
1288
+ @client.call(
1289
+ :delete, "/v1/apps/{appId}/suppressions/{suppressionId}",
1290
+ path_params: { "suppressionId" => suppression_id },
1291
+ app_id: app_id,
1292
+ response: "Ok",
1293
+ request_options: request_options
1294
+ )
1295
+ end
1296
+ end
1297
+
1298
+ # Veri dışa aktarma işleri.
1299
+ class Exports < Pushizo::BaseResource
1300
+ # Export işi başlat
1301
+ #
1302
+ # POST /v1/apps/{appId}/exports
1303
+ def create(body, app_id: nil, request_options: nil)
1304
+ @client.call(
1305
+ :post, "/v1/apps/{appId}/exports",
1306
+ path_params: {},
1307
+ body: body,
1308
+ app_id: app_id,
1309
+ response: "Export",
1310
+ request_options: request_options
1311
+ )
1312
+ end
1313
+
1314
+ # Export işleri
1315
+ #
1316
+ # GET /v1/apps/{appId}/exports
1317
+ def list(limit: nil, cursor: nil, app_id: nil, request_options: nil)
1318
+ @client.call(
1319
+ :get, "/v1/apps/{appId}/exports",
1320
+ path_params: {},
1321
+ query: { "limit" => limit, "cursor" => cursor },
1322
+ app_id: app_id,
1323
+ response: "ExportList",
1324
+ request_options: request_options
1325
+ )
1326
+ end
1327
+
1328
+ # list sonuçlarını next_cursor ile tüm sayfalar boyunca tek tek dolaşan Enumerator döndürür (sayfalar tembel yüklenir).
1329
+ def list_all(limit: nil, cursor: nil, app_id: nil, request_options: nil)
1330
+ @client.paginate(cursor) do |cursor_value|
1331
+ list(limit: limit, app_id: app_id, request_options: request_options, cursor: cursor_value)
1332
+ end
1333
+ end
1334
+
1335
+ # Export durumu (download_url)
1336
+ #
1337
+ # GET /v1/apps/{appId}/exports/{exportId}
1338
+ def get(export_id, app_id: nil, request_options: nil)
1339
+ @client.call(
1340
+ :get, "/v1/apps/{appId}/exports/{exportId}",
1341
+ path_params: { "exportId" => export_id },
1342
+ app_id: app_id,
1343
+ response: "Export",
1344
+ request_options: request_options
1345
+ )
1346
+ end
1347
+ end
1348
+
1349
+ # Veri içe aktarma işleri (CSV, multipart).
1350
+ class Imports < Pushizo::BaseResource
1351
+ # Import işi başlat (multipart: type, file)
1352
+ #
1353
+ # POST /v1/apps/{appId}/imports
1354
+ #
1355
+ # @param type Değerler: "legacy_players", "csv_users".
1356
+ # @param file CSV dosyası (UTF-8, en fazla 50 MB)
1357
+ def create(type:, file:, app_id: nil, request_options: nil)
1358
+ @client.call(
1359
+ :post, "/v1/apps/{appId}/imports",
1360
+ path_params: {},
1361
+ form: { "type" => type, "file" => file },
1362
+ app_id: app_id,
1363
+ response: "Import",
1364
+ request_options: request_options
1365
+ )
1366
+ end
1367
+
1368
+ # Import işleri
1369
+ #
1370
+ # GET /v1/apps/{appId}/imports
1371
+ def list(limit: nil, cursor: nil, app_id: nil, request_options: nil)
1372
+ @client.call(
1373
+ :get, "/v1/apps/{appId}/imports",
1374
+ path_params: {},
1375
+ query: { "limit" => limit, "cursor" => cursor },
1376
+ app_id: app_id,
1377
+ response: "ImportList",
1378
+ request_options: request_options
1379
+ )
1380
+ end
1381
+
1382
+ # list sonuçlarını next_cursor ile tüm sayfalar boyunca tek tek dolaşan Enumerator döndürür (sayfalar tembel yüklenir).
1383
+ def list_all(limit: nil, cursor: nil, app_id: nil, request_options: nil)
1384
+ @client.paginate(cursor) do |cursor_value|
1385
+ list(limit: limit, app_id: app_id, request_options: request_options, cursor: cursor_value)
1386
+ end
1387
+ end
1388
+
1389
+ # Import durumu
1390
+ #
1391
+ # GET /v1/apps/{appId}/imports/{importId}
1392
+ def get(import_id, app_id: nil, request_options: nil)
1393
+ @client.call(
1394
+ :get, "/v1/apps/{appId}/imports/{importId}",
1395
+ path_params: { "importId" => import_id },
1396
+ app_id: app_id,
1397
+ response: "Import",
1398
+ request_options: request_options
1399
+ )
1400
+ end
1401
+ end
1402
+
1403
+ # Giden webhook uç noktaları, teslimatlar ve yeniden gönderim.
1404
+ class Webhooks < Pushizo::BaseResource
1405
+ # Webhook endpoint'leri
1406
+ #
1407
+ # GET /v1/apps/{appId}/webhooks
1408
+ def list(app_id: nil, request_options: nil)
1409
+ @client.call(
1410
+ :get, "/v1/apps/{appId}/webhooks",
1411
+ path_params: {},
1412
+ app_id: app_id,
1413
+ response: "WebhookList",
1414
+ request_options: request_options
1415
+ )
1416
+ end
1417
+
1418
+ # Endpoint oluştur (secret yalnızca bu yanıtta döner)
1419
+ #
1420
+ # POST /v1/apps/{appId}/webhooks
1421
+ def create(body, app_id: nil, request_options: nil)
1422
+ @client.call(
1423
+ :post, "/v1/apps/{appId}/webhooks",
1424
+ path_params: {},
1425
+ body: body,
1426
+ app_id: app_id,
1427
+ response: "WebhookWithSecret",
1428
+ request_options: request_options
1429
+ )
1430
+ end
1431
+
1432
+ # Event Streams önizlemesi: örnek olay + şablon + filtre → gövde/hata (gönderim yapmaz)
1433
+ #
1434
+ # POST /v1/apps/{appId}/webhooks/preview
1435
+ def preview(body, app_id: nil, request_options: nil)
1436
+ @client.call(
1437
+ :post, "/v1/apps/{appId}/webhooks/preview",
1438
+ path_params: {},
1439
+ body: body,
1440
+ app_id: app_id,
1441
+ response: "WebhookPreviewResult",
1442
+ request_options: request_options
1443
+ )
1444
+ end
1445
+
1446
+ # Endpoint detayı
1447
+ #
1448
+ # GET /v1/apps/{appId}/webhooks/{webhookId}
1449
+ def get(webhook_id, app_id: nil, request_options: nil)
1450
+ @client.call(
1451
+ :get, "/v1/apps/{appId}/webhooks/{webhookId}",
1452
+ path_params: { "webhookId" => webhook_id },
1453
+ app_id: app_id,
1454
+ response: "Webhook",
1455
+ request_options: request_options
1456
+ )
1457
+ end
1458
+
1459
+ # Endpoint güncelle (URL, olaylar, batch, başlıklar, etkinleştir/durdur)
1460
+ #
1461
+ # PATCH /v1/apps/{appId}/webhooks/{webhookId}
1462
+ def update(webhook_id, body, app_id: nil, request_options: nil)
1463
+ @client.call(
1464
+ :patch, "/v1/apps/{appId}/webhooks/{webhookId}",
1465
+ path_params: { "webhookId" => webhook_id },
1466
+ body: body,
1467
+ app_id: app_id,
1468
+ response: "Webhook",
1469
+ request_options: request_options
1470
+ )
1471
+ end
1472
+
1473
+ # Endpoint sil
1474
+ #
1475
+ # DELETE /v1/apps/{appId}/webhooks/{webhookId}
1476
+ def delete(webhook_id, app_id: nil, request_options: nil)
1477
+ @client.call(
1478
+ :delete, "/v1/apps/{appId}/webhooks/{webhookId}",
1479
+ path_params: { "webhookId" => webhook_id },
1480
+ app_id: app_id,
1481
+ response: "Ok",
1482
+ request_options: request_options
1483
+ )
1484
+ end
1485
+
1486
+ # Secret rotasyonu (eski secret 24 saat ikinci imza olarak gönderilir)
1487
+ #
1488
+ # POST /v1/apps/{appId}/webhooks/{webhookId}/rotate-secret
1489
+ def rotate_secret(webhook_id, app_id: nil, request_options: nil)
1490
+ @client.call(
1491
+ :post, "/v1/apps/{appId}/webhooks/{webhookId}/rotate-secret",
1492
+ path_params: { "webhookId" => webhook_id },
1493
+ app_id: app_id,
1494
+ response: "WebhookWithSecret",
1495
+ request_options: request_options
1496
+ )
1497
+ end
1498
+
1499
+ # Test olayı gönder (anında, sonuç döner)
1500
+ #
1501
+ # POST /v1/apps/{appId}/webhooks/{webhookId}/test
1502
+ def test(webhook_id, app_id: nil, request_options: nil)
1503
+ @client.call(
1504
+ :post, "/v1/apps/{appId}/webhooks/{webhookId}/test",
1505
+ path_params: { "webhookId" => webhook_id },
1506
+ app_id: app_id,
1507
+ response: "WebhookDeliveryDetail",
1508
+ request_options: request_options
1509
+ )
1510
+ end
1511
+
1512
+ # Teslim geçmişi (cursor; durum/olay türü filtresi)
1513
+ #
1514
+ # GET /v1/apps/{appId}/webhooks/{webhookId}/deliveries
1515
+ #
1516
+ # @param status Değerler: "pending", "success", "failed", "dead".
1517
+ def deliveries(webhook_id, limit: nil, cursor: nil, status: nil, event_type: nil, app_id: nil, request_options: nil)
1518
+ @client.call(
1519
+ :get, "/v1/apps/{appId}/webhooks/{webhookId}/deliveries",
1520
+ path_params: { "webhookId" => webhook_id },
1521
+ query: { "limit" => limit, "cursor" => cursor, "status" => status, "event_type" => event_type },
1522
+ app_id: app_id,
1523
+ response: "WebhookDeliveryPage",
1524
+ request_options: request_options
1525
+ )
1526
+ end
1527
+
1528
+ # deliveries sonuçlarını next_cursor ile tüm sayfalar boyunca tek tek dolaşan Enumerator döndürür (sayfalar tembel yüklenir).
1529
+ def deliveries_all(webhook_id, limit: nil, cursor: nil, status: nil, event_type: nil, app_id: nil, request_options: nil)
1530
+ @client.paginate(cursor) do |cursor_value|
1531
+ deliveries(webhook_id, limit: limit, status: status, event_type: event_type, app_id: app_id, request_options: request_options, cursor: cursor_value)
1532
+ end
1533
+ end
1534
+
1535
+ # Teslimi yeniden gönder (aynı olay kimliğiyle)
1536
+ #
1537
+ # POST /v1/apps/{appId}/webhooks/deliveries/{deliveryId}/replay
1538
+ def replay(delivery_id, app_id: nil, request_options: nil)
1539
+ @client.call(
1540
+ :post, "/v1/apps/{appId}/webhooks/deliveries/{deliveryId}/replay",
1541
+ path_params: { "deliveryId" => delivery_id },
1542
+ app_id: app_id,
1543
+ response: "WebhookDeliveryDetail",
1544
+ request_options: request_options
1545
+ )
1546
+ end
1547
+ end
1548
+
1549
+ # Kanal (APNs, FCM, Web Push, e-posta, SMS) yapılandırması ve doğrulaması.
1550
+ class Channels < Pushizo::BaseResource
1551
+ # Kanal yapılandırmaları
1552
+ #
1553
+ # GET /v1/apps/{appId}/channels
1554
+ def list(app_id: nil, request_options: nil)
1555
+ @client.call(
1556
+ :get, "/v1/apps/{appId}/channels",
1557
+ path_params: {},
1558
+ app_id: app_id,
1559
+ response: "ChannelList",
1560
+ request_options: request_options
1561
+ )
1562
+ end
1563
+
1564
+ # Kimlik bilgisi yükle (APNs p8, FCM servis hesabı, VAPID, mock)
1565
+ #
1566
+ # PUT /v1/apps/{appId}/channels/{channel}
1567
+ def upsert(channel, body, app_id: nil, request_options: nil)
1568
+ @client.call(
1569
+ :put, "/v1/apps/{appId}/channels/{channel}",
1570
+ path_params: { "channel" => channel },
1571
+ body: body,
1572
+ app_id: app_id,
1573
+ response: "ChannelConfig",
1574
+ request_options: request_options
1575
+ )
1576
+ end
1577
+
1578
+ # Sağlayıcıya test bağlantısı
1579
+ #
1580
+ # POST /v1/apps/{appId}/channels/{channel}/validate
1581
+ def validate(channel, app_id: nil, request_options: nil)
1582
+ @client.call(
1583
+ :post, "/v1/apps/{appId}/channels/{channel}/validate",
1584
+ path_params: { "channel" => channel },
1585
+ app_id: app_id,
1586
+ response: "ChannelValidation",
1587
+ request_options: request_options
1588
+ )
1589
+ end
1590
+ end
1591
+
1592
+ # Analitik raporları.
1593
+ class Analytics < Pushizo::BaseResource
1594
+ # Genel bakış KPI
1595
+ #
1596
+ # GET /v1/apps/{appId}/analytics/overview
1597
+ #
1598
+ # @param range Değerler: "7d", "30d".
1599
+ def overview(range: nil, from: nil, to: nil, app_id: nil, request_options: nil)
1600
+ @client.call(
1601
+ :get, "/v1/apps/{appId}/analytics/overview",
1602
+ path_params: {},
1603
+ query: { "range" => range, "from" => from, "to" => to },
1604
+ app_id: app_id,
1605
+ response: "OverviewStats",
1606
+ request_options: request_options
1607
+ )
1608
+ end
1609
+
1610
+ # Teslimat raporu
1611
+ #
1612
+ # GET /v1/apps/{appId}/analytics/messages
1613
+ #
1614
+ # @param compare Değerler: "true", "false".
1615
+ # @param format Değerler: "json", "csv".
1616
+ # @param group_by Değerler: "day", "channel", "campaign".
1617
+ def messages(from: nil, to: nil, compare: nil, format: nil, group_by: nil, app_id: nil, request_options: nil)
1618
+ @client.call(
1619
+ :get, "/v1/apps/{appId}/analytics/messages",
1620
+ path_params: {},
1621
+ query: { "from" => from, "to" => to, "compare" => compare, "format" => format, "group_by" => group_by },
1622
+ app_id: app_id,
1623
+ response: "MessagesReport",
1624
+ request_options: request_options
1625
+ )
1626
+ end
1627
+
1628
+ # Abonelik büyümesi
1629
+ #
1630
+ # GET /v1/apps/{appId}/analytics/subscriptions
1631
+ #
1632
+ # @param compare Değerler: "true", "false".
1633
+ # @param format Değerler: "json", "csv".
1634
+ def subscriptions(from: nil, to: nil, compare: nil, format: nil, app_id: nil, request_options: nil)
1635
+ @client.call(
1636
+ :get, "/v1/apps/{appId}/analytics/subscriptions",
1637
+ path_params: {},
1638
+ query: { "from" => from, "to" => to, "compare" => compare, "format" => format },
1639
+ app_id: app_id,
1640
+ response: "SubscriptionsReport",
1641
+ request_options: request_options
1642
+ )
1643
+ end
1644
+
1645
+ # Olay hacmi
1646
+ #
1647
+ # GET /v1/apps/{appId}/analytics/events
1648
+ #
1649
+ # @param compare Değerler: "true", "false".
1650
+ # @param format Değerler: "json", "csv".
1651
+ # @param group_by Değerler: "day", "name".
1652
+ def events(from: nil, to: nil, compare: nil, format: nil, name: nil, group_by: nil, app_id: nil, request_options: nil)
1653
+ @client.call(
1654
+ :get, "/v1/apps/{appId}/analytics/events",
1655
+ path_params: {},
1656
+ query: { "from" => from, "to" => to, "compare" => compare, "format" => format, "name" => name, "group_by" => group_by },
1657
+ app_id: app_id,
1658
+ response: "EventsReport",
1659
+ request_options: request_options
1660
+ )
1661
+ end
1662
+
1663
+ # Dönüşüm/atribüsyon
1664
+ #
1665
+ # GET /v1/apps/{appId}/analytics/conversions
1666
+ #
1667
+ # @param compare Değerler: "true", "false".
1668
+ # @param format Değerler: "json", "csv".
1669
+ def conversions(from: nil, to: nil, compare: nil, format: nil, campaign_id: nil, app_id: nil, request_options: nil)
1670
+ @client.call(
1671
+ :get, "/v1/apps/{appId}/analytics/conversions",
1672
+ path_params: {},
1673
+ query: { "from" => from, "to" => to, "compare" => compare, "format" => format, "campaign_id" => campaign_id },
1674
+ app_id: app_id,
1675
+ response: "ConversionsReport",
1676
+ request_options: request_options
1677
+ )
1678
+ end
1679
+
1680
+ # Funnel
1681
+ #
1682
+ # POST /v1/apps/{appId}/analytics/funnels
1683
+ def funnel(body, app_id: nil, request_options: nil)
1684
+ @client.call(
1685
+ :post, "/v1/apps/{appId}/analytics/funnels",
1686
+ path_params: {},
1687
+ body: body,
1688
+ app_id: app_id,
1689
+ response: "FunnelReport",
1690
+ request_options: request_options
1691
+ )
1692
+ end
1693
+
1694
+ # Sağlayıcı sağlığı
1695
+ #
1696
+ # GET /v1/apps/{appId}/analytics/providers
1697
+ #
1698
+ # @param compare Değerler: "true", "false".
1699
+ # @param format Değerler: "json", "csv".
1700
+ def providers(from: nil, to: nil, compare: nil, format: nil, app_id: nil, request_options: nil)
1701
+ @client.call(
1702
+ :get, "/v1/apps/{appId}/analytics/providers",
1703
+ path_params: {},
1704
+ query: { "from" => from, "to" => to, "compare" => compare, "format" => format },
1705
+ app_id: app_id,
1706
+ response: "ProvidersReport",
1707
+ request_options: request_options
1708
+ )
1709
+ end
1710
+
1711
+ # Retention kohortu
1712
+ #
1713
+ # GET /v1/apps/{appId}/analytics/retention
1714
+ #
1715
+ # @param format Değerler: "json", "csv".
1716
+ def retention(weeks: nil, format: nil, app_id: nil, request_options: nil)
1717
+ @client.call(
1718
+ :get, "/v1/apps/{appId}/analytics/retention",
1719
+ path_params: {},
1720
+ query: { "weeks" => weeks, "format" => format },
1721
+ app_id: app_id,
1722
+ response: "RetentionReport",
1723
+ request_options: request_options
1724
+ )
1725
+ end
1726
+
1727
+ # Etkileşim ısı haritası
1728
+ #
1729
+ # GET /v1/apps/{appId}/analytics/engagement
1730
+ #
1731
+ # @param compare Değerler: "true", "false".
1732
+ # @param format Değerler: "json", "csv".
1733
+ def engagement(from: nil, to: nil, compare: nil, format: nil, app_id: nil, request_options: nil)
1734
+ @client.call(
1735
+ :get, "/v1/apps/{appId}/analytics/engagement",
1736
+ path_params: {},
1737
+ query: { "from" => from, "to" => to, "compare" => compare, "format" => format },
1738
+ app_id: app_id,
1739
+ response: "EngagementReport",
1740
+ request_options: request_options
1741
+ )
1742
+ end
1743
+ end
1744
+
1745
+ # App listesi ve ayarları.
1746
+ class Apps < Pushizo::BaseResource
1747
+ # App listesi (org geneli admin anahtarı)
1748
+ #
1749
+ # GET /v1/apps
1750
+ def list(request_options: nil)
1751
+ @client.call(
1752
+ :get, "/v1/apps",
1753
+ path_params: {},
1754
+ response: "AppList",
1755
+ request_options: request_options
1756
+ )
1757
+ end
1758
+
1759
+ # App oluştur (org geneli admin anahtarı)
1760
+ #
1761
+ # POST /v1/apps
1762
+ def create(body, request_options: nil)
1763
+ @client.call(
1764
+ :post, "/v1/apps",
1765
+ path_params: {},
1766
+ body: body,
1767
+ response: "App",
1768
+ request_options: request_options
1769
+ )
1770
+ end
1771
+
1772
+ # App detayı
1773
+ #
1774
+ # GET /v1/apps/{appId}
1775
+ def get(app_id: nil, request_options: nil)
1776
+ @client.call(
1777
+ :get, "/v1/apps/{appId}",
1778
+ path_params: {},
1779
+ app_id: app_id,
1780
+ response: "App",
1781
+ request_options: request_options
1782
+ )
1783
+ end
1784
+
1785
+ # App ayarlarını güncelle
1786
+ #
1787
+ # PATCH /v1/apps/{appId}
1788
+ def update(body, app_id: nil, request_options: nil)
1789
+ @client.call(
1790
+ :patch, "/v1/apps/{appId}",
1791
+ path_params: {},
1792
+ body: body,
1793
+ app_id: app_id,
1794
+ response: "App",
1795
+ request_options: request_options
1796
+ )
1797
+ end
1798
+ end
1799
+
1800
+ # App API anahtarları: oluşturma, kapsam/IP izin listesi güncelleme, rotasyon ve iptal.
1801
+ class ApiKeys < Pushizo::BaseResource
1802
+ # App'e bağlı API anahtarları
1803
+ #
1804
+ # GET /v1/apps/{appId}/api-keys
1805
+ def list(app_id: nil, request_options: nil)
1806
+ @client.call(
1807
+ :get, "/v1/apps/{appId}/api-keys",
1808
+ path_params: {},
1809
+ app_id: app_id,
1810
+ response: "ApiKeyList",
1811
+ request_options: request_options
1812
+ )
1813
+ end
1814
+
1815
+ # App'e bağlı API anahtarı oluştur (ham anahtar yalnızca bu yanıtta)
1816
+ #
1817
+ # POST /v1/apps/{appId}/api-keys
1818
+ def create(body, app_id: nil, request_options: nil)
1819
+ @client.call(
1820
+ :post, "/v1/apps/{appId}/api-keys",
1821
+ path_params: {},
1822
+ body: body,
1823
+ app_id: app_id,
1824
+ response: "CreatedApiKey",
1825
+ request_options: request_options
1826
+ )
1827
+ end
1828
+
1829
+ # Anahtarı güncelle (ad, kapsam, IP izin listesi, bitiş)
1830
+ #
1831
+ # PATCH /v1/apps/{appId}/api-keys/{keyId}
1832
+ def update(key_id, body, app_id: nil, request_options: nil)
1833
+ @client.call(
1834
+ :patch, "/v1/apps/{appId}/api-keys/{keyId}",
1835
+ path_params: { "keyId" => key_id },
1836
+ body: body,
1837
+ app_id: app_id,
1838
+ response: "ApiKey",
1839
+ request_options: request_options
1840
+ )
1841
+ end
1842
+
1843
+ # Anahtarı iptal et
1844
+ #
1845
+ # DELETE /v1/apps/{appId}/api-keys/{keyId}
1846
+ def revoke(key_id, app_id: nil, request_options: nil)
1847
+ @client.call(
1848
+ :delete, "/v1/apps/{appId}/api-keys/{keyId}",
1849
+ path_params: { "keyId" => key_id },
1850
+ app_id: app_id,
1851
+ response: "Ok",
1852
+ request_options: request_options
1853
+ )
1854
+ end
1855
+
1856
+ # Anahtarı döndür (eski değer anında geçersiz)
1857
+ #
1858
+ # POST /v1/apps/{appId}/api-keys/{keyId}/rotate
1859
+ def rotate(key_id, app_id: nil, request_options: nil)
1860
+ @client.call(
1861
+ :post, "/v1/apps/{appId}/api-keys/{keyId}/rotate",
1862
+ path_params: { "keyId" => key_id },
1863
+ app_id: app_id,
1864
+ response: "CreatedApiKey",
1865
+ request_options: request_options
1866
+ )
1867
+ end
1868
+ end
1869
+
1870
+ # Organizasyon, üyeler ve denetim kayıtları.
1871
+ class Organization < Pushizo::BaseResource
1872
+ # Anahtarın ait olduğu organizasyon (org geneli admin anahtarı)
1873
+ #
1874
+ # GET /v1/organization
1875
+ def get(request_options: nil)
1876
+ @client.call(
1877
+ :get, "/v1/organization",
1878
+ path_params: {},
1879
+ response: "Org",
1880
+ request_options: request_options
1881
+ )
1882
+ end
1883
+
1884
+ # Organizasyon üyeleri (org geneli admin anahtarı)
1885
+ #
1886
+ # GET /v1/organization/members
1887
+ def members(request_options: nil)
1888
+ @client.call(
1889
+ :get, "/v1/organization/members",
1890
+ path_params: {},
1891
+ response: "MemberList",
1892
+ request_options: request_options
1893
+ )
1894
+ end
1895
+
1896
+ # Audit log (org geneli admin anahtarı; action/actor/app/tarih filtreleri, cursor)
1897
+ #
1898
+ # GET /v1/organization/audit-logs
1899
+ def audit_logs(limit: nil, cursor: nil, action: nil, actor_id: nil, app_id_param: nil, from: nil, to: nil, request_options: nil)
1900
+ @client.call(
1901
+ :get, "/v1/organization/audit-logs",
1902
+ path_params: {},
1903
+ query: { "limit" => limit, "cursor" => cursor, "action" => action, "actor_id" => actor_id, "app_id" => app_id_param, "from" => from, "to" => to },
1904
+ response: "AuditPage",
1905
+ request_options: request_options
1906
+ )
1907
+ end
1908
+
1909
+ # audit_logs sonuçlarını next_cursor ile tüm sayfalar boyunca tek tek dolaşan Enumerator döndürür (sayfalar tembel yüklenir).
1910
+ def audit_logs_all(limit: nil, cursor: nil, action: nil, actor_id: nil, app_id_param: nil, from: nil, to: nil, request_options: nil)
1911
+ @client.paginate(cursor) do |cursor_value|
1912
+ audit_logs(limit: limit, action: action, actor_id: actor_id, app_id_param: app_id_param, from: from, to: to, request_options: request_options, cursor: cursor_value)
1913
+ end
1914
+ end
1915
+
1916
+ # Organizasyon kullanımı ve plan kotaları (org geneli anahtar)
1917
+ #
1918
+ # GET /v1/organization/usage
1919
+ def usage(days: nil, request_options: nil)
1920
+ @client.call(
1921
+ :get, "/v1/organization/usage",
1922
+ path_params: {},
1923
+ query: { "days" => days },
1924
+ response: "UsageReport",
1925
+ request_options: request_options
1926
+ )
1927
+ end
1928
+ end
1929
+
1930
+ # ads kaynağı.
1931
+ class Ads < Pushizo::BaseResource
1932
+ # Bağlı reklam hesapları
1933
+ #
1934
+ # GET /v1/apps/{appId}/ads/accounts
1935
+ def list_accounts(app_id: nil, request_options: nil)
1936
+ @client.call(
1937
+ :get, "/v1/apps/{appId}/ads/accounts",
1938
+ path_params: {},
1939
+ app_id: app_id,
1940
+ response: "AdAccountList",
1941
+ request_options: request_options
1942
+ )
1943
+ end
1944
+
1945
+ # Reklam kitleleri
1946
+ #
1947
+ # GET /v1/apps/{appId}/ads/audiences
1948
+ def list_audiences(ad_account_id: nil, app_id: nil, request_options: nil)
1949
+ @client.call(
1950
+ :get, "/v1/apps/{appId}/ads/audiences",
1951
+ path_params: {},
1952
+ query: { "ad_account_id" => ad_account_id },
1953
+ app_id: app_id,
1954
+ response: "AdAudienceList",
1955
+ request_options: request_options
1956
+ )
1957
+ end
1958
+
1959
+ # Reklam kitlesi oluştur
1960
+ #
1961
+ # POST /v1/apps/{appId}/ads/audiences
1962
+ def create_audience(body, app_id: nil, request_options: nil)
1963
+ @client.call(
1964
+ :post, "/v1/apps/{appId}/ads/audiences",
1965
+ path_params: {},
1966
+ body: body,
1967
+ app_id: app_id,
1968
+ response: "AdAudience",
1969
+ request_options: request_options
1970
+ )
1971
+ end
1972
+
1973
+ # Reklam kitlesi ayrıntısı
1974
+ #
1975
+ # GET /v1/apps/{appId}/ads/audiences/{audienceId}
1976
+ def get_audience(audience_id, app_id: nil, request_options: nil)
1977
+ @client.call(
1978
+ :get, "/v1/apps/{appId}/ads/audiences/{audienceId}",
1979
+ path_params: { "audienceId" => audience_id },
1980
+ app_id: app_id,
1981
+ response: "AdAudience",
1982
+ request_options: request_options
1983
+ )
1984
+ end
1985
+
1986
+ # Reklam kitlesini güncelle
1987
+ #
1988
+ # PATCH /v1/apps/{appId}/ads/audiences/{audienceId}
1989
+ def update_audience(audience_id, body, app_id: nil, request_options: nil)
1990
+ @client.call(
1991
+ :patch, "/v1/apps/{appId}/ads/audiences/{audienceId}",
1992
+ path_params: { "audienceId" => audience_id },
1993
+ body: body,
1994
+ app_id: app_id,
1995
+ response: "AdAudience",
1996
+ request_options: request_options
1997
+ )
1998
+ end
1999
+
2000
+ # Reklam kitlesini sil
2001
+ #
2002
+ # DELETE /v1/apps/{appId}/ads/audiences/{audienceId}
2003
+ #
2004
+ # @param delete_on_platform Değerler: "true", "false".
2005
+ def remove_audience(audience_id, delete_on_platform: nil, app_id: nil, request_options: nil)
2006
+ @client.call(
2007
+ :delete, "/v1/apps/{appId}/ads/audiences/{audienceId}",
2008
+ path_params: { "audienceId" => audience_id },
2009
+ query: { "delete_on_platform" => delete_on_platform },
2010
+ app_id: app_id,
2011
+ response: "AdOk",
2012
+ request_options: request_options
2013
+ )
2014
+ end
2015
+
2016
+ # Senkronu şimdi çalıştır
2017
+ #
2018
+ # POST /v1/apps/{appId}/ads/audiences/{audienceId}/sync
2019
+ def sync(audience_id, body, app_id: nil, request_options: nil)
2020
+ @client.call(
2021
+ :post, "/v1/apps/{appId}/ads/audiences/{audienceId}/sync",
2022
+ path_params: { "audienceId" => audience_id },
2023
+ body: body,
2024
+ app_id: app_id,
2025
+ response: "AdAudienceSyncQueued",
2026
+ request_options: request_options
2027
+ )
2028
+ end
2029
+
2030
+ # Senkron geçmişi
2031
+ #
2032
+ # GET /v1/apps/{appId}/ads/audiences/{audienceId}/syncs
2033
+ def syncs(audience_id, limit: nil, app_id: nil, request_options: nil)
2034
+ @client.call(
2035
+ :get, "/v1/apps/{appId}/ads/audiences/{audienceId}/syncs",
2036
+ path_params: { "audienceId" => audience_id },
2037
+ query: { "limit" => limit },
2038
+ app_id: app_id,
2039
+ response: "AdAudienceSyncList",
2040
+ request_options: request_options
2041
+ )
2042
+ end
2043
+
2044
+ # Benzer kitle (lookalike) oluştur
2045
+ #
2046
+ # POST /v1/apps/{appId}/ads/audiences/{audienceId}/lookalikes
2047
+ def lookalike(audience_id, body, app_id: nil, request_options: nil)
2048
+ @client.call(
2049
+ :post, "/v1/apps/{appId}/ads/audiences/{audienceId}/lookalikes",
2050
+ path_params: { "audienceId" => audience_id },
2051
+ body: body,
2052
+ app_id: app_id,
2053
+ response: "AdAudience",
2054
+ request_options: request_options
2055
+ )
2056
+ end
2057
+
2058
+ # Kampanya / reklam seti / reklam listesi ve metrikler
2059
+ #
2060
+ # GET /v1/apps/{appId}/ads/campaigns
2061
+ #
2062
+ # @param level Değerler: "campaign", "ad_set", "ad".
2063
+ # @param status Değerler: "active", "paused", "pending", "rejected", "archived", "deleted", "unknown".
2064
+ def list(ad_account_id: nil, level: nil, parent_id: nil, status: nil, q: nil, from: nil, to: nil, limit: nil, app_id: nil, request_options: nil)
2065
+ @client.call(
2066
+ :get, "/v1/apps/{appId}/ads/campaigns",
2067
+ path_params: {},
2068
+ query: { "ad_account_id" => ad_account_id, "level" => level, "parent_id" => parent_id, "status" => status, "q" => q, "from" => from, "to" => to, "limit" => limit },
2069
+ app_id: app_id,
2070
+ response: "AdEntityList",
2071
+ request_options: request_options
2072
+ )
2073
+ end
2074
+
2075
+ # Kampanya / reklam seti / reklam ayrıntısı
2076
+ #
2077
+ # GET /v1/apps/{appId}/ads/campaigns/{entityId}
2078
+ def get(entity_id, app_id: nil, request_options: nil)
2079
+ @client.call(
2080
+ :get, "/v1/apps/{appId}/ads/campaigns/{entityId}",
2081
+ path_params: { "entityId" => entity_id },
2082
+ app_id: app_id,
2083
+ response: "AdEntity",
2084
+ request_options: request_options
2085
+ )
2086
+ end
2087
+
2088
+ # Durum ve günlük bütçe değişikliği
2089
+ #
2090
+ # PATCH /v1/apps/{appId}/ads/campaigns/{entityId}
2091
+ def update(entity_id, body, app_id: nil, request_options: nil)
2092
+ @client.call(
2093
+ :patch, "/v1/apps/{appId}/ads/campaigns/{entityId}",
2094
+ path_params: { "entityId" => entity_id },
2095
+ body: body,
2096
+ app_id: app_id,
2097
+ response: "AdEntity",
2098
+ request_options: request_options
2099
+ )
2100
+ end
2101
+
2102
+ # Kampanyaları ve metrikleri şimdi yenile
2103
+ #
2104
+ # POST /v1/apps/{appId}/ads/accounts/{accountId}/refresh
2105
+ def refresh(account_id, app_id: nil, request_options: nil)
2106
+ @client.call(
2107
+ :post, "/v1/apps/{appId}/ads/accounts/{accountId}/refresh",
2108
+ path_params: { "accountId" => account_id },
2109
+ app_id: app_id,
2110
+ response: "AdRefreshQueued",
2111
+ request_options: request_options
2112
+ )
2113
+ end
2114
+
2115
+ # Harcama ve performans raporu
2116
+ #
2117
+ # GET /v1/apps/{appId}/ads/reports/spend
2118
+ #
2119
+ # @param group_by Değerler: "day", "platform", "account", "campaign", "ad_set".
2120
+ def spend(from:, to:, currency: nil, group_by: nil, ad_account_id: nil, campaign_id: nil, app_id: nil, request_options: nil)
2121
+ @client.call(
2122
+ :get, "/v1/apps/{appId}/ads/reports/spend",
2123
+ path_params: {},
2124
+ query: { "from" => from, "to" => to, "currency" => currency, "group_by" => group_by, "ad_account_id" => ad_account_id, "campaign_id" => campaign_id },
2125
+ app_id: app_id,
2126
+ response: "AdSpendReport",
2127
+ request_options: request_options
2128
+ )
2129
+ end
2130
+
2131
+ # Birleşik atribüsyon raporu (ROAS, CAC)
2132
+ #
2133
+ # GET /v1/apps/{appId}/ads/reports/attribution
2134
+ #
2135
+ # @param model Değerler: "last_click", "first_click", "linear", "time_decay".
2136
+ # @param group_by Değerler: "channel", "campaign", "ad_set".
2137
+ def attribution(from:, to:, model: nil, window_days: nil, half_life_days: nil, currency: nil, group_by: nil, conversion_events: nil, app_id: nil, request_options: nil)
2138
+ @client.call(
2139
+ :get, "/v1/apps/{appId}/ads/reports/attribution",
2140
+ path_params: {},
2141
+ query: { "from" => from, "to" => to, "model" => model, "window_days" => window_days, "half_life_days" => half_life_days, "currency" => currency, "group_by" => group_by, "conversion_events" => conversion_events },
2142
+ app_id: app_id,
2143
+ response: "AdAttributionReport",
2144
+ request_options: request_options
2145
+ )
2146
+ end
2147
+
2148
+ # Kohort LTV raporu
2149
+ #
2150
+ # GET /v1/apps/{appId}/ads/reports/ltv
2151
+ def ltv(months: nil, cohorts: nil, currency: nil, app_id: nil, request_options: nil)
2152
+ @client.call(
2153
+ :get, "/v1/apps/{appId}/ads/reports/ltv",
2154
+ path_params: {},
2155
+ query: { "months" => months, "cohorts" => cohorts, "currency" => currency },
2156
+ app_id: app_id,
2157
+ response: "AdLtvReport",
2158
+ request_options: request_options
2159
+ )
2160
+ end
2161
+
2162
+ # Conversions API yapılandırmaları
2163
+ #
2164
+ # GET /v1/apps/{appId}/ads/conversions-api/configs
2165
+ def capi_configs(app_id: nil, request_options: nil)
2166
+ @client.call(
2167
+ :get, "/v1/apps/{appId}/ads/conversions-api/configs",
2168
+ path_params: {},
2169
+ app_id: app_id,
2170
+ response: "AdCapiConfigList",
2171
+ request_options: request_options
2172
+ )
2173
+ end
2174
+
2175
+ # Conversions API teslim geçmişi
2176
+ #
2177
+ # GET /v1/apps/{appId}/ads/conversions-api/deliveries
2178
+ #
2179
+ # @param status Değerler: "pending", "sent", "failed", "skipped".
2180
+ def capi_deliveries(config_id: nil, status: nil, limit: nil, app_id: nil, request_options: nil)
2181
+ @client.call(
2182
+ :get, "/v1/apps/{appId}/ads/conversions-api/deliveries",
2183
+ path_params: {},
2184
+ query: { "config_id" => config_id, "status" => status, "limit" => limit },
2185
+ app_id: app_id,
2186
+ response: "AdCapiDeliveryList",
2187
+ request_options: request_options
2188
+ )
2189
+ end
2190
+
2191
+ # Bütçe uyarı kuralları
2192
+ #
2193
+ # GET /v1/apps/{appId}/ads/alert-rules
2194
+ def rules(app_id: nil, request_options: nil)
2195
+ @client.call(
2196
+ :get, "/v1/apps/{appId}/ads/alert-rules",
2197
+ path_params: {},
2198
+ app_id: app_id,
2199
+ response: "AdBudgetAlertRuleList",
2200
+ request_options: request_options
2201
+ )
2202
+ end
2203
+
2204
+ # Bütçe uyarı kuralı oluştur
2205
+ #
2206
+ # POST /v1/apps/{appId}/ads/alert-rules
2207
+ def create_rule(body, app_id: nil, request_options: nil)
2208
+ @client.call(
2209
+ :post, "/v1/apps/{appId}/ads/alert-rules",
2210
+ path_params: {},
2211
+ body: body,
2212
+ app_id: app_id,
2213
+ response: "AdBudgetAlertRule",
2214
+ request_options: request_options
2215
+ )
2216
+ end
2217
+
2218
+ # Bütçe uyarı kuralını güncelle
2219
+ #
2220
+ # PATCH /v1/apps/{appId}/ads/alert-rules/{ruleId}
2221
+ def update_rule(rule_id, body, app_id: nil, request_options: nil)
2222
+ @client.call(
2223
+ :patch, "/v1/apps/{appId}/ads/alert-rules/{ruleId}",
2224
+ path_params: { "ruleId" => rule_id },
2225
+ body: body,
2226
+ app_id: app_id,
2227
+ response: "AdBudgetAlertRule",
2228
+ request_options: request_options
2229
+ )
2230
+ end
2231
+
2232
+ # Bütçe uyarı kuralını sil
2233
+ #
2234
+ # DELETE /v1/apps/{appId}/ads/alert-rules/{ruleId}
2235
+ def remove_rule(rule_id, app_id: nil, request_options: nil)
2236
+ @client.call(
2237
+ :delete, "/v1/apps/{appId}/ads/alert-rules/{ruleId}",
2238
+ path_params: { "ruleId" => rule_id },
2239
+ app_id: app_id,
2240
+ response: "AdOk",
2241
+ request_options: request_options
2242
+ )
2243
+ end
2244
+
2245
+ # Tetiklenen bütçe uyarıları
2246
+ #
2247
+ # GET /v1/apps/{appId}/ads/alerts
2248
+ def alert_history(rule_id: nil, limit: nil, app_id: nil, request_options: nil)
2249
+ @client.call(
2250
+ :get, "/v1/apps/{appId}/ads/alerts",
2251
+ path_params: {},
2252
+ query: { "rule_id" => rule_id, "limit" => limit },
2253
+ app_id: app_id,
2254
+ response: "AdBudgetAlertList",
2255
+ request_options: request_options
2256
+ )
2257
+ end
2258
+ end
2259
+
2260
+ # cannedResponses kaynağı.
2261
+ class CannedResponses < Pushizo::BaseResource
2262
+ # Hazır yanıtlar
2263
+ #
2264
+ # GET /v1/apps/{appId}/canned-responses
2265
+ def canned(q: nil, app_id: nil, request_options: nil)
2266
+ @client.call(
2267
+ :get, "/v1/apps/{appId}/canned-responses",
2268
+ path_params: {},
2269
+ query: { "q" => q },
2270
+ app_id: app_id,
2271
+ response: "CannedResponseList",
2272
+ request_options: request_options
2273
+ )
2274
+ end
2275
+
2276
+ # Hazır yanıt oluştur
2277
+ #
2278
+ # POST /v1/apps/{appId}/canned-responses
2279
+ def create_canned(body, app_id: nil, request_options: nil)
2280
+ @client.call(
2281
+ :post, "/v1/apps/{appId}/canned-responses",
2282
+ path_params: {},
2283
+ body: body,
2284
+ app_id: app_id,
2285
+ response: "CannedResponse",
2286
+ request_options: request_options
2287
+ )
2288
+ end
2289
+
2290
+ # Hazır yanıtı güncelle
2291
+ #
2292
+ # PATCH /v1/apps/{appId}/canned-responses/{cannedId}
2293
+ def update_canned(canned_id, body, app_id: nil, request_options: nil)
2294
+ @client.call(
2295
+ :patch, "/v1/apps/{appId}/canned-responses/{cannedId}",
2296
+ path_params: { "cannedId" => canned_id },
2297
+ body: body,
2298
+ app_id: app_id,
2299
+ response: "CannedResponse",
2300
+ request_options: request_options
2301
+ )
2302
+ end
2303
+
2304
+ # Hazır yanıtı sil
2305
+ #
2306
+ # DELETE /v1/apps/{appId}/canned-responses/{cannedId}
2307
+ def delete_canned(canned_id, app_id: nil, request_options: nil)
2308
+ @client.call(
2309
+ :delete, "/v1/apps/{appId}/canned-responses/{cannedId}",
2310
+ path_params: { "cannedId" => canned_id },
2311
+ app_id: app_id,
2312
+ response: "Ok",
2313
+ request_options: request_options
2314
+ )
2315
+ end
2316
+ end
2317
+
2318
+ # categories kaynağı.
2319
+ class Categories < Pushizo::BaseResource
2320
+ # Mesaj kategorileri
2321
+ #
2322
+ # GET /v1/apps/{appId}/categories
2323
+ def list(app_id: nil, request_options: nil)
2324
+ @client.call(
2325
+ :get, "/v1/apps/{appId}/categories",
2326
+ path_params: {},
2327
+ app_id: app_id,
2328
+ response: "MessageCategoryList",
2329
+ request_options: request_options
2330
+ )
2331
+ end
2332
+
2333
+ # Kategori oluştur
2334
+ #
2335
+ # POST /v1/apps/{appId}/categories
2336
+ def create(body, app_id: nil, request_options: nil)
2337
+ @client.call(
2338
+ :post, "/v1/apps/{appId}/categories",
2339
+ path_params: {},
2340
+ body: body,
2341
+ app_id: app_id,
2342
+ response: "MessageCategory",
2343
+ request_options: request_options
2344
+ )
2345
+ end
2346
+
2347
+ # Kategori güncelle
2348
+ #
2349
+ # PATCH /v1/apps/{appId}/categories/{categoryId}
2350
+ def update(category_id, body, app_id: nil, request_options: nil)
2351
+ @client.call(
2352
+ :patch, "/v1/apps/{appId}/categories/{categoryId}",
2353
+ path_params: { "categoryId" => category_id },
2354
+ body: body,
2355
+ app_id: app_id,
2356
+ response: "MessageCategory",
2357
+ request_options: request_options
2358
+ )
2359
+ end
2360
+
2361
+ # Kategori sil
2362
+ #
2363
+ # DELETE /v1/apps/{appId}/categories/{categoryId}
2364
+ def delete(category_id, app_id: nil, request_options: nil)
2365
+ @client.call(
2366
+ :delete, "/v1/apps/{appId}/categories/{categoryId}",
2367
+ path_params: { "categoryId" => category_id },
2368
+ app_id: app_id,
2369
+ response: "Ok",
2370
+ request_options: request_options
2371
+ )
2372
+ end
2373
+ end
2374
+
2375
+ # contentTables kaynağı.
2376
+ class ContentTables < Pushizo::BaseResource
2377
+ # İçerik tabloları
2378
+ #
2379
+ # GET /v1/apps/{appId}/content-tables
2380
+ def list_tables(app_id: nil, request_options: nil)
2381
+ @client.call(
2382
+ :get, "/v1/apps/{appId}/content-tables",
2383
+ path_params: {},
2384
+ app_id: app_id,
2385
+ response: "ContentTableList",
2386
+ request_options: request_options
2387
+ )
2388
+ end
2389
+
2390
+ # CSV ile içerik tablosu oluştur
2391
+ #
2392
+ # POST /v1/apps/{appId}/content-tables
2393
+ #
2394
+ # Şablonda `{% lookup '<ad>' key: user.tags.<etiket> as satir %}{{ satir.<sütun> }}`.
2395
+ #
2396
+ # @param file UTF-8 CSV; ilk satır başlık. En fazla 100.000 satır, 20 MB.
2397
+ # @param name Liquid tablo adı (küçük harf, rakam, alt çizgi).
2398
+ # @param key_column Satır seçiminde kullanılan anahtar sütunu (değerleri benzersiz).
2399
+ def create_table_upload(file:, name:, key_column:, description: nil, app_id: nil, request_options: nil)
2400
+ @client.call(
2401
+ :post, "/v1/apps/{appId}/content-tables",
2402
+ path_params: {},
2403
+ form: { "file" => file, "name" => name, "key_column" => key_column, "description" => description },
2404
+ app_id: app_id,
2405
+ response: "ContentTable",
2406
+ request_options: request_options
2407
+ )
2408
+ end
2409
+
2410
+ # İçerik tablosu ayrıntısı
2411
+ #
2412
+ # GET /v1/apps/{appId}/content-tables/{tableId}
2413
+ def get_table(table_id, app_id: nil, request_options: nil)
2414
+ @client.call(
2415
+ :get, "/v1/apps/{appId}/content-tables/{tableId}",
2416
+ path_params: { "tableId" => table_id },
2417
+ app_id: app_id,
2418
+ response: "ContentTable",
2419
+ request_options: request_options
2420
+ )
2421
+ end
2422
+
2423
+ # İçerik tablosu açıklamasını güncelle
2424
+ #
2425
+ # PATCH /v1/apps/{appId}/content-tables/{tableId}
2426
+ def update_table(table_id, body, app_id: nil, request_options: nil)
2427
+ @client.call(
2428
+ :patch, "/v1/apps/{appId}/content-tables/{tableId}",
2429
+ path_params: { "tableId" => table_id },
2430
+ body: body,
2431
+ app_id: app_id,
2432
+ response: "ContentTable",
2433
+ request_options: request_options
2434
+ )
2435
+ end
2436
+
2437
+ # İçerik tablosunu sil
2438
+ #
2439
+ # DELETE /v1/apps/{appId}/content-tables/{tableId}
2440
+ def delete_table(table_id, app_id: nil, request_options: nil)
2441
+ @client.call(
2442
+ :delete, "/v1/apps/{appId}/content-tables/{tableId}",
2443
+ path_params: { "tableId" => table_id },
2444
+ app_id: app_id,
2445
+ response: "Ok",
2446
+ request_options: request_options
2447
+ )
2448
+ end
2449
+
2450
+ # İçerik tablosunu yeniden yükle (sürüm artar)
2451
+ #
2452
+ # PUT /v1/apps/{appId}/content-tables/{tableId}/rows
2453
+ #
2454
+ # @param file Yeni CSV (tablonun tüm satırları değiştirilir, sürüm artar).
2455
+ # @param key_column İsteğe bağlı yeni anahtar sütunu.
2456
+ def replace_table_upload(table_id, file:, key_column: nil, app_id: nil, request_options: nil)
2457
+ @client.call(
2458
+ :put, "/v1/apps/{appId}/content-tables/{tableId}/rows",
2459
+ path_params: { "tableId" => table_id },
2460
+ form: { "file" => file, "key_column" => key_column },
2461
+ app_id: app_id,
2462
+ response: "ContentTable",
2463
+ request_options: request_options
2464
+ )
2465
+ end
2466
+
2467
+ # İçerik tablosu satırları
2468
+ #
2469
+ # GET /v1/apps/{appId}/content-tables/{tableId}/rows
2470
+ def table_rows(table_id, limit: nil, offset: nil, q: nil, app_id: nil, request_options: nil)
2471
+ @client.call(
2472
+ :get, "/v1/apps/{appId}/content-tables/{tableId}/rows",
2473
+ path_params: { "tableId" => table_id },
2474
+ query: { "limit" => limit, "offset" => offset, "q" => q },
2475
+ app_id: app_id,
2476
+ response: "ContentTableRows",
2477
+ request_options: request_options
2478
+ )
2479
+ end
2480
+ end
2481
+
2482
+ # conversations kaynağı.
2483
+ class Conversations < Pushizo::BaseResource
2484
+ # Konuşmalar (SMS, WhatsApp, RCS, e-posta, canlı sohbet; son mesaja göre; kanal/durum/okunmamış/atanan/takım/kişi filtresi)
2485
+ #
2486
+ # GET /v1/apps/{appId}/conversations
2487
+ #
2488
+ # @param channel Değerler: "sms", "whatsapp", "rcs", "email", "chat".
2489
+ # @param status Değerler: "open", "pending", "resolved", "closed".
2490
+ # @param unread Değerler: "true", "false".
2491
+ def list(limit: nil, cursor: nil, channel: nil, status: nil, unread: nil, q: nil, assignee: nil, team_id: nil, app_id: nil, request_options: nil)
2492
+ @client.call(
2493
+ :get, "/v1/apps/{appId}/conversations",
2494
+ path_params: {},
2495
+ query: { "limit" => limit, "cursor" => cursor, "channel" => channel, "status" => status, "unread" => unread, "q" => q, "assignee" => assignee, "team_id" => team_id },
2496
+ app_id: app_id,
2497
+ response: "ConversationPage",
2498
+ request_options: request_options
2499
+ )
2500
+ end
2501
+
2502
+ # list sonuçlarını next_cursor ile tüm sayfalar boyunca tek tek dolaşan Enumerator döndürür (sayfalar tembel yüklenir).
2503
+ def list_all(limit: nil, cursor: nil, channel: nil, status: nil, unread: nil, q: nil, assignee: nil, team_id: nil, app_id: nil, request_options: nil)
2504
+ @client.paginate(cursor) do |cursor_value|
2505
+ list(limit: limit, channel: channel, status: status, unread: unread, q: q, assignee: assignee, team_id: team_id, app_id: app_id, request_options: request_options, cursor: cursor_value)
2506
+ end
2507
+ end
2508
+
2509
+ # Konuşma (atama, SLA, bot durumu, WhatsApp oturum penceresi ve açık rıza dahil)
2510
+ #
2511
+ # GET /v1/apps/{appId}/conversations/{conversationId}
2512
+ def get(conversation_id, app_id: nil, request_options: nil)
2513
+ @client.call(
2514
+ :get, "/v1/apps/{appId}/conversations/{conversationId}",
2515
+ path_params: { "conversationId" => conversation_id },
2516
+ app_id: app_id,
2517
+ response: "Conversation",
2518
+ request_options: request_options
2519
+ )
2520
+ end
2521
+
2522
+ # Konuşma durumu: open / pending / resolved (closed = resolved)
2523
+ #
2524
+ # PATCH /v1/apps/{appId}/conversations/{conversationId}
2525
+ def set_status(conversation_id, body, app_id: nil, request_options: nil)
2526
+ @client.call(
2527
+ :patch, "/v1/apps/{appId}/conversations/{conversationId}",
2528
+ path_params: { "conversationId" => conversation_id },
2529
+ body: body,
2530
+ app_id: app_id,
2531
+ response: "Conversation",
2532
+ request_options: request_options
2533
+ )
2534
+ end
2535
+
2536
+ # Konuşma mesajları (yeniden eskiye; `after_seq` ile eskiden yeniye; giden mesaj durumu teslimattan veya okundu işaretçisinden)
2537
+ #
2538
+ # GET /v1/apps/{appId}/conversations/{conversationId}/messages
2539
+ def messages(conversation_id, limit: nil, cursor: nil, after_seq: nil, app_id: nil, request_options: nil)
2540
+ @client.call(
2541
+ :get, "/v1/apps/{appId}/conversations/{conversationId}/messages",
2542
+ path_params: { "conversationId" => conversation_id },
2543
+ query: { "limit" => limit, "cursor" => cursor, "after_seq" => after_seq },
2544
+ app_id: app_id,
2545
+ response: "ConversationMessagePage",
2546
+ request_options: request_options
2547
+ )
2548
+ end
2549
+
2550
+ # messages sonuçlarını next_cursor ile tüm sayfalar boyunca tek tek dolaşan Enumerator döndürür (sayfalar tembel yüklenir).
2551
+ def messages_all(conversation_id, limit: nil, cursor: nil, after_seq: nil, app_id: nil, request_options: nil)
2552
+ @client.paginate(cursor) do |cursor_value|
2553
+ messages(conversation_id, limit: limit, after_seq: after_seq, app_id: app_id, request_options: request_options, cursor: cursor_value)
2554
+ end
2555
+ end
2556
+
2557
+ # Yanıt gönder (client_message_id ile tekilleşir). Sohbet: doğrudan; e-posta: yanıt adresli işlemsel e-posta; WhatsApp: açık rıza zorunlu, son gelen mesajdan 24 saat içinde metin/medya, pencere dışında yalnızca onaylı şablon (aksi 422 WHATSAPP_WINDOW_CLOSED).
2558
+ #
2559
+ # POST /v1/apps/{appId}/conversations/{conversationId}/messages
2560
+ def reply(conversation_id, body, app_id: nil, request_options: nil)
2561
+ @client.call(
2562
+ :post, "/v1/apps/{appId}/conversations/{conversationId}/messages",
2563
+ path_params: { "conversationId" => conversation_id },
2564
+ body: body,
2565
+ app_id: app_id,
2566
+ response: "ConversationReplyResult",
2567
+ request_options: request_options
2568
+ )
2569
+ end
2570
+
2571
+ # Gelen mesajları okundu işaretle (sohbette ziyaretçiye okundu bilgisi gider)
2572
+ #
2573
+ # POST /v1/apps/{appId}/conversations/{conversationId}/read
2574
+ def read(conversation_id, app_id: nil, request_options: nil)
2575
+ @client.call(
2576
+ :post, "/v1/apps/{appId}/conversations/{conversationId}/read",
2577
+ path_params: { "conversationId" => conversation_id },
2578
+ app_id: app_id,
2579
+ response: "Conversation",
2580
+ request_options: request_options
2581
+ )
2582
+ end
2583
+
2584
+ # Konuşmayı temsilciye ve/veya takıma ata (inbox.manage olmadan yalnızca kendine)
2585
+ #
2586
+ # POST /v1/apps/{appId}/conversations/{conversationId}/assign
2587
+ def assign(conversation_id, body, app_id: nil, request_options: nil)
2588
+ @client.call(
2589
+ :post, "/v1/apps/{appId}/conversations/{conversationId}/assign",
2590
+ path_params: { "conversationId" => conversation_id },
2591
+ body: body,
2592
+ app_id: app_id,
2593
+ response: "Conversation",
2594
+ request_options: request_options
2595
+ )
2596
+ end
2597
+
2598
+ # Sohbetten kişiye etiket ekle/kaldır
2599
+ #
2600
+ # POST /v1/apps/{appId}/conversations/{conversationId}/tags
2601
+ def tags(conversation_id, body, app_id: nil, request_options: nil)
2602
+ @client.call(
2603
+ :post, "/v1/apps/{appId}/conversations/{conversationId}/tags",
2604
+ path_params: { "conversationId" => conversation_id },
2605
+ body: body,
2606
+ app_id: app_id,
2607
+ response: "ConversationTagsResult",
2608
+ request_options: request_options
2609
+ )
2610
+ end
2611
+
2612
+ # Konuşma zaman çizelgesi (atama, durum, ilk yanıt, bot devri)
2613
+ #
2614
+ # GET /v1/apps/{appId}/conversations/{conversationId}/activity
2615
+ def activity(conversation_id, app_id: nil, request_options: nil)
2616
+ @client.call(
2617
+ :get, "/v1/apps/{appId}/conversations/{conversationId}/activity",
2618
+ path_params: { "conversationId" => conversation_id },
2619
+ app_id: app_id,
2620
+ response: "ConversationActivity",
2621
+ request_options: request_options
2622
+ )
2623
+ end
2624
+ end
2625
+
2626
+ # dataFeeds kaynağı.
2627
+ class DataFeeds < Pushizo::BaseResource
2628
+ # Data feed listesi
2629
+ #
2630
+ # GET /v1/apps/{appId}/data-feeds
2631
+ def list_feeds(app_id: nil, request_options: nil)
2632
+ @client.call(
2633
+ :get, "/v1/apps/{appId}/data-feeds",
2634
+ path_params: {},
2635
+ app_id: app_id,
2636
+ response: "DataFeedList",
2637
+ request_options: request_options
2638
+ )
2639
+ end
2640
+
2641
+ # Data feed oluştur
2642
+ #
2643
+ # POST /v1/apps/{appId}/data-feeds
2644
+ #
2645
+ # URL şablonu Liquid ile kişiselleştirilir (ör. `https://api.ornek.com/u/{{ user.external_id }}`); şablonda `{{ feed.<ad>.alan }}`.
2646
+ def create_feed(body, app_id: nil, request_options: nil)
2647
+ @client.call(
2648
+ :post, "/v1/apps/{appId}/data-feeds",
2649
+ path_params: {},
2650
+ body: body,
2651
+ app_id: app_id,
2652
+ response: "DataFeed",
2653
+ request_options: request_options
2654
+ )
2655
+ end
2656
+
2657
+ # Data feed ayrıntısı
2658
+ #
2659
+ # GET /v1/apps/{appId}/data-feeds/{feedId}
2660
+ def get_feed(feed_id, app_id: nil, request_options: nil)
2661
+ @client.call(
2662
+ :get, "/v1/apps/{appId}/data-feeds/{feedId}",
2663
+ path_params: { "feedId" => feed_id },
2664
+ app_id: app_id,
2665
+ response: "DataFeed",
2666
+ request_options: request_options
2667
+ )
2668
+ end
2669
+
2670
+ # Data feed güncelle
2671
+ #
2672
+ # PATCH /v1/apps/{appId}/data-feeds/{feedId}
2673
+ def update_feed(feed_id, body, app_id: nil, request_options: nil)
2674
+ @client.call(
2675
+ :patch, "/v1/apps/{appId}/data-feeds/{feedId}",
2676
+ path_params: { "feedId" => feed_id },
2677
+ body: body,
2678
+ app_id: app_id,
2679
+ response: "DataFeed",
2680
+ request_options: request_options
2681
+ )
2682
+ end
2683
+
2684
+ # Data feed sil
2685
+ #
2686
+ # DELETE /v1/apps/{appId}/data-feeds/{feedId}
2687
+ def delete_feed(feed_id, app_id: nil, request_options: nil)
2688
+ @client.call(
2689
+ :delete, "/v1/apps/{appId}/data-feeds/{feedId}",
2690
+ path_params: { "feedId" => feed_id },
2691
+ app_id: app_id,
2692
+ response: "Ok",
2693
+ request_options: request_options
2694
+ )
2695
+ end
2696
+
2697
+ # Data feed'i örnek kullanıcıyla dene
2698
+ #
2699
+ # POST /v1/apps/{appId}/data-feeds/{feedId}/test
2700
+ def test_feed(feed_id, body, app_id: nil, request_options: nil)
2701
+ @client.call(
2702
+ :post, "/v1/apps/{appId}/data-feeds/{feedId}/test",
2703
+ path_params: { "feedId" => feed_id },
2704
+ body: body,
2705
+ app_id: app_id,
2706
+ response: "DataFeedTestResult",
2707
+ request_options: request_options
2708
+ )
2709
+ end
2710
+ end
2711
+
2712
+ # emailDeliverability kaynağı.
2713
+ class EmailDeliverability < Pushizo::BaseResource
2714
+ # E-posta teslim ayarları (BCC/arşiv, gönderim öncesi adres doğrulama, üçüncü taraf doğrulayıcı)
2715
+ #
2716
+ # GET /v1/apps/{appId}/email-deliverability
2717
+ def settings(app_id: nil, request_options: nil)
2718
+ @client.call(
2719
+ :get, "/v1/apps/{appId}/email-deliverability",
2720
+ path_params: {},
2721
+ app_id: app_id,
2722
+ response: "EmailDeliverabilitySettings",
2723
+ request_options: request_options
2724
+ )
2725
+ end
2726
+
2727
+ # E-posta teslim ayarlarını güncelle (doğrulayıcı anahtarı zarf şifreli saklanır, geri okunmaz)
2728
+ #
2729
+ # PUT /v1/apps/{appId}/email-deliverability
2730
+ def update(body, app_id: nil, request_options: nil)
2731
+ @client.call(
2732
+ :put, "/v1/apps/{appId}/email-deliverability",
2733
+ path_params: {},
2734
+ body: body,
2735
+ app_id: app_id,
2736
+ response: "EmailDeliverabilitySettings",
2737
+ request_options: request_options
2738
+ )
2739
+ end
2740
+
2741
+ # Adres doğrulama testi (sözdizimi, MX, tek kullanımlık alan adı, rol hesabı, üçüncü taraf)
2742
+ #
2743
+ # POST /v1/apps/{appId}/email-deliverability/verify-address
2744
+ def verify(body, app_id: nil, request_options: nil)
2745
+ @client.call(
2746
+ :post, "/v1/apps/{appId}/email-deliverability/verify-address",
2747
+ path_params: {},
2748
+ body: body,
2749
+ app_id: app_id,
2750
+ response: "EmailAddressCheck",
2751
+ request_options: request_options
2752
+ )
2753
+ end
2754
+
2755
+ # Isındırma planları (bugünkü limit/kullanım ve ileri günlere ayrılmış gönderimler)
2756
+ #
2757
+ # GET /v1/apps/{appId}/email-deliverability/warmup-plans
2758
+ def plans(app_id: nil, request_options: nil)
2759
+ @client.call(
2760
+ :get, "/v1/apps/{appId}/email-deliverability/warmup-plans",
2761
+ path_params: {},
2762
+ app_id: app_id,
2763
+ response: "EmailWarmupPlanList",
2764
+ request_options: request_options
2765
+ )
2766
+ end
2767
+
2768
+ # Isındırma planı oluştur (günlük limit eğrisi veya başlangıç/çarpan/hedef; sağlayıcı payları)
2769
+ #
2770
+ # POST /v1/apps/{appId}/email-deliverability/warmup-plans
2771
+ def create(body, app_id: nil, request_options: nil)
2772
+ @client.call(
2773
+ :post, "/v1/apps/{appId}/email-deliverability/warmup-plans",
2774
+ path_params: {},
2775
+ body: body,
2776
+ app_id: app_id,
2777
+ response: "EmailWarmupPlan",
2778
+ request_options: request_options
2779
+ )
2780
+ end
2781
+
2782
+ # Isındırma planı
2783
+ #
2784
+ # GET /v1/apps/{appId}/email-deliverability/warmup-plans/{planId}
2785
+ def get(plan_id, app_id: nil, request_options: nil)
2786
+ @client.call(
2787
+ :get, "/v1/apps/{appId}/email-deliverability/warmup-plans/{planId}",
2788
+ path_params: { "planId" => plan_id },
2789
+ app_id: app_id,
2790
+ response: "EmailWarmupPlan",
2791
+ request_options: request_options
2792
+ )
2793
+ end
2794
+
2795
+ # Isındırma planını güncelle (duraklat/sürdür, eğri, paylar)
2796
+ #
2797
+ # PATCH /v1/apps/{appId}/email-deliverability/warmup-plans/{planId}
2798
+ def update_plan(plan_id, body, app_id: nil, request_options: nil)
2799
+ @client.call(
2800
+ :patch, "/v1/apps/{appId}/email-deliverability/warmup-plans/{planId}",
2801
+ path_params: { "planId" => plan_id },
2802
+ body: body,
2803
+ app_id: app_id,
2804
+ response: "EmailWarmupPlan",
2805
+ request_options: request_options
2806
+ )
2807
+ end
2808
+
2809
+ # Isındırma planını sil
2810
+ #
2811
+ # DELETE /v1/apps/{appId}/email-deliverability/warmup-plans/{planId}
2812
+ def delete(plan_id, app_id: nil, request_options: nil)
2813
+ @client.call(
2814
+ :delete, "/v1/apps/{appId}/email-deliverability/warmup-plans/{planId}",
2815
+ path_params: { "planId" => plan_id },
2816
+ app_id: app_id,
2817
+ response: "Ok",
2818
+ request_options: request_options
2819
+ )
2820
+ end
2821
+
2822
+ # Isındırma planı gün × sağlayıcı kullanımı
2823
+ #
2824
+ # GET /v1/apps/{appId}/email-deliverability/warmup-plans/{planId}/usage
2825
+ def usage(plan_id, days: nil, app_id: nil, request_options: nil)
2826
+ @client.call(
2827
+ :get, "/v1/apps/{appId}/email-deliverability/warmup-plans/{planId}/usage",
2828
+ path_params: { "planId" => plan_id },
2829
+ query: { "days" => days },
2830
+ app_id: app_id,
2831
+ response: "EmailWarmupUsage",
2832
+ request_options: request_options
2833
+ )
2834
+ end
2835
+ end
2836
+
2837
+ # forms kaynağı.
2838
+ class Forms < Pushizo::BaseResource
2839
+ # Formlar
2840
+ #
2841
+ # GET /v1/apps/{appId}/forms
2842
+ #
2843
+ # @param status Değerler: "active", "archived".
2844
+ def list(limit: nil, cursor: nil, status: nil, app_id: nil, request_options: nil)
2845
+ @client.call(
2846
+ :get, "/v1/apps/{appId}/forms",
2847
+ path_params: {},
2848
+ query: { "limit" => limit, "cursor" => cursor, "status" => status },
2849
+ app_id: app_id,
2850
+ response: "FormPage",
2851
+ request_options: request_options
2852
+ )
2853
+ end
2854
+
2855
+ # list sonuçlarını next_cursor ile tüm sayfalar boyunca tek tek dolaşan Enumerator döndürür (sayfalar tembel yüklenir).
2856
+ def list_all(limit: nil, cursor: nil, status: nil, app_id: nil, request_options: nil)
2857
+ @client.paginate(cursor) do |cursor_value|
2858
+ list(limit: limit, status: status, app_id: app_id, request_options: request_options, cursor: cursor_value)
2859
+ end
2860
+ end
2861
+
2862
+ # Form oluştur
2863
+ #
2864
+ # POST /v1/apps/{appId}/forms
2865
+ def create(body, app_id: nil, request_options: nil)
2866
+ @client.call(
2867
+ :post, "/v1/apps/{appId}/forms",
2868
+ path_params: {},
2869
+ body: body,
2870
+ app_id: app_id,
2871
+ response: "Form",
2872
+ request_options: request_options
2873
+ )
2874
+ end
2875
+
2876
+ # Form detayı
2877
+ #
2878
+ # GET /v1/apps/{appId}/forms/{formId}
2879
+ def get(form_id, app_id: nil, request_options: nil)
2880
+ @client.call(
2881
+ :get, "/v1/apps/{appId}/forms/{formId}",
2882
+ path_params: { "formId" => form_id },
2883
+ app_id: app_id,
2884
+ response: "Form",
2885
+ request_options: request_options
2886
+ )
2887
+ end
2888
+
2889
+ # Form gönderimleri
2890
+ #
2891
+ # GET /v1/apps/{appId}/forms/{formId}/submissions
2892
+ #
2893
+ # @param status Değerler: "accepted", "pending_confirmation", "confirmed".
2894
+ def submissions(form_id, limit: nil, cursor: nil, status: nil, since: nil, app_id: nil, request_options: nil)
2895
+ @client.call(
2896
+ :get, "/v1/apps/{appId}/forms/{formId}/submissions",
2897
+ path_params: { "formId" => form_id },
2898
+ query: { "limit" => limit, "cursor" => cursor, "status" => status, "since" => since },
2899
+ app_id: app_id,
2900
+ response: "FormSubmissionPage",
2901
+ request_options: request_options
2902
+ )
2903
+ end
2904
+
2905
+ # submissions sonuçlarını next_cursor ile tüm sayfalar boyunca tek tek dolaşan Enumerator döndürür (sayfalar tembel yüklenir).
2906
+ def submissions_all(form_id, limit: nil, cursor: nil, status: nil, since: nil, app_id: nil, request_options: nil)
2907
+ @client.paginate(cursor) do |cursor_value|
2908
+ submissions(form_id, limit: limit, status: status, since: since, app_id: app_id, request_options: request_options, cursor: cursor_value)
2909
+ end
2910
+ end
2911
+
2912
+ # Sunucu tarafı form gönderimi (`external_id` verilirse o kullanıcının profili güncellenir)
2913
+ #
2914
+ # POST /v1/apps/{appId}/forms/{formId}/submissions
2915
+ def submit(form_id, body, app_id: nil, request_options: nil)
2916
+ @client.call(
2917
+ :post, "/v1/apps/{appId}/forms/{formId}/submissions",
2918
+ path_params: { "formId" => form_id },
2919
+ body: body,
2920
+ app_id: app_id,
2921
+ response: "FormSubmitResult",
2922
+ request_options: request_options
2923
+ )
2924
+ end
2925
+ end
2926
+
2927
+ # identityKeys kaynağı.
2928
+ class IdentityKeys < Pushizo::BaseResource
2929
+ # SDK kimlik doğrulama (JWT) genel anahtarları
2930
+ #
2931
+ # GET /v1/apps/{appId}/identity-keys
2932
+ def list(app_id: nil, request_options: nil)
2933
+ @client.call(
2934
+ :get, "/v1/apps/{appId}/identity-keys",
2935
+ path_params: {},
2936
+ app_id: app_id,
2937
+ response: "IdentityKeyList",
2938
+ request_options: request_options
2939
+ )
2940
+ end
2941
+
2942
+ # Genel anahtar ekle (ES256)
2943
+ #
2944
+ # POST /v1/apps/{appId}/identity-keys
2945
+ #
2946
+ # SDK JWT identity verification için ES256 (EC P-256) genel anahtarı ekler; özel anahtar gönderilmez. Belirteç sunucunuzda imzalanır (`sub` = external_id, `aud` = app_id, `exp` ≤ 24 saat) ve SDK isteklerinde `Authorization: Bearer <jwt>` başlığıyla taşınır. Kip app ayarında `identity_verification_mode` ile seçilir.
2947
+ def create(body, app_id: nil, request_options: nil)
2948
+ @client.call(
2949
+ :post, "/v1/apps/{appId}/identity-keys",
2950
+ path_params: {},
2951
+ body: body,
2952
+ app_id: app_id,
2953
+ response: "IdentityKey",
2954
+ request_options: request_options
2955
+ )
2956
+ end
2957
+
2958
+ # Genel anahtarı iptal et
2959
+ #
2960
+ # DELETE /v1/apps/{appId}/identity-keys/{keyId}
2961
+ def revoke(key_id, app_id: nil, request_options: nil)
2962
+ @client.call(
2963
+ :delete, "/v1/apps/{appId}/identity-keys/{keyId}",
2964
+ path_params: { "keyId" => key_id },
2965
+ app_id: app_id,
2966
+ response: "IdentityKey",
2967
+ request_options: request_options
2968
+ )
2969
+ end
2970
+ end
2971
+
2972
+ # integrations kaynağı.
2973
+ class Integrations < Pushizo::BaseResource
2974
+ # Zapier bağlantı testi: anahtarın app’i ve kapsamları
2975
+ #
2976
+ # GET /v1/apps/{appId}/integrations/zapier/me
2977
+ def me(app_id: nil, request_options: nil)
2978
+ @client.call(
2979
+ :get, "/v1/apps/{appId}/integrations/zapier/me",
2980
+ path_params: {},
2981
+ app_id: app_id,
2982
+ response: "ZapierMe",
2983
+ request_options: request_options
2984
+ )
2985
+ end
2986
+
2987
+ # REST Hook aboneliği (Zap açıldı)
2988
+ #
2989
+ # POST /v1/apps/{appId}/integrations/zapier/hooks
2990
+ def subscribe(body, app_id: nil, request_options: nil)
2991
+ @client.call(
2992
+ :post, "/v1/apps/{appId}/integrations/zapier/hooks",
2993
+ path_params: {},
2994
+ body: body,
2995
+ app_id: app_id,
2996
+ response: "ZapierHook",
2997
+ request_options: request_options
2998
+ )
2999
+ end
3000
+
3001
+ # REST Hook aboneliğini sil (Zap kapatıldı)
3002
+ #
3003
+ # DELETE /v1/apps/{appId}/integrations/zapier/hooks/{hookId}
3004
+ def unsubscribe(hook_id, app_id: nil, request_options: nil)
3005
+ @client.call(
3006
+ :delete, "/v1/apps/{appId}/integrations/zapier/hooks/{hookId}",
3007
+ path_params: { "hookId" => hook_id },
3008
+ app_id: app_id,
3009
+ response: "IntegrationOk",
3010
+ request_options: request_options
3011
+ )
3012
+ end
3013
+
3014
+ # Tetik örnekleri (performList): son kayıtlar, abonelik gövdesiyle aynı biçim
3015
+ #
3016
+ # GET /v1/apps/{appId}/integrations/zapier/samples
3017
+ #
3018
+ # @param event Değerler: "subscription.created", "subscription.unsubscribed", "event.received", "delivery.delivered", "delivery.opened", "delivery.clicked", "user.created", "user.updated", "conversion.created", "campaign.completed".
3019
+ def samples(event:, event_name: nil, app_id: nil, request_options: nil)
3020
+ @client.call(
3021
+ :get, "/v1/apps/{appId}/integrations/zapier/samples",
3022
+ path_params: {},
3023
+ query: { "event" => event, "event_name" => event_name },
3024
+ app_id: app_id,
3025
+ response: [:array, "ZapierSamplesItem"],
3026
+ request_options: request_options
3027
+ )
3028
+ end
3029
+ end
3030
+
3031
+ # journeys kaynağı.
3032
+ class Journeys < Pushizo::BaseResource
3033
+ # Journey listesi
3034
+ #
3035
+ # GET /v1/apps/{appId}/journeys
3036
+ #
3037
+ # @param status Değerler: "draft", "active", "paused", "archived".
3038
+ def list(limit: nil, cursor: nil, status: nil, q: nil, app_id: nil, request_options: nil)
3039
+ @client.call(
3040
+ :get, "/v1/apps/{appId}/journeys",
3041
+ path_params: {},
3042
+ query: { "limit" => limit, "cursor" => cursor, "status" => status, "q" => q },
3043
+ app_id: app_id,
3044
+ response: "JourneyPage",
3045
+ request_options: request_options
3046
+ )
3047
+ end
3048
+
3049
+ # list sonuçlarını next_cursor ile tüm sayfalar boyunca tek tek dolaşan Enumerator döndürür (sayfalar tembel yüklenir).
3050
+ def list_all(limit: nil, cursor: nil, status: nil, q: nil, app_id: nil, request_options: nil)
3051
+ @client.paginate(cursor) do |cursor_value|
3052
+ list(limit: limit, status: status, q: q, app_id: app_id, request_options: request_options, cursor: cursor_value)
3053
+ end
3054
+ end
3055
+
3056
+ # Journey oluştur (taslak)
3057
+ #
3058
+ # POST /v1/apps/{appId}/journeys
3059
+ def create(body, app_id: nil, request_options: nil)
3060
+ @client.call(
3061
+ :post, "/v1/apps/{appId}/journeys",
3062
+ path_params: {},
3063
+ body: body,
3064
+ app_id: app_id,
3065
+ response: "JourneyDetail",
3066
+ request_options: request_options
3067
+ )
3068
+ end
3069
+
3070
+ # Journey detayı
3071
+ #
3072
+ # GET /v1/apps/{appId}/journeys/{journeyId}
3073
+ def get(journey_id, app_id: nil, request_options: nil)
3074
+ @client.call(
3075
+ :get, "/v1/apps/{appId}/journeys/{journeyId}",
3076
+ path_params: { "journeyId" => journey_id },
3077
+ app_id: app_id,
3078
+ response: "JourneyDetail",
3079
+ request_options: request_options
3080
+ )
3081
+ end
3082
+
3083
+ # Ad / açıklama
3084
+ #
3085
+ # PATCH /v1/apps/{appId}/journeys/{journeyId}
3086
+ def update(journey_id, body, app_id: nil, request_options: nil)
3087
+ @client.call(
3088
+ :patch, "/v1/apps/{appId}/journeys/{journeyId}",
3089
+ path_params: { "journeyId" => journey_id },
3090
+ body: body,
3091
+ app_id: app_id,
3092
+ response: "JourneyDetail",
3093
+ request_options: request_options
3094
+ )
3095
+ end
3096
+
3097
+ # Hiç yayınlanmamış journey'i sil
3098
+ #
3099
+ # DELETE /v1/apps/{appId}/journeys/{journeyId}
3100
+ def delete(journey_id, app_id: nil, request_options: nil)
3101
+ @client.call(
3102
+ :delete, "/v1/apps/{appId}/journeys/{journeyId}",
3103
+ path_params: { "journeyId" => journey_id },
3104
+ app_id: app_id,
3105
+ response: "Ok",
3106
+ request_options: request_options
3107
+ )
3108
+ end
3109
+
3110
+ # Taslağı kaydet
3111
+ #
3112
+ # PUT /v1/apps/{appId}/journeys/{journeyId}/draft
3113
+ def save_draft(journey_id, body, app_id: nil, request_options: nil)
3114
+ @client.call(
3115
+ :put, "/v1/apps/{appId}/journeys/{journeyId}/draft",
3116
+ path_params: { "journeyId" => journey_id },
3117
+ body: body,
3118
+ app_id: app_id,
3119
+ response: "JourneyDetail",
3120
+ request_options: request_options
3121
+ )
3122
+ end
3123
+
3124
+ # Taslaktaki düğümü güncelle
3125
+ #
3126
+ # PATCH /v1/apps/{appId}/journeys/{journeyId}/nodes/{nodeId}
3127
+ def update_node(journey_id, node_id, body, app_id: nil, request_options: nil)
3128
+ @client.call(
3129
+ :patch, "/v1/apps/{appId}/journeys/{journeyId}/nodes/{nodeId}",
3130
+ path_params: { "journeyId" => journey_id, "nodeId" => node_id },
3131
+ body: body,
3132
+ app_id: app_id,
3133
+ response: "JourneyDetail",
3134
+ request_options: request_options
3135
+ )
3136
+ end
3137
+
3138
+ # Sürümler
3139
+ #
3140
+ # GET /v1/apps/{appId}/journeys/{journeyId}/versions
3141
+ def versions(journey_id, app_id: nil, request_options: nil)
3142
+ @client.call(
3143
+ :get, "/v1/apps/{appId}/journeys/{journeyId}/versions",
3144
+ path_params: { "journeyId" => journey_id },
3145
+ app_id: app_id,
3146
+ response: "JourneyVersionList",
3147
+ request_options: request_options
3148
+ )
3149
+ end
3150
+
3151
+ # Yayınla
3152
+ #
3153
+ # POST /v1/apps/{appId}/journeys/{journeyId}/publish
3154
+ def publish(journey_id, app_id: nil, request_options: nil)
3155
+ @client.call(
3156
+ :post, "/v1/apps/{appId}/journeys/{journeyId}/publish",
3157
+ path_params: { "journeyId" => journey_id },
3158
+ app_id: app_id,
3159
+ response: "JourneyPublishResult",
3160
+ request_options: request_options
3161
+ )
3162
+ end
3163
+
3164
+ # Duraklat
3165
+ #
3166
+ # POST /v1/apps/{appId}/journeys/{journeyId}/pause
3167
+ def pause(journey_id, app_id: nil, request_options: nil)
3168
+ @client.call(
3169
+ :post, "/v1/apps/{appId}/journeys/{journeyId}/pause",
3170
+ path_params: { "journeyId" => journey_id },
3171
+ app_id: app_id,
3172
+ response: "JourneyDetail",
3173
+ request_options: request_options
3174
+ )
3175
+ end
3176
+
3177
+ # Devam ettir
3178
+ #
3179
+ # POST /v1/apps/{appId}/journeys/{journeyId}/resume
3180
+ def resume(journey_id, app_id: nil, request_options: nil)
3181
+ @client.call(
3182
+ :post, "/v1/apps/{appId}/journeys/{journeyId}/resume",
3183
+ path_params: { "journeyId" => journey_id },
3184
+ app_id: app_id,
3185
+ response: "JourneyDetail",
3186
+ request_options: request_options
3187
+ )
3188
+ end
3189
+
3190
+ # Arşivle
3191
+ #
3192
+ # POST /v1/apps/{appId}/journeys/{journeyId}/archive
3193
+ def archive(journey_id, app_id: nil, request_options: nil)
3194
+ @client.call(
3195
+ :post, "/v1/apps/{appId}/journeys/{journeyId}/archive",
3196
+ path_params: { "journeyId" => journey_id },
3197
+ app_id: app_id,
3198
+ response: "JourneyDetail",
3199
+ request_options: request_options
3200
+ )
3201
+ end
3202
+
3203
+ # Kopyala
3204
+ #
3205
+ # POST /v1/apps/{appId}/journeys/{journeyId}/duplicate
3206
+ def duplicate(journey_id, app_id: nil, request_options: nil)
3207
+ @client.call(
3208
+ :post, "/v1/apps/{appId}/journeys/{journeyId}/duplicate",
3209
+ path_params: { "journeyId" => journey_id },
3210
+ app_id: app_id,
3211
+ response: "JourneyDetail",
3212
+ request_options: request_options
3213
+ )
3214
+ end
3215
+
3216
+ # Düğüm bazlı istatistik
3217
+ #
3218
+ # GET /v1/apps/{appId}/journeys/{journeyId}/stats
3219
+ #
3220
+ # @param all_versions Değerler: "true", "false".
3221
+ def stats(journey_id, version: nil, all_versions: nil, app_id: nil, request_options: nil)
3222
+ @client.call(
3223
+ :get, "/v1/apps/{appId}/journeys/{journeyId}/stats",
3224
+ path_params: { "journeyId" => journey_id },
3225
+ query: { "version" => version, "all_versions" => all_versions },
3226
+ app_id: app_id,
3227
+ response: "JourneyStats",
3228
+ request_options: request_options
3229
+ )
3230
+ end
3231
+
3232
+ # Run listesi
3233
+ #
3234
+ # GET /v1/apps/{appId}/journeys/{journeyId}/runs
3235
+ #
3236
+ # @param status Değerler: "active", "waiting", "completed", "exited", "failed".
3237
+ def runs(journey_id, limit: nil, cursor: nil, status: nil, user_id: nil, version: nil, app_id: nil, request_options: nil)
3238
+ @client.call(
3239
+ :get, "/v1/apps/{appId}/journeys/{journeyId}/runs",
3240
+ path_params: { "journeyId" => journey_id },
3241
+ query: { "limit" => limit, "cursor" => cursor, "status" => status, "user_id" => user_id, "version" => version },
3242
+ app_id: app_id,
3243
+ response: "JourneyRunPage",
3244
+ request_options: request_options
3245
+ )
3246
+ end
3247
+
3248
+ # runs sonuçlarını next_cursor ile tüm sayfalar boyunca tek tek dolaşan Enumerator döndürür (sayfalar tembel yüklenir).
3249
+ def runs_all(journey_id, limit: nil, cursor: nil, status: nil, user_id: nil, version: nil, app_id: nil, request_options: nil)
3250
+ @client.paginate(cursor) do |cursor_value|
3251
+ runs(journey_id, limit: limit, status: status, user_id: user_id, version: version, app_id: app_id, request_options: request_options, cursor: cursor_value)
3252
+ end
3253
+ end
3254
+
3255
+ # Kullanıcıyı journey'e sok (external_id, user_id veya alias; context Liquid custom_data)
3256
+ #
3257
+ # POST /v1/apps/{appId}/journeys/{journeyId}/runs
3258
+ def trigger(journey_id, body, app_id: nil, request_options: nil)
3259
+ @client.call(
3260
+ :post, "/v1/apps/{appId}/journeys/{journeyId}/runs",
3261
+ path_params: { "journeyId" => journey_id },
3262
+ body: body,
3263
+ app_id: app_id,
3264
+ response: "JourneyTriggerResult",
3265
+ request_options: request_options
3266
+ )
3267
+ end
3268
+
3269
+ # Run detayı ve adımlar
3270
+ #
3271
+ # GET /v1/apps/{appId}/journeys/{journeyId}/runs/{runId}
3272
+ def run(journey_id, run_id, app_id: nil, request_options: nil)
3273
+ @client.call(
3274
+ :get, "/v1/apps/{appId}/journeys/{journeyId}/runs/{runId}",
3275
+ path_params: { "journeyId" => journey_id, "runId" => run_id },
3276
+ app_id: app_id,
3277
+ response: "JourneyRunDetail",
3278
+ request_options: request_options
3279
+ )
3280
+ end
3281
+
3282
+ # Run'ı sonlandır
3283
+ #
3284
+ # DELETE /v1/apps/{appId}/journeys/{journeyId}/runs/{runId}
3285
+ def exit_run(journey_id, run_id, app_id: nil, request_options: nil)
3286
+ @client.call(
3287
+ :delete, "/v1/apps/{appId}/journeys/{journeyId}/runs/{runId}",
3288
+ path_params: { "journeyId" => journey_id, "runId" => run_id },
3289
+ app_id: app_id,
3290
+ response: "JourneyRunDetail",
3291
+ request_options: request_options
3292
+ )
3293
+ end
3294
+
3295
+ # Kullanıcının journey run'ları
3296
+ #
3297
+ # GET /v1/apps/{appId}/users/by/{label}/{value}/journeys
3298
+ def list_for_user(label, value, app_id: nil, request_options: nil)
3299
+ @client.call(
3300
+ :get, "/v1/apps/{appId}/users/by/{label}/{value}/journeys",
3301
+ path_params: { "label" => label, "value" => value },
3302
+ app_id: app_id,
3303
+ response: "UserJourneyRuns",
3304
+ request_options: request_options
3305
+ )
3306
+ end
3307
+ end
3308
+
3309
+ # landingPages kaynağı.
3310
+ class LandingPages < Pushizo::BaseResource
3311
+ # Landing sayfaları
3312
+ #
3313
+ # GET /v1/apps/{appId}/landing-pages
3314
+ #
3315
+ # @param status Değerler: "draft", "published", "archived".
3316
+ def list(limit: nil, cursor: nil, status: nil, app_id: nil, request_options: nil)
3317
+ @client.call(
3318
+ :get, "/v1/apps/{appId}/landing-pages",
3319
+ path_params: {},
3320
+ query: { "limit" => limit, "cursor" => cursor, "status" => status },
3321
+ app_id: app_id,
3322
+ response: "LandingPageList",
3323
+ request_options: request_options
3324
+ )
3325
+ end
3326
+
3327
+ # list sonuçlarını next_cursor ile tüm sayfalar boyunca tek tek dolaşan Enumerator döndürür (sayfalar tembel yüklenir).
3328
+ def list_all(limit: nil, cursor: nil, status: nil, app_id: nil, request_options: nil)
3329
+ @client.paginate(cursor) do |cursor_value|
3330
+ list(limit: limit, status: status, app_id: app_id, request_options: request_options, cursor: cursor_value)
3331
+ end
3332
+ end
3333
+
3334
+ # Landing sayfası detayı
3335
+ #
3336
+ # GET /v1/apps/{appId}/landing-pages/{pageId}
3337
+ def get(page_id, app_id: nil, request_options: nil)
3338
+ @client.call(
3339
+ :get, "/v1/apps/{appId}/landing-pages/{pageId}",
3340
+ path_params: { "pageId" => page_id },
3341
+ app_id: app_id,
3342
+ response: "LandingPage",
3343
+ request_options: request_options
3344
+ )
3345
+ end
3346
+
3347
+ # Taslağı yayınla
3348
+ #
3349
+ # POST /v1/apps/{appId}/landing-pages/{pageId}/publish
3350
+ def publish(page_id, app_id: nil, request_options: nil)
3351
+ @client.call(
3352
+ :post, "/v1/apps/{appId}/landing-pages/{pageId}/publish",
3353
+ path_params: { "pageId" => page_id },
3354
+ app_id: app_id,
3355
+ response: "LandingPage",
3356
+ request_options: request_options
3357
+ )
3358
+ end
3359
+
3360
+ # Yayından kaldır
3361
+ #
3362
+ # POST /v1/apps/{appId}/landing-pages/{pageId}/unpublish
3363
+ def unpublish(page_id, app_id: nil, request_options: nil)
3364
+ @client.call(
3365
+ :post, "/v1/apps/{appId}/landing-pages/{pageId}/unpublish",
3366
+ path_params: { "pageId" => page_id },
3367
+ app_id: app_id,
3368
+ response: "LandingPage",
3369
+ request_options: request_options
3370
+ )
3371
+ end
3372
+ end
3373
+
3374
+ # liveActivities kaynağı.
3375
+ class LiveActivities < Pushizo::BaseResource
3376
+ # Live Activity türleri
3377
+ #
3378
+ # GET /v1/apps/{appId}/live-activities/types
3379
+ def list_types(app_id: nil, request_options: nil)
3380
+ @client.call(
3381
+ :get, "/v1/apps/{appId}/live-activities/types",
3382
+ path_params: {},
3383
+ app_id: app_id,
3384
+ response: "LiveActivityTypeList",
3385
+ request_options: request_options
3386
+ )
3387
+ end
3388
+
3389
+ # Live Activity türü oluştur
3390
+ #
3391
+ # POST /v1/apps/{appId}/live-activities/types
3392
+ def create_type(body, app_id: nil, request_options: nil)
3393
+ @client.call(
3394
+ :post, "/v1/apps/{appId}/live-activities/types",
3395
+ path_params: {},
3396
+ body: body,
3397
+ app_id: app_id,
3398
+ response: "LiveActivityType",
3399
+ request_options: request_options
3400
+ )
3401
+ end
3402
+
3403
+ # Live Activity türünü güncelle
3404
+ #
3405
+ # PATCH /v1/apps/{appId}/live-activities/types/{activityType}
3406
+ def update_type(activity_type, body, app_id: nil, request_options: nil)
3407
+ @client.call(
3408
+ :patch, "/v1/apps/{appId}/live-activities/types/{activityType}",
3409
+ path_params: { "activityType" => activity_type },
3410
+ body: body,
3411
+ app_id: app_id,
3412
+ response: "LiveActivityType",
3413
+ request_options: request_options
3414
+ )
3415
+ end
3416
+
3417
+ # Live Activity türünü sil
3418
+ #
3419
+ # DELETE /v1/apps/{appId}/live-activities/types/{activityType}
3420
+ def delete_type(activity_type, app_id: nil, request_options: nil)
3421
+ @client.call(
3422
+ :delete, "/v1/apps/{appId}/live-activities/types/{activityType}",
3423
+ path_params: { "activityType" => activity_type },
3424
+ app_id: app_id,
3425
+ response: "LiveActivityTokenResult",
3426
+ request_options: request_options
3427
+ )
3428
+ end
3429
+
3430
+ # Live Activity başlat (push-to-start)
3431
+ #
3432
+ # POST /v1/apps/{appId}/live-activities/{activityType}/start
3433
+ #
3434
+ # Hedefteki iOS aboneliklerinin push-to-start belirteçleriyle etkinliği uzaktan başlatır (iOS 17.2+). `attributes` ve `content_state` türün şemasına uymalıdır. Dönen `activity_id` ile sonraki update/end yapılır.
3435
+ def start(activity_type, body, app_id: nil, request_options: nil)
3436
+ @client.call(
3437
+ :post, "/v1/apps/{appId}/live-activities/{activityType}/start",
3438
+ path_params: { "activityType" => activity_type },
3439
+ body: body,
3440
+ app_id: app_id,
3441
+ response: "LiveActivitySendResult",
3442
+ request_options: request_options
3443
+ )
3444
+ end
3445
+
3446
+ # Live Activity güncelle
3447
+ #
3448
+ # POST /v1/apps/{appId}/live-activities/{activityType}/update
3449
+ #
3450
+ # Etkinliğin cihazlardan bildirilen güncelleme belirteçlerine yeni içerik durumu gönderir. Sessiz saat ve frekans sınırı uygulanmaz; priority 5 Apple bütçesini korur.
3451
+ def update(activity_type, body, app_id: nil, request_options: nil)
3452
+ @client.call(
3453
+ :post, "/v1/apps/{appId}/live-activities/{activityType}/update",
3454
+ path_params: { "activityType" => activity_type },
3455
+ body: body,
3456
+ app_id: app_id,
3457
+ response: "LiveActivitySendResult",
3458
+ request_options: request_options
3459
+ )
3460
+ end
3461
+
3462
+ # Live Activity bitir
3463
+ #
3464
+ # POST /v1/apps/{appId}/live-activities/{activityType}/end
3465
+ def end_(activity_type, body, app_id: nil, request_options: nil)
3466
+ @client.call(
3467
+ :post, "/v1/apps/{appId}/live-activities/{activityType}/end",
3468
+ path_params: { "activityType" => activity_type },
3469
+ body: body,
3470
+ app_id: app_id,
3471
+ response: "LiveActivitySendResult",
3472
+ request_options: request_options
3473
+ )
3474
+ end
3475
+ end
3476
+
3477
+ # mcp kaynağı.
3478
+ class Mcp < Pushizo::BaseResource
3479
+ # Kampanya taslağı oluştur (MCP onaylı mod; gönderim yapmaz)
3480
+ #
3481
+ # POST /v1/apps/{appId}/mcp/campaign-drafts
3482
+ def create_campaign_draft(body, app_id: nil, request_options: nil)
3483
+ @client.call(
3484
+ :post, "/v1/apps/{appId}/mcp/campaign-drafts",
3485
+ path_params: {},
3486
+ body: body,
3487
+ app_id: app_id,
3488
+ response: "Campaign",
3489
+ request_options: request_options
3490
+ )
3491
+ end
3492
+
3493
+ # Segment taslağı oluştur (MCP onaylı mod; dinamik segment)
3494
+ #
3495
+ # POST /v1/apps/{appId}/mcp/segment-drafts
3496
+ def create_segment_draft(body, app_id: nil, request_options: nil)
3497
+ @client.call(
3498
+ :post, "/v1/apps/{appId}/mcp/segment-drafts",
3499
+ path_params: {},
3500
+ body: body,
3501
+ app_id: app_id,
3502
+ response: "Segment",
3503
+ request_options: request_options
3504
+ )
3505
+ end
3506
+
3507
+ # Şablon oluştur (MCP onaylı mod; şablon tek başına gönderim yapmaz)
3508
+ #
3509
+ # POST /v1/apps/{appId}/mcp/template-drafts
3510
+ def create_template_draft(body, app_id: nil, request_options: nil)
3511
+ @client.call(
3512
+ :post, "/v1/apps/{appId}/mcp/template-drafts",
3513
+ path_params: {},
3514
+ body: body,
3515
+ app_id: app_id,
3516
+ response: "Template",
3517
+ request_options: request_options
3518
+ )
3519
+ end
3520
+
3521
+ # Journey taslağı oluştur (MCP onaylı mod; yayımlanmaz)
3522
+ #
3523
+ # POST /v1/apps/{appId}/mcp/journey-drafts
3524
+ def create_journey_draft(body, app_id: nil, request_options: nil)
3525
+ @client.call(
3526
+ :post, "/v1/apps/{appId}/mcp/journey-drafts",
3527
+ path_params: {},
3528
+ body: body,
3529
+ app_id: app_id,
3530
+ response: "JourneyDetail",
3531
+ request_options: request_options
3532
+ )
3533
+ end
3534
+
3535
+ # In-app mesaj taslağı oluştur (MCP onaylı mod; etkinleştirilmez)
3536
+ #
3537
+ # POST /v1/apps/{appId}/mcp/in-app-drafts
3538
+ def create_in_app_draft(body, app_id: nil, request_options: nil)
3539
+ @client.call(
3540
+ :post, "/v1/apps/{appId}/mcp/in-app-drafts",
3541
+ path_params: {},
3542
+ body: body,
3543
+ app_id: app_id,
3544
+ response: "InAppMessage",
3545
+ request_options: request_options
3546
+ )
3547
+ end
3548
+
3549
+ # Test gönderimi (yalnızca app’in test cihazlarına; MCP onaylı mod)
3550
+ #
3551
+ # POST /v1/apps/{appId}/mcp/test-sends
3552
+ def test_send(body, app_id: nil, request_options: nil)
3553
+ @client.call(
3554
+ :post, "/v1/apps/{appId}/mcp/test-sends",
3555
+ path_params: {},
3556
+ body: body,
3557
+ app_id: app_id,
3558
+ response: "CreateNotificationResult",
3559
+ request_options: request_options
3560
+ )
3561
+ end
3562
+ end
3563
+
3564
+ # preferences kaynağı.
3565
+ class Preferences < Pushizo::BaseResource
3566
+ # Kullanıcının tercihleri (alias ile)
3567
+ #
3568
+ # GET /v1/apps/{appId}/users/by/{label}/{value}/preferences
3569
+ def get(label, value, app_id: nil, request_options: nil)
3570
+ @client.call(
3571
+ :get, "/v1/apps/{appId}/users/by/{label}/{value}/preferences",
3572
+ path_params: { "label" => label, "value" => value },
3573
+ app_id: app_id,
3574
+ response: "UserPreferences",
3575
+ request_options: request_options
3576
+ )
3577
+ end
3578
+
3579
+ # Kullanıcı tercihlerini yaz (alias ile)
3580
+ #
3581
+ # PUT /v1/apps/{appId}/users/by/{label}/{value}/preferences
3582
+ def set(label, value, body, app_id: nil, request_options: nil)
3583
+ @client.call(
3584
+ :put, "/v1/apps/{appId}/users/by/{label}/{value}/preferences",
3585
+ path_params: { "label" => label, "value" => value },
3586
+ body: body,
3587
+ app_id: app_id,
3588
+ response: "UserPreferences",
3589
+ request_options: request_options
3590
+ )
3591
+ end
3592
+ end
3593
+
3594
+ # smsKeywords kaynağı.
3595
+ class SmsKeywords < Pushizo::BaseResource
3596
+ # İki yönlü mesaj anahtar sözcükleri (org geneli + bu app) ve yasal (ayrılmış) sözcükler
3597
+ #
3598
+ # GET /v1/apps/{appId}/sms-keywords
3599
+ def keywords(app_id: nil, request_options: nil)
3600
+ @client.call(
3601
+ :get, "/v1/apps/{appId}/sms-keywords",
3602
+ path_params: {},
3603
+ app_id: app_id,
3604
+ response: "SmsKeywordList",
3605
+ request_options: request_options
3606
+ )
3607
+ end
3608
+
3609
+ # Anahtar sözcük oluştur (tag ekle/kaldır, olay → journey tetiği, otomatik yanıt, abonelik)
3610
+ #
3611
+ # POST /v1/apps/{appId}/sms-keywords
3612
+ def create_keyword(body, app_id: nil, request_options: nil)
3613
+ @client.call(
3614
+ :post, "/v1/apps/{appId}/sms-keywords",
3615
+ path_params: {},
3616
+ body: body,
3617
+ app_id: app_id,
3618
+ response: "SmsKeyword",
3619
+ request_options: request_options
3620
+ )
3621
+ end
3622
+
3623
+ # Anahtar sözcüğü güncelle
3624
+ #
3625
+ # PATCH /v1/apps/{appId}/sms-keywords/{keywordId}
3626
+ def update_keyword(keyword_id, body, app_id: nil, request_options: nil)
3627
+ @client.call(
3628
+ :patch, "/v1/apps/{appId}/sms-keywords/{keywordId}",
3629
+ path_params: { "keywordId" => keyword_id },
3630
+ body: body,
3631
+ app_id: app_id,
3632
+ response: "SmsKeyword",
3633
+ request_options: request_options
3634
+ )
3635
+ end
3636
+
3637
+ # Anahtar sözcüğü sil
3638
+ #
3639
+ # DELETE /v1/apps/{appId}/sms-keywords/{keywordId}
3640
+ def delete_keyword(keyword_id, app_id: nil, request_options: nil)
3641
+ @client.call(
3642
+ :delete, "/v1/apps/{appId}/sms-keywords/{keywordId}",
3643
+ path_params: { "keywordId" => keyword_id },
3644
+ app_id: app_id,
3645
+ response: "Ok",
3646
+ request_options: request_options
3647
+ )
3648
+ end
3649
+ end
3650
+
3651
+ # surveys kaynağı.
3652
+ class Surveys < Pushizo::BaseResource
3653
+ # Anketler
3654
+ #
3655
+ # GET /v1/apps/{appId}/surveys
3656
+ #
3657
+ # @param status Değerler: "draft", "active", "closed".
3658
+ def list(limit: nil, cursor: nil, status: nil, app_id: nil, request_options: nil)
3659
+ @client.call(
3660
+ :get, "/v1/apps/{appId}/surveys",
3661
+ path_params: {},
3662
+ query: { "limit" => limit, "cursor" => cursor, "status" => status },
3663
+ app_id: app_id,
3664
+ response: "SurveyPage",
3665
+ request_options: request_options
3666
+ )
3667
+ end
3668
+
3669
+ # list sonuçlarını next_cursor ile tüm sayfalar boyunca tek tek dolaşan Enumerator döndürür (sayfalar tembel yüklenir).
3670
+ def list_all(limit: nil, cursor: nil, status: nil, app_id: nil, request_options: nil)
3671
+ @client.paginate(cursor) do |cursor_value|
3672
+ list(limit: limit, status: status, app_id: app_id, request_options: request_options, cursor: cursor_value)
3673
+ end
3674
+ end
3675
+
3676
+ # Anket oluştur (taslak)
3677
+ #
3678
+ # POST /v1/apps/{appId}/surveys
3679
+ def create(body, app_id: nil, request_options: nil)
3680
+ @client.call(
3681
+ :post, "/v1/apps/{appId}/surveys",
3682
+ path_params: {},
3683
+ body: body,
3684
+ app_id: app_id,
3685
+ response: "Survey",
3686
+ request_options: request_options
3687
+ )
3688
+ end
3689
+
3690
+ # Anket detayı
3691
+ #
3692
+ # GET /v1/apps/{appId}/surveys/{surveyId}
3693
+ def get(survey_id, app_id: nil, request_options: nil)
3694
+ @client.call(
3695
+ :get, "/v1/apps/{appId}/surveys/{surveyId}",
3696
+ path_params: { "surveyId" => survey_id },
3697
+ app_id: app_id,
3698
+ response: "Survey",
3699
+ request_options: request_options
3700
+ )
3701
+ end
3702
+
3703
+ # Etkinleştir / kapat
3704
+ #
3705
+ # POST /v1/apps/{appId}/surveys/{surveyId}/status
3706
+ def status(survey_id, body, app_id: nil, request_options: nil)
3707
+ @client.call(
3708
+ :post, "/v1/apps/{appId}/surveys/{surveyId}/status",
3709
+ path_params: { "surveyId" => survey_id },
3710
+ body: body,
3711
+ app_id: app_id,
3712
+ response: "Survey",
3713
+ request_options: request_options
3714
+ )
3715
+ end
3716
+
3717
+ # NPS / CSAT raporu
3718
+ #
3719
+ # GET /v1/apps/{appId}/surveys/{surveyId}/report
3720
+ def report(survey_id, days: nil, app_id: nil, request_options: nil)
3721
+ @client.call(
3722
+ :get, "/v1/apps/{appId}/surveys/{surveyId}/report",
3723
+ path_params: { "surveyId" => survey_id },
3724
+ query: { "days" => days },
3725
+ app_id: app_id,
3726
+ response: "SurveyReport",
3727
+ request_options: request_options
3728
+ )
3729
+ end
3730
+
3731
+ # Anket yanıtları
3732
+ #
3733
+ # GET /v1/apps/{appId}/surveys/{surveyId}/responses
3734
+ #
3735
+ # @param nps_category Değerler: "promoter", "passive", "detractor".
3736
+ def responses(survey_id, limit: nil, cursor: nil, text_question: nil, nps_category: nil, app_id: nil, request_options: nil)
3737
+ @client.call(
3738
+ :get, "/v1/apps/{appId}/surveys/{surveyId}/responses",
3739
+ path_params: { "surveyId" => survey_id },
3740
+ query: { "limit" => limit, "cursor" => cursor, "text_question" => text_question, "nps_category" => nps_category },
3741
+ app_id: app_id,
3742
+ response: "SurveyResponsePage",
3743
+ request_options: request_options
3744
+ )
3745
+ end
3746
+
3747
+ # responses sonuçlarını next_cursor ile tüm sayfalar boyunca tek tek dolaşan Enumerator döndürür (sayfalar tembel yüklenir).
3748
+ def responses_all(survey_id, limit: nil, cursor: nil, text_question: nil, nps_category: nil, app_id: nil, request_options: nil)
3749
+ @client.paginate(cursor) do |cursor_value|
3750
+ responses(survey_id, limit: limit, text_question: text_question, nps_category: nps_category, app_id: app_id, request_options: request_options, cursor: cursor_value)
3751
+ end
3752
+ end
3753
+
3754
+ # Sunucu tarafı anket yanıtı (`external_id` ile kullanıcıya bağlanır)
3755
+ #
3756
+ # POST /v1/apps/{appId}/surveys/{surveyId}/responses
3757
+ def respond(survey_id, body, app_id: nil, request_options: nil)
3758
+ @client.call(
3759
+ :post, "/v1/apps/{appId}/surveys/{surveyId}/responses",
3760
+ path_params: { "surveyId" => survey_id },
3761
+ body: body,
3762
+ app_id: app_id,
3763
+ response: "SurveyResponseResult",
3764
+ request_options: request_options
3765
+ )
3766
+ end
3767
+ end
3768
+
3769
+ # warehouseExports kaynağı.
3770
+ class WarehouseExports < Pushizo::BaseResource
3771
+ # Dışa aktarılabilir tablolar, kolonlar ve şema sürümleri
3772
+ #
3773
+ # GET /v1/apps/{appId}/warehouse-exports/tables
3774
+ def tables(app_id: nil, request_options: nil)
3775
+ @client.call(
3776
+ :get, "/v1/apps/{appId}/warehouse-exports/tables",
3777
+ path_params: {},
3778
+ app_id: app_id,
3779
+ response: "WarehouseTables",
3780
+ request_options: request_options
3781
+ )
3782
+ end
3783
+
3784
+ # Kaydetmeden bağlantı testi
3785
+ #
3786
+ # POST /v1/apps/{appId}/warehouse-exports/test-connection
3787
+ def test(body, app_id: nil, request_options: nil)
3788
+ @client.call(
3789
+ :post, "/v1/apps/{appId}/warehouse-exports/test-connection",
3790
+ path_params: {},
3791
+ body: body,
3792
+ app_id: app_id,
3793
+ response: "WarehouseConnectionResult",
3794
+ request_options: request_options
3795
+ )
3796
+ end
3797
+
3798
+ # Veri ambarı dışa aktarımları
3799
+ #
3800
+ # GET /v1/apps/{appId}/warehouse-exports
3801
+ def list(app_id: nil, request_options: nil)
3802
+ @client.call(
3803
+ :get, "/v1/apps/{appId}/warehouse-exports",
3804
+ path_params: {},
3805
+ app_id: app_id,
3806
+ response: "WarehouseExportList",
3807
+ request_options: request_options
3808
+ )
3809
+ end
3810
+
3811
+ # Dışa aktarım oluştur (kimlik bilgisi şifreli saklanır, yanıtta dönmez)
3812
+ #
3813
+ # POST /v1/apps/{appId}/warehouse-exports
3814
+ def create(body, app_id: nil, request_options: nil)
3815
+ @client.call(
3816
+ :post, "/v1/apps/{appId}/warehouse-exports",
3817
+ path_params: {},
3818
+ body: body,
3819
+ app_id: app_id,
3820
+ response: "WarehouseExport",
3821
+ request_options: request_options
3822
+ )
3823
+ end
3824
+
3825
+ # Dışa aktarım detayı
3826
+ #
3827
+ # GET /v1/apps/{appId}/warehouse-exports/{exportId}
3828
+ def get(export_id, app_id: nil, request_options: nil)
3829
+ @client.call(
3830
+ :get, "/v1/apps/{appId}/warehouse-exports/{exportId}",
3831
+ path_params: { "exportId" => export_id },
3832
+ app_id: app_id,
3833
+ response: "WarehouseExport",
3834
+ request_options: request_options
3835
+ )
3836
+ end
3837
+
3838
+ # Dışa aktarımı güncelle (ad, tablolar, zamanlama, etkin/duraklat, hedef ayarı, kimlik bilgisi)
3839
+ #
3840
+ # PATCH /v1/apps/{appId}/warehouse-exports/{exportId}
3841
+ def update(export_id, body, app_id: nil, request_options: nil)
3842
+ @client.call(
3843
+ :patch, "/v1/apps/{appId}/warehouse-exports/{exportId}",
3844
+ path_params: { "exportId" => export_id },
3845
+ body: body,
3846
+ app_id: app_id,
3847
+ response: "WarehouseExport",
3848
+ request_options: request_options
3849
+ )
3850
+ end
3851
+
3852
+ # Dışa aktarımı sil (hedefteki veriler silinmez)
3853
+ #
3854
+ # DELETE /v1/apps/{appId}/warehouse-exports/{exportId}
3855
+ def delete(export_id, app_id: nil, request_options: nil)
3856
+ @client.call(
3857
+ :delete, "/v1/apps/{appId}/warehouse-exports/{exportId}",
3858
+ path_params: { "exportId" => export_id },
3859
+ app_id: app_id,
3860
+ response: "Ok",
3861
+ request_options: request_options
3862
+ )
3863
+ end
3864
+
3865
+ # Kayıtlı dışa aktarımın bağlantı testi
3866
+ #
3867
+ # POST /v1/apps/{appId}/warehouse-exports/{exportId}/test
3868
+ def test_saved(export_id, app_id: nil, request_options: nil)
3869
+ @client.call(
3870
+ :post, "/v1/apps/{appId}/warehouse-exports/{exportId}/test",
3871
+ path_params: { "exportId" => export_id },
3872
+ app_id: app_id,
3873
+ response: "WarehouseConnectionResult",
3874
+ request_options: request_options
3875
+ )
3876
+ end
3877
+
3878
+ # Şimdi çalıştır (son başarılı imleçten itibaren)
3879
+ #
3880
+ # POST /v1/apps/{appId}/warehouse-exports/{exportId}/run
3881
+ def run(export_id, app_id: nil, request_options: nil)
3882
+ @client.call(
3883
+ :post, "/v1/apps/{appId}/warehouse-exports/{exportId}/run",
3884
+ path_params: { "exportId" => export_id },
3885
+ app_id: app_id,
3886
+ response: "WarehouseExportRun",
3887
+ request_options: request_options
3888
+ )
3889
+ end
3890
+
3891
+ # Çalıştırma geçmişi (cursor)
3892
+ #
3893
+ # GET /v1/apps/{appId}/warehouse-exports/{exportId}/runs
3894
+ def runs(export_id, limit: nil, cursor: nil, app_id: nil, request_options: nil)
3895
+ @client.call(
3896
+ :get, "/v1/apps/{appId}/warehouse-exports/{exportId}/runs",
3897
+ path_params: { "exportId" => export_id },
3898
+ query: { "limit" => limit, "cursor" => cursor },
3899
+ app_id: app_id,
3900
+ response: "WarehouseExportRunPage",
3901
+ request_options: request_options
3902
+ )
3903
+ end
3904
+
3905
+ # runs sonuçlarını next_cursor ile tüm sayfalar boyunca tek tek dolaşan Enumerator döndürür (sayfalar tembel yüklenir).
3906
+ def runs_all(export_id, limit: nil, cursor: nil, app_id: nil, request_options: nil)
3907
+ @client.paginate(cursor) do |cursor_value|
3908
+ runs(export_id, limit: limit, app_id: app_id, request_options: request_options, cursor: cursor_value)
3909
+ end
3910
+ end
3911
+ end
3912
+
3913
+ # webCampaigns kaynağı.
3914
+ class WebCampaigns < Pushizo::BaseResource
3915
+ # Web kampanyaları
3916
+ #
3917
+ # GET /v1/apps/{appId}/web-campaigns
3918
+ #
3919
+ # @param status Değerler: "draft", "active", "paused", "archived".
3920
+ def list(limit: nil, cursor: nil, status: nil, app_id: nil, request_options: nil)
3921
+ @client.call(
3922
+ :get, "/v1/apps/{appId}/web-campaigns",
3923
+ path_params: {},
3924
+ query: { "limit" => limit, "cursor" => cursor, "status" => status },
3925
+ app_id: app_id,
3926
+ response: "WebCampaignPage",
3927
+ request_options: request_options
3928
+ )
3929
+ end
3930
+
3931
+ # list sonuçlarını next_cursor ile tüm sayfalar boyunca tek tek dolaşan Enumerator döndürür (sayfalar tembel yüklenir).
3932
+ def list_all(limit: nil, cursor: nil, status: nil, app_id: nil, request_options: nil)
3933
+ @client.paginate(cursor) do |cursor_value|
3934
+ list(limit: limit, status: status, app_id: app_id, request_options: request_options, cursor: cursor_value)
3935
+ end
3936
+ end
3937
+
3938
+ # Web kampanyası oluştur (taslak)
3939
+ #
3940
+ # POST /v1/apps/{appId}/web-campaigns
3941
+ def create(body, app_id: nil, request_options: nil)
3942
+ @client.call(
3943
+ :post, "/v1/apps/{appId}/web-campaigns",
3944
+ path_params: {},
3945
+ body: body,
3946
+ app_id: app_id,
3947
+ response: "WebCampaign",
3948
+ request_options: request_options
3949
+ )
3950
+ end
3951
+
3952
+ # Web kampanyası detayı ve istatistikleri
3953
+ #
3954
+ # GET /v1/apps/{appId}/web-campaigns/{campaignId}
3955
+ def get(campaign_id, app_id: nil, request_options: nil)
3956
+ @client.call(
3957
+ :get, "/v1/apps/{appId}/web-campaigns/{campaignId}",
3958
+ path_params: { "campaignId" => campaign_id },
3959
+ app_id: app_id,
3960
+ response: "WebCampaign",
3961
+ request_options: request_options
3962
+ )
3963
+ end
3964
+
3965
+ # Web kampanyasını düzenle
3966
+ #
3967
+ # PATCH /v1/apps/{appId}/web-campaigns/{campaignId}
3968
+ def update(campaign_id, body, app_id: nil, request_options: nil)
3969
+ @client.call(
3970
+ :patch, "/v1/apps/{appId}/web-campaigns/{campaignId}",
3971
+ path_params: { "campaignId" => campaign_id },
3972
+ body: body,
3973
+ app_id: app_id,
3974
+ response: "WebCampaign",
3975
+ request_options: request_options
3976
+ )
3977
+ end
3978
+
3979
+ # Günlük seri
3980
+ #
3981
+ # GET /v1/apps/{appId}/web-campaigns/{campaignId}/report
3982
+ def report(campaign_id, days: nil, app_id: nil, request_options: nil)
3983
+ @client.call(
3984
+ :get, "/v1/apps/{appId}/web-campaigns/{campaignId}/report",
3985
+ path_params: { "campaignId" => campaign_id },
3986
+ query: { "days" => days },
3987
+ app_id: app_id,
3988
+ response: "WebCampaignReport",
3989
+ request_options: request_options
3990
+ )
3991
+ end
3992
+
3993
+ # Yayınla / duraklat / arşivle
3994
+ #
3995
+ # POST /v1/apps/{appId}/web-campaigns/{campaignId}/status
3996
+ def status(campaign_id, body, app_id: nil, request_options: nil)
3997
+ @client.call(
3998
+ :post, "/v1/apps/{appId}/web-campaigns/{campaignId}/status",
3999
+ path_params: { "campaignId" => campaign_id },
4000
+ body: body,
4001
+ app_id: app_id,
4002
+ response: "WebCampaign",
4003
+ request_options: request_options
4004
+ )
4005
+ end
4006
+ end
4007
+
4008
+ # whatsapp kaynağı.
4009
+ class Whatsapp < Pushizo::BaseResource
4010
+ # WhatsApp şablonları (Meta onay durumu ile)
4011
+ #
4012
+ # GET /v1/apps/{appId}/whatsapp/templates
4013
+ def templates(status: nil, app_id: nil, request_options: nil)
4014
+ @client.call(
4015
+ :get, "/v1/apps/{appId}/whatsapp/templates",
4016
+ path_params: {},
4017
+ query: { "status" => status },
4018
+ app_id: app_id,
4019
+ response: "WhatsAppTemplateList",
4020
+ request_options: request_options
4021
+ )
4022
+ end
4023
+
4024
+ # WhatsApp şablonlarını Meta Graph API’den senkronla
4025
+ #
4026
+ # POST /v1/apps/{appId}/whatsapp/templates/sync
4027
+ def sync(app_id: nil, request_options: nil)
4028
+ @client.call(
4029
+ :post, "/v1/apps/{appId}/whatsapp/templates/sync",
4030
+ path_params: {},
4031
+ app_id: app_id,
4032
+ response: "WhatsAppTemplateSync",
4033
+ request_options: request_options
4034
+ )
4035
+ end
4036
+ end
4037
+ end
4038
+
4039
+ # İstemciye kaynak erişimcilerini ekleyen üretilmiş modül.
4040
+ module GeneratedResources
4041
+ # SDK'nın üretildiği OpenAPI sözleşmesinin sürümü.
4042
+ API_VERSION = "1.0.0"
4043
+
4044
+ RESOURCE_NAMES = %i[notifications users aliases subscriptions events segments templates campaigns in_app_messages inbox suppressions exports imports webhooks channels analytics apps api_keys organization ads canned_responses categories content_tables conversations data_feeds email_deliverability forms identity_keys integrations journeys landing_pages live_activities mcp preferences sms_keywords surveys warehouse_exports web_campaigns whatsapp].freeze
4045
+
4046
+ # Bildirim gönderme, durum, iptal, teslimatlar ve geçmiş dışa aktarımı.
4047
+ def notifications
4048
+ @notifications ||= Pushizo::Resources::Notifications.new(self)
4049
+ end
4050
+
4051
+ # Kullanıcı oluşturma/güncelleme (tag, özellik), arama ve abonelik ekleme.
4052
+ def users
4053
+ @users ||= Pushizo::Resources::Users.new(self)
4054
+ end
4055
+
4056
+ # Kullanıcı kimlikleri (alias): ekleme ve kaldırma.
4057
+ def aliases
4058
+ @aliases ||= Pushizo::Resources::Aliases.new(self)
4059
+ end
4060
+
4061
+ # Abonelik (cihaz/e-posta/SMS) okuma, güncelleme, silme ve sahip atama.
4062
+ def subscriptions
4063
+ @subscriptions ||= Pushizo::Resources::Subscriptions.new(self)
4064
+ end
4065
+
4066
+ # Özel olay gönderimi ve olay tanımları.
4067
+ def events
4068
+ @events ||= Pushizo::Resources::Events.new(self)
4069
+ end
4070
+
4071
+ # Segment yönetimi, önizleme ve kitle tahmini.
4072
+ def segments
4073
+ @segments ||= Pushizo::Resources::Segments.new(self)
4074
+ end
4075
+
4076
+ # Şablon yönetimi, sürümler ve önizleme.
4077
+ def templates
4078
+ @templates ||= Pushizo::Resources::Templates.new(self)
4079
+ end
4080
+
4081
+ # Kampanya yaşam döngüsü (zamanlama, gönderim, duraklatma, onay) ve istatistikler.
4082
+ def campaigns
4083
+ @campaigns ||= Pushizo::Resources::Campaigns.new(self)
4084
+ end
4085
+
4086
+ # Uygulama içi (in-app) mesaj yönetimi ve durum değişiklikleri.
4087
+ def in_app_messages
4088
+ @in_app_messages ||= Pushizo::Resources::InAppMessages.new(self)
4089
+ end
4090
+
4091
+ # Kullanıcı bildirim kutusu (inbox): listeleme, okundu işaretleme ve arşivleme.
4092
+ def inbox
4093
+ @inbox ||= Pushizo::Resources::Inbox.new(self)
4094
+ end
4095
+
4096
+ # E-posta/SMS gönderim engeli (suppression) listesi.
4097
+ def suppressions
4098
+ @suppressions ||= Pushizo::Resources::Suppressions.new(self)
4099
+ end
4100
+
4101
+ # Veri dışa aktarma işleri.
4102
+ def exports
4103
+ @exports ||= Pushizo::Resources::Exports.new(self)
4104
+ end
4105
+
4106
+ # Veri içe aktarma işleri (CSV, multipart).
4107
+ def imports
4108
+ @imports ||= Pushizo::Resources::Imports.new(self)
4109
+ end
4110
+
4111
+ # Giden webhook uç noktaları, teslimatlar ve yeniden gönderim.
4112
+ def webhooks
4113
+ @webhooks ||= Pushizo::Resources::Webhooks.new(self)
4114
+ end
4115
+
4116
+ # Kanal (APNs, FCM, Web Push, e-posta, SMS) yapılandırması ve doğrulaması.
4117
+ def channels
4118
+ @channels ||= Pushizo::Resources::Channels.new(self)
4119
+ end
4120
+
4121
+ # Analitik raporları.
4122
+ def analytics
4123
+ @analytics ||= Pushizo::Resources::Analytics.new(self)
4124
+ end
4125
+
4126
+ # App listesi ve ayarları.
4127
+ def apps
4128
+ @apps ||= Pushizo::Resources::Apps.new(self)
4129
+ end
4130
+
4131
+ # App API anahtarları: oluşturma, kapsam/IP izin listesi güncelleme, rotasyon ve iptal.
4132
+ def api_keys
4133
+ @api_keys ||= Pushizo::Resources::ApiKeys.new(self)
4134
+ end
4135
+
4136
+ # Organizasyon, üyeler ve denetim kayıtları.
4137
+ def organization
4138
+ @organization ||= Pushizo::Resources::Organization.new(self)
4139
+ end
4140
+
4141
+ def ads
4142
+ @ads ||= Pushizo::Resources::Ads.new(self)
4143
+ end
4144
+
4145
+ def canned_responses
4146
+ @canned_responses ||= Pushizo::Resources::CannedResponses.new(self)
4147
+ end
4148
+
4149
+ def categories
4150
+ @categories ||= Pushizo::Resources::Categories.new(self)
4151
+ end
4152
+
4153
+ def content_tables
4154
+ @content_tables ||= Pushizo::Resources::ContentTables.new(self)
4155
+ end
4156
+
4157
+ def conversations
4158
+ @conversations ||= Pushizo::Resources::Conversations.new(self)
4159
+ end
4160
+
4161
+ def data_feeds
4162
+ @data_feeds ||= Pushizo::Resources::DataFeeds.new(self)
4163
+ end
4164
+
4165
+ def email_deliverability
4166
+ @email_deliverability ||= Pushizo::Resources::EmailDeliverability.new(self)
4167
+ end
4168
+
4169
+ def forms
4170
+ @forms ||= Pushizo::Resources::Forms.new(self)
4171
+ end
4172
+
4173
+ def identity_keys
4174
+ @identity_keys ||= Pushizo::Resources::IdentityKeys.new(self)
4175
+ end
4176
+
4177
+ def integrations
4178
+ @integrations ||= Pushizo::Resources::Integrations.new(self)
4179
+ end
4180
+
4181
+ def journeys
4182
+ @journeys ||= Pushizo::Resources::Journeys.new(self)
4183
+ end
4184
+
4185
+ def landing_pages
4186
+ @landing_pages ||= Pushizo::Resources::LandingPages.new(self)
4187
+ end
4188
+
4189
+ def live_activities
4190
+ @live_activities ||= Pushizo::Resources::LiveActivities.new(self)
4191
+ end
4192
+
4193
+ def mcp
4194
+ @mcp ||= Pushizo::Resources::Mcp.new(self)
4195
+ end
4196
+
4197
+ def preferences
4198
+ @preferences ||= Pushizo::Resources::Preferences.new(self)
4199
+ end
4200
+
4201
+ def sms_keywords
4202
+ @sms_keywords ||= Pushizo::Resources::SmsKeywords.new(self)
4203
+ end
4204
+
4205
+ def surveys
4206
+ @surveys ||= Pushizo::Resources::Surveys.new(self)
4207
+ end
4208
+
4209
+ def warehouse_exports
4210
+ @warehouse_exports ||= Pushizo::Resources::WarehouseExports.new(self)
4211
+ end
4212
+
4213
+ def web_campaigns
4214
+ @web_campaigns ||= Pushizo::Resources::WebCampaigns.new(self)
4215
+ end
4216
+
4217
+ def whatsapp
4218
+ @whatsapp ||= Pushizo::Resources::Whatsapp.new(self)
4219
+ end
4220
+ end
4221
+ end