late-sdk 0.0.119 → 0.0.121
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.
- checksums.yaml +4 -4
- data/README.md +5 -2
- data/docs/AccountsApi.md +72 -0
- data/docs/AdCampaignsApi.md +6 -2
- data/docs/AdsApi.md +11 -70
- data/docs/ConnectApi.md +3 -3
- data/docs/DisconnectAdsRequest.md +18 -0
- data/docs/WebhookEventsApi.md +69 -0
- data/docs/WebhookPayloadMessageSent.md +28 -0
- data/docs/WebhookPayloadMessageSentMessage.md +36 -0
- data/docs/WebhookPayloadMessageSentMessageSender.md +24 -0
- data/lib/late-sdk/api/accounts_api.rb +74 -0
- data/lib/late-sdk/api/ad_campaigns_api.rb +8 -2
- data/lib/late-sdk/api/ads_api.rb +16 -61
- data/lib/late-sdk/api/connect_api.rb +4 -4
- data/lib/late-sdk/api/webhook_events_api.rb +66 -0
- data/lib/late-sdk/api/webhooks_api.rb +1 -1
- data/lib/late-sdk/models/disconnect_ads_request.rb +189 -0
- data/lib/late-sdk/models/webhook_log.rb +2 -2
- data/lib/late-sdk/models/webhook_payload_message_sent.rb +320 -0
- data/lib/late-sdk/models/webhook_payload_message_sent_message.rb +430 -0
- data/lib/late-sdk/models/{sync_external_ads200_response.rb → webhook_payload_message_sent_message_sender.rb} +45 -31
- data/lib/late-sdk/version.rb +1 -1
- data/lib/late-sdk.rb +4 -1
- data/openapi.yaml +191 -37
- data/spec/api/accounts_api_spec.rb +13 -0
- data/spec/api/ad_campaigns_api_spec.rb +3 -1
- data/spec/api/ads_api_spec.rb +6 -13
- data/spec/api/connect_api_spec.rb +2 -2
- data/spec/models/disconnect_ads_request_spec.rb +40 -0
- data/spec/models/webhook_log_spec.rb +1 -1
- data/spec/models/{sync_external_ads200_response_spec.rb → webhook_payload_message_sent_message_sender_spec.rb} +10 -10
- data/spec/models/webhook_payload_message_sent_message_spec.rb +98 -0
- data/spec/models/webhook_payload_message_sent_spec.rb +70 -0
- data/spec/models/webhook_spec.rb +1 -1
- data/zernio-sdk-0.0.121.gem +0 -0
- metadata +756 -744
- data/docs/SyncExternalAds200Response.md +0 -24
- data/zernio-sdk-0.0.119.gem +0 -0
data/lib/late-sdk/api/ads_api.rb
CHANGED
|
@@ -280,9 +280,11 @@ module Late
|
|
|
280
280
|
end
|
|
281
281
|
|
|
282
282
|
# Get ad analytics with daily breakdown
|
|
283
|
-
# Returns
|
|
283
|
+
# Returns detailed performance analytics for an ad. Includes summary metrics, a daily timeline over the requested date range, and optional demographic breakdowns (Meta and TikTok only). If no date range is provided, defaults to the last 90 days. Date range is capped at 90 days max.
|
|
284
284
|
# @param ad_id [String]
|
|
285
285
|
# @param [Hash] opts the optional parameters
|
|
286
|
+
# @option opts [Date] :from_date Start of date range (YYYY-MM-DD). Defaults to 90 days ago.
|
|
287
|
+
# @option opts [Date] :to_date End of date range (YYYY-MM-DD). Defaults to today. Max 90-day range.
|
|
286
288
|
# @option opts [String] :breakdowns Comma-separated breakdown dimensions. Meta: age, gender, country, publisher_platform, device_platform, region. TikTok: gender, age, country_code, platform, ac, language.
|
|
287
289
|
# @return [GetAdAnalytics200Response]
|
|
288
290
|
def get_ad_analytics(ad_id, opts = {})
|
|
@@ -291,9 +293,11 @@ module Late
|
|
|
291
293
|
end
|
|
292
294
|
|
|
293
295
|
# Get ad analytics with daily breakdown
|
|
294
|
-
# Returns
|
|
296
|
+
# Returns detailed performance analytics for an ad. Includes summary metrics, a daily timeline over the requested date range, and optional demographic breakdowns (Meta and TikTok only). If no date range is provided, defaults to the last 90 days. Date range is capped at 90 days max.
|
|
295
297
|
# @param ad_id [String]
|
|
296
298
|
# @param [Hash] opts the optional parameters
|
|
299
|
+
# @option opts [Date] :from_date Start of date range (YYYY-MM-DD). Defaults to 90 days ago.
|
|
300
|
+
# @option opts [Date] :to_date End of date range (YYYY-MM-DD). Defaults to today. Max 90-day range.
|
|
297
301
|
# @option opts [String] :breakdowns Comma-separated breakdown dimensions. Meta: age, gender, country, publisher_platform, device_platform, region. TikTok: gender, age, country_code, platform, ac, language.
|
|
298
302
|
# @return [Array<(GetAdAnalytics200Response, Integer, Hash)>] GetAdAnalytics200Response data, response status code and response headers
|
|
299
303
|
def get_ad_analytics_with_http_info(ad_id, opts = {})
|
|
@@ -309,6 +313,8 @@ module Late
|
|
|
309
313
|
|
|
310
314
|
# query parameters
|
|
311
315
|
query_params = opts[:query_params] || {}
|
|
316
|
+
query_params[:'fromDate'] = opts[:'from_date'] if !opts[:'from_date'].nil?
|
|
317
|
+
query_params[:'toDate'] = opts[:'to_date'] if !opts[:'to_date'].nil?
|
|
312
318
|
query_params[:'breakdowns'] = opts[:'breakdowns'] if !opts[:'breakdowns'].nil?
|
|
313
319
|
|
|
314
320
|
# header parameters
|
|
@@ -410,7 +416,7 @@ module Late
|
|
|
410
416
|
end
|
|
411
417
|
|
|
412
418
|
# List ads
|
|
413
|
-
# Returns a paginated list of ads with
|
|
419
|
+
# Returns a paginated list of ads with metrics computed over an optional date range. Use `source=all` to include externally-synced ads from platform ad managers. If no date range is provided, defaults to the last 90 days. Date range is capped at 90 days max.
|
|
414
420
|
# @param [Hash] opts the optional parameters
|
|
415
421
|
# @option opts [Integer] :page Page number (1-based) (default to 1)
|
|
416
422
|
# @option opts [Integer] :limit (default to 50)
|
|
@@ -420,6 +426,8 @@ module Late
|
|
|
420
426
|
# @option opts [String] :account_id Social account ID
|
|
421
427
|
# @option opts [String] :profile_id Profile ID
|
|
422
428
|
# @option opts [String] :campaign_id Platform campaign ID (filter ads within a campaign)
|
|
429
|
+
# @option opts [Date] :from_date Start of metrics date range (YYYY-MM-DD). Defaults to 90 days ago.
|
|
430
|
+
# @option opts [Date] :to_date End of metrics date range (YYYY-MM-DD). Defaults to today. Max 90-day range.
|
|
423
431
|
# @return [ListAds200Response]
|
|
424
432
|
def list_ads(opts = {})
|
|
425
433
|
data, _status_code, _headers = list_ads_with_http_info(opts)
|
|
@@ -427,7 +435,7 @@ module Late
|
|
|
427
435
|
end
|
|
428
436
|
|
|
429
437
|
# List ads
|
|
430
|
-
# Returns a paginated list of ads with
|
|
438
|
+
# Returns a paginated list of ads with metrics computed over an optional date range. Use `source=all` to include externally-synced ads from platform ad managers. If no date range is provided, defaults to the last 90 days. Date range is capped at 90 days max.
|
|
431
439
|
# @param [Hash] opts the optional parameters
|
|
432
440
|
# @option opts [Integer] :page Page number (1-based) (default to 1)
|
|
433
441
|
# @option opts [Integer] :limit (default to 50)
|
|
@@ -437,6 +445,8 @@ module Late
|
|
|
437
445
|
# @option opts [String] :account_id Social account ID
|
|
438
446
|
# @option opts [String] :profile_id Profile ID
|
|
439
447
|
# @option opts [String] :campaign_id Platform campaign ID (filter ads within a campaign)
|
|
448
|
+
# @option opts [Date] :from_date Start of metrics date range (YYYY-MM-DD). Defaults to 90 days ago.
|
|
449
|
+
# @option opts [Date] :to_date End of metrics date range (YYYY-MM-DD). Defaults to today. Max 90-day range.
|
|
440
450
|
# @return [Array<(ListAds200Response, Integer, Hash)>] ListAds200Response data, response status code and response headers
|
|
441
451
|
def list_ads_with_http_info(opts = {})
|
|
442
452
|
if @api_client.config.debugging
|
|
@@ -479,6 +489,8 @@ module Late
|
|
|
479
489
|
query_params[:'accountId'] = opts[:'account_id'] if !opts[:'account_id'].nil?
|
|
480
490
|
query_params[:'profileId'] = opts[:'profile_id'] if !opts[:'profile_id'].nil?
|
|
481
491
|
query_params[:'campaignId'] = opts[:'campaign_id'] if !opts[:'campaign_id'].nil?
|
|
492
|
+
query_params[:'fromDate'] = opts[:'from_date'] if !opts[:'from_date'].nil?
|
|
493
|
+
query_params[:'toDate'] = opts[:'to_date'] if !opts[:'to_date'].nil?
|
|
482
494
|
|
|
483
495
|
# header parameters
|
|
484
496
|
header_params = opts[:header_params] || {}
|
|
@@ -585,63 +597,6 @@ module Late
|
|
|
585
597
|
return data, status_code, headers
|
|
586
598
|
end
|
|
587
599
|
|
|
588
|
-
# Sync external ads from platform ad managers
|
|
589
|
-
# Discovers and imports ads created outside Zernio (e.g. in Meta Ads Manager, Google Ads). Upserts new ads and updates metrics/status for existing ones. Also runs automatically every 30 minutes.
|
|
590
|
-
# @param [Hash] opts the optional parameters
|
|
591
|
-
# @return [SyncExternalAds200Response]
|
|
592
|
-
def sync_external_ads(opts = {})
|
|
593
|
-
data, _status_code, _headers = sync_external_ads_with_http_info(opts)
|
|
594
|
-
data
|
|
595
|
-
end
|
|
596
|
-
|
|
597
|
-
# Sync external ads from platform ad managers
|
|
598
|
-
# Discovers and imports ads created outside Zernio (e.g. in Meta Ads Manager, Google Ads). Upserts new ads and updates metrics/status for existing ones. Also runs automatically every 30 minutes.
|
|
599
|
-
# @param [Hash] opts the optional parameters
|
|
600
|
-
# @return [Array<(SyncExternalAds200Response, Integer, Hash)>] SyncExternalAds200Response data, response status code and response headers
|
|
601
|
-
def sync_external_ads_with_http_info(opts = {})
|
|
602
|
-
if @api_client.config.debugging
|
|
603
|
-
@api_client.config.logger.debug 'Calling API: AdsApi.sync_external_ads ...'
|
|
604
|
-
end
|
|
605
|
-
# resource path
|
|
606
|
-
local_var_path = '/v1/ads/sync'
|
|
607
|
-
|
|
608
|
-
# query parameters
|
|
609
|
-
query_params = opts[:query_params] || {}
|
|
610
|
-
|
|
611
|
-
# header parameters
|
|
612
|
-
header_params = opts[:header_params] || {}
|
|
613
|
-
# HTTP header 'Accept' (if needed)
|
|
614
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
615
|
-
|
|
616
|
-
# form parameters
|
|
617
|
-
form_params = opts[:form_params] || {}
|
|
618
|
-
|
|
619
|
-
# http body (model)
|
|
620
|
-
post_body = opts[:debug_body]
|
|
621
|
-
|
|
622
|
-
# return_type
|
|
623
|
-
return_type = opts[:debug_return_type] || 'SyncExternalAds200Response'
|
|
624
|
-
|
|
625
|
-
# auth_names
|
|
626
|
-
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
627
|
-
|
|
628
|
-
new_options = opts.merge(
|
|
629
|
-
:operation => :"AdsApi.sync_external_ads",
|
|
630
|
-
:header_params => header_params,
|
|
631
|
-
:query_params => query_params,
|
|
632
|
-
:form_params => form_params,
|
|
633
|
-
:body => post_body,
|
|
634
|
-
:auth_names => auth_names,
|
|
635
|
-
:return_type => return_type
|
|
636
|
-
)
|
|
637
|
-
|
|
638
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
639
|
-
if @api_client.config.debugging
|
|
640
|
-
@api_client.config.logger.debug "API called: AdsApi#sync_external_ads\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
641
|
-
end
|
|
642
|
-
return data, status_code, headers
|
|
643
|
-
end
|
|
644
|
-
|
|
645
600
|
# Update ad (pause/resume, budget, targeting, name)
|
|
646
601
|
# Update one or more fields on an ad. Status changes and budget updates are propagated to the platform. Targeting updates are Meta-only.
|
|
647
602
|
# @param ad_id [String]
|
|
@@ -84,11 +84,11 @@ module Late
|
|
|
84
84
|
end
|
|
85
85
|
|
|
86
86
|
# Connect ads for a platform
|
|
87
|
-
# Unified ads connection endpoint. Handles all platforms through a single route: **Same-token platforms** (facebook, instagram, linkedin): If a posting account already exists, returns `alreadyConnected: true` immediately (no extra OAuth needed). If not, starts the normal OAuth flow, and the resulting account supports both posting and ads. **Separate-token platforms** (tiktok, twitter
|
|
87
|
+
# Unified ads connection endpoint. Handles all platforms through a single route: **Same-token platforms** (facebook, instagram, linkedin, pinterest): If a posting account already exists, returns `alreadyConnected: true` immediately (no extra OAuth needed). If not, starts the normal OAuth flow, and the resulting account supports both posting and ads. **Separate-token platforms** (tiktok, twitter): Requires an existing posting account (`accountId` param). If ads are already connected, returns `alreadyConnected: true`. Otherwise, starts the platform-specific marketing API OAuth flow. **Ads-only platforms** (googleads): If a Google Ads account exists, returns `alreadyConnected: true`. Otherwise, starts the Google Ads OAuth flow. Use the `adsStatus` field from `GET /v1/accounts` to check which accounts need ads connection.
|
|
88
88
|
# @param platform [String] Platform to connect ads for. Only platforms with ads support are accepted.
|
|
89
89
|
# @param profile_id [String] Your Zernio profile ID
|
|
90
90
|
# @param [Hash] opts the optional parameters
|
|
91
|
-
# @option opts [String] :account_id Existing SocialAccount ID. Required for separate-token platforms (tiktok, twitter
|
|
91
|
+
# @option opts [String] :account_id Existing SocialAccount ID. Required for separate-token platforms (tiktok, twitter). Ignored for same-token and ads-only platforms.
|
|
92
92
|
# @option opts [String] :redirect_url Custom redirect URL after OAuth completes (same-token platforms only)
|
|
93
93
|
# @option opts [Boolean] :headless Enable headless mode (same-token platforms only) (default to false)
|
|
94
94
|
# @return [ConnectAds200Response]
|
|
@@ -98,11 +98,11 @@ module Late
|
|
|
98
98
|
end
|
|
99
99
|
|
|
100
100
|
# Connect ads for a platform
|
|
101
|
-
# Unified ads connection endpoint. Handles all platforms through a single route: **Same-token platforms** (facebook, instagram, linkedin): If a posting account already exists, returns `alreadyConnected: true` immediately (no extra OAuth needed). If not, starts the normal OAuth flow, and the resulting account supports both posting and ads. **Separate-token platforms** (tiktok, twitter
|
|
101
|
+
# Unified ads connection endpoint. Handles all platforms through a single route: **Same-token platforms** (facebook, instagram, linkedin, pinterest): If a posting account already exists, returns `alreadyConnected: true` immediately (no extra OAuth needed). If not, starts the normal OAuth flow, and the resulting account supports both posting and ads. **Separate-token platforms** (tiktok, twitter): Requires an existing posting account (`accountId` param). If ads are already connected, returns `alreadyConnected: true`. Otherwise, starts the platform-specific marketing API OAuth flow. **Ads-only platforms** (googleads): If a Google Ads account exists, returns `alreadyConnected: true`. Otherwise, starts the Google Ads OAuth flow. Use the `adsStatus` field from `GET /v1/accounts` to check which accounts need ads connection.
|
|
102
102
|
# @param platform [String] Platform to connect ads for. Only platforms with ads support are accepted.
|
|
103
103
|
# @param profile_id [String] Your Zernio profile ID
|
|
104
104
|
# @param [Hash] opts the optional parameters
|
|
105
|
-
# @option opts [String] :account_id Existing SocialAccount ID. Required for separate-token platforms (tiktok, twitter
|
|
105
|
+
# @option opts [String] :account_id Existing SocialAccount ID. Required for separate-token platforms (tiktok, twitter). Ignored for same-token and ads-only platforms.
|
|
106
106
|
# @option opts [String] :redirect_url Custom redirect URL after OAuth completes (same-token platforms only)
|
|
107
107
|
# @option opts [Boolean] :headless Enable headless mode (same-token platforms only) (default to false)
|
|
108
108
|
# @return [Array<(ConnectAds200Response, Integer, Hash)>] ConnectAds200Response data, response status code and response headers
|
|
@@ -283,6 +283,72 @@ module Late
|
|
|
283
283
|
return data, status_code, headers
|
|
284
284
|
end
|
|
285
285
|
|
|
286
|
+
# Message sent event
|
|
287
|
+
# Fired when a message is sent via the API.
|
|
288
|
+
# @param webhook_payload_message_sent [WebhookPayloadMessageSent]
|
|
289
|
+
# @param [Hash] opts the optional parameters
|
|
290
|
+
# @return [nil]
|
|
291
|
+
def on_message_sent(webhook_payload_message_sent, opts = {})
|
|
292
|
+
on_message_sent_with_http_info(webhook_payload_message_sent, opts)
|
|
293
|
+
nil
|
|
294
|
+
end
|
|
295
|
+
|
|
296
|
+
# Message sent event
|
|
297
|
+
# Fired when a message is sent via the API.
|
|
298
|
+
# @param webhook_payload_message_sent [WebhookPayloadMessageSent]
|
|
299
|
+
# @param [Hash] opts the optional parameters
|
|
300
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
301
|
+
def on_message_sent_with_http_info(webhook_payload_message_sent, opts = {})
|
|
302
|
+
if @api_client.config.debugging
|
|
303
|
+
@api_client.config.logger.debug 'Calling API: WebhookEventsApi.on_message_sent ...'
|
|
304
|
+
end
|
|
305
|
+
# verify the required parameter 'webhook_payload_message_sent' is set
|
|
306
|
+
if @api_client.config.client_side_validation && webhook_payload_message_sent.nil?
|
|
307
|
+
fail ArgumentError, "Missing the required parameter 'webhook_payload_message_sent' when calling WebhookEventsApi.on_message_sent"
|
|
308
|
+
end
|
|
309
|
+
# resource path
|
|
310
|
+
local_var_path = '/message.sent'
|
|
311
|
+
|
|
312
|
+
# query parameters
|
|
313
|
+
query_params = opts[:query_params] || {}
|
|
314
|
+
|
|
315
|
+
# header parameters
|
|
316
|
+
header_params = opts[:header_params] || {}
|
|
317
|
+
# HTTP header 'Content-Type'
|
|
318
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
319
|
+
if !content_type.nil?
|
|
320
|
+
header_params['Content-Type'] = content_type
|
|
321
|
+
end
|
|
322
|
+
|
|
323
|
+
# form parameters
|
|
324
|
+
form_params = opts[:form_params] || {}
|
|
325
|
+
|
|
326
|
+
# http body (model)
|
|
327
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(webhook_payload_message_sent)
|
|
328
|
+
|
|
329
|
+
# return_type
|
|
330
|
+
return_type = opts[:debug_return_type]
|
|
331
|
+
|
|
332
|
+
# auth_names
|
|
333
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
334
|
+
|
|
335
|
+
new_options = opts.merge(
|
|
336
|
+
:operation => :"WebhookEventsApi.on_message_sent",
|
|
337
|
+
:header_params => header_params,
|
|
338
|
+
:query_params => query_params,
|
|
339
|
+
:form_params => form_params,
|
|
340
|
+
:body => post_body,
|
|
341
|
+
:auth_names => auth_names,
|
|
342
|
+
:return_type => return_type
|
|
343
|
+
)
|
|
344
|
+
|
|
345
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
346
|
+
if @api_client.config.debugging
|
|
347
|
+
@api_client.config.logger.debug "API called: WebhookEventsApi#on_message_sent\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
348
|
+
end
|
|
349
|
+
return data, status_code, headers
|
|
350
|
+
end
|
|
351
|
+
|
|
286
352
|
# Post cancelled event
|
|
287
353
|
# Fired when a post publishing job is cancelled.
|
|
288
354
|
# @param webhook_payload_post [WebhookPayloadPost]
|
|
@@ -188,7 +188,7 @@ module Late
|
|
|
188
188
|
if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
|
|
189
189
|
fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
|
|
190
190
|
end
|
|
191
|
-
allowable_values = ["post.scheduled", "post.published", "post.failed", "post.partial", "post.cancelled", "post.recycled", "account.connected", "account.disconnected", "message.received", "comment.received", "webhook.test"]
|
|
191
|
+
allowable_values = ["post.scheduled", "post.published", "post.failed", "post.partial", "post.cancelled", "post.recycled", "account.connected", "account.disconnected", "message.received", "message.sent", "comment.received", "webhook.test"]
|
|
192
192
|
if @api_client.config.client_side_validation && opts[:'event'] && !allowable_values.include?(opts[:'event'])
|
|
193
193
|
fail ArgumentError, "invalid value for \"event\", must be one of #{allowable_values}"
|
|
194
194
|
end
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Zernio API
|
|
3
|
+
|
|
4
|
+
#API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.1
|
|
7
|
+
Contact: support@zernio.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Late
|
|
17
|
+
class DisconnectAdsRequest < ApiModelBase
|
|
18
|
+
# The ads platform to disconnect
|
|
19
|
+
attr_accessor :ads_platform
|
|
20
|
+
|
|
21
|
+
class EnumAttributeValidator
|
|
22
|
+
attr_reader :datatype
|
|
23
|
+
attr_reader :allowable_values
|
|
24
|
+
|
|
25
|
+
def initialize(datatype, allowable_values)
|
|
26
|
+
@allowable_values = allowable_values.map do |value|
|
|
27
|
+
case datatype.to_s
|
|
28
|
+
when /Integer/i
|
|
29
|
+
value.to_i
|
|
30
|
+
when /Float/i
|
|
31
|
+
value.to_f
|
|
32
|
+
else
|
|
33
|
+
value
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def valid?(value)
|
|
39
|
+
!value || allowable_values.include?(value)
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
44
|
+
def self.attribute_map
|
|
45
|
+
{
|
|
46
|
+
:'ads_platform' => :'adsPlatform'
|
|
47
|
+
}
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Returns attribute mapping this model knows about
|
|
51
|
+
def self.acceptable_attribute_map
|
|
52
|
+
attribute_map
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# Returns all the JSON keys this model knows about
|
|
56
|
+
def self.acceptable_attributes
|
|
57
|
+
acceptable_attribute_map.values
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Attribute type mapping.
|
|
61
|
+
def self.openapi_types
|
|
62
|
+
{
|
|
63
|
+
:'ads_platform' => :'String'
|
|
64
|
+
}
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# List of attributes with nullable: true
|
|
68
|
+
def self.openapi_nullable
|
|
69
|
+
Set.new([
|
|
70
|
+
])
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Initializes the object
|
|
74
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
75
|
+
def initialize(attributes = {})
|
|
76
|
+
if (!attributes.is_a?(Hash))
|
|
77
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Late::DisconnectAdsRequest` initialize method"
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
81
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
82
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
83
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
84
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Late::DisconnectAdsRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
85
|
+
end
|
|
86
|
+
h[k.to_sym] = v
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if attributes.key?(:'ads_platform')
|
|
90
|
+
self.ads_platform = attributes[:'ads_platform']
|
|
91
|
+
else
|
|
92
|
+
self.ads_platform = nil
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
97
|
+
# @return Array for valid properties with the reasons
|
|
98
|
+
def list_invalid_properties
|
|
99
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
100
|
+
invalid_properties = Array.new
|
|
101
|
+
if @ads_platform.nil?
|
|
102
|
+
invalid_properties.push('invalid value for "ads_platform", ads_platform cannot be nil.')
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
invalid_properties
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# Check to see if the all the properties in the model are valid
|
|
109
|
+
# @return true if the model is valid
|
|
110
|
+
def valid?
|
|
111
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
112
|
+
return false if @ads_platform.nil?
|
|
113
|
+
ads_platform_validator = EnumAttributeValidator.new('String', ["metaads", "linkedinads", "pinterestads", "tiktokads", "xads"])
|
|
114
|
+
return false unless ads_platform_validator.valid?(@ads_platform)
|
|
115
|
+
true
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
119
|
+
# @param [Object] ads_platform Object to be assigned
|
|
120
|
+
def ads_platform=(ads_platform)
|
|
121
|
+
validator = EnumAttributeValidator.new('String', ["metaads", "linkedinads", "pinterestads", "tiktokads", "xads"])
|
|
122
|
+
unless validator.valid?(ads_platform)
|
|
123
|
+
fail ArgumentError, "invalid value for \"ads_platform\", must be one of #{validator.allowable_values}."
|
|
124
|
+
end
|
|
125
|
+
@ads_platform = ads_platform
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# Checks equality by comparing each attribute.
|
|
129
|
+
# @param [Object] Object to be compared
|
|
130
|
+
def ==(o)
|
|
131
|
+
return true if self.equal?(o)
|
|
132
|
+
self.class == o.class &&
|
|
133
|
+
ads_platform == o.ads_platform
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
# @see the `==` method
|
|
137
|
+
# @param [Object] Object to be compared
|
|
138
|
+
def eql?(o)
|
|
139
|
+
self == o
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
# Calculates hash code according to all attributes.
|
|
143
|
+
# @return [Integer] Hash code
|
|
144
|
+
def hash
|
|
145
|
+
[ads_platform].hash
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
# Builds the object from hash
|
|
149
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
150
|
+
# @return [Object] Returns the model itself
|
|
151
|
+
def self.build_from_hash(attributes)
|
|
152
|
+
return nil unless attributes.is_a?(Hash)
|
|
153
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
154
|
+
transformed_hash = {}
|
|
155
|
+
openapi_types.each_pair do |key, type|
|
|
156
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
157
|
+
transformed_hash["#{key}"] = nil
|
|
158
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
159
|
+
# check to ensure the input is an array given that the attribute
|
|
160
|
+
# is documented as an array but the input is not
|
|
161
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
162
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
163
|
+
end
|
|
164
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
165
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
166
|
+
end
|
|
167
|
+
end
|
|
168
|
+
new(transformed_hash)
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
# Returns the object in the form of hash
|
|
172
|
+
# @return [Hash] Returns the object in the form of hash
|
|
173
|
+
def to_hash
|
|
174
|
+
hash = {}
|
|
175
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
176
|
+
value = self.send(attr)
|
|
177
|
+
if value.nil?
|
|
178
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
179
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
hash[param] = _to_hash(value)
|
|
183
|
+
end
|
|
184
|
+
hash
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
end
|
|
@@ -207,7 +207,7 @@ module Late
|
|
|
207
207
|
# @return true if the model is valid
|
|
208
208
|
def valid?
|
|
209
209
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
210
|
-
event_validator = EnumAttributeValidator.new('String', ["post.scheduled", "post.published", "post.failed", "post.partial", "post.cancelled", "post.recycled", "account.connected", "account.disconnected", "message.received", "comment.received", "webhook.test"])
|
|
210
|
+
event_validator = EnumAttributeValidator.new('String', ["post.scheduled", "post.published", "post.failed", "post.partial", "post.cancelled", "post.recycled", "account.connected", "account.disconnected", "message.received", "message.sent", "comment.received", "webhook.test"])
|
|
211
211
|
return false unless event_validator.valid?(@event)
|
|
212
212
|
status_validator = EnumAttributeValidator.new('String', ["success", "failed"])
|
|
213
213
|
return false unless status_validator.valid?(@status)
|
|
@@ -217,7 +217,7 @@ module Late
|
|
|
217
217
|
# Custom attribute writer method checking allowed values (enum).
|
|
218
218
|
# @param [Object] event Object to be assigned
|
|
219
219
|
def event=(event)
|
|
220
|
-
validator = EnumAttributeValidator.new('String', ["post.scheduled", "post.published", "post.failed", "post.partial", "post.cancelled", "post.recycled", "account.connected", "account.disconnected", "message.received", "comment.received", "webhook.test"])
|
|
220
|
+
validator = EnumAttributeValidator.new('String', ["post.scheduled", "post.published", "post.failed", "post.partial", "post.cancelled", "post.recycled", "account.connected", "account.disconnected", "message.received", "message.sent", "comment.received", "webhook.test"])
|
|
221
221
|
unless validator.valid?(event)
|
|
222
222
|
fail ArgumentError, "invalid value for \"event\", must be one of #{validator.allowable_values}."
|
|
223
223
|
end
|