late-sdk 0.0.657 → 0.0.659
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 +16 -0
- data/docs/AdAccountsApi.md +364 -0
- data/docs/AdCampaignsApi.md +3 -3
- data/docs/AdDailyMetrics.md +1 -1
- data/docs/AdMetrics.md +1 -1
- data/docs/CreateStandaloneAdRequest.md +4 -0
- data/docs/CreateValueRuleSet201Response.md +20 -0
- data/docs/CreateValueRuleSetRequest.md +24 -0
- data/docs/DeleteValueRuleSet200Response.md +20 -0
- data/docs/GetCampaignAnalytics200ResponseAnalyticsDailyInner.md +1 -1
- data/docs/GetValueRuleSet200Response.md +18 -0
- data/docs/ListValueRuleSets200Response.md +22 -0
- data/docs/ListValueRuleSets200ResponsePaging.md +18 -0
- data/docs/UpdateAdSetRequest.md +4 -0
- data/docs/UpdateValueRuleSet200Response.md +24 -0
- data/docs/UpdateValueRuleSetRequest.md +22 -0
- data/docs/ValueRule.md +28 -0
- data/docs/ValueRuleCriterion.md +26 -0
- data/docs/ValueRuleSet.md +22 -0
- data/lib/zernio-sdk/api/ad_accounts_api.rb +367 -0
- data/lib/zernio-sdk/api/ad_campaigns_api.rb +4 -4
- data/lib/zernio-sdk/models/ad_daily_metrics.rb +2 -2
- data/lib/zernio-sdk/models/ad_metrics.rb +1 -1
- data/lib/zernio-sdk/models/create_standalone_ad_request.rb +42 -1
- data/lib/zernio-sdk/models/create_value_rule_set201_response.rb +158 -0
- data/lib/zernio-sdk/models/create_value_rule_set_request.rb +283 -0
- data/lib/zernio-sdk/models/delete_value_rule_set200_response.rb +156 -0
- data/lib/zernio-sdk/models/get_campaign_analytics200_response_analytics_daily_inner.rb +1 -1
- data/lib/zernio-sdk/models/get_value_rule_set200_response.rb +147 -0
- data/lib/zernio-sdk/models/list_value_rule_sets200_response.rb +167 -0
- data/lib/zernio-sdk/models/list_value_rule_sets200_response_paging.rb +149 -0
- data/lib/zernio-sdk/models/update_ad_set_request.rb +42 -1
- data/lib/zernio-sdk/models/update_value_rule_set200_response.rb +176 -0
- data/lib/zernio-sdk/models/update_value_rule_set_request.rb +257 -0
- data/lib/zernio-sdk/models/value_rule.rb +346 -0
- data/lib/zernio-sdk/models/value_rule_criterion.rb +305 -0
- data/lib/zernio-sdk/models/value_rule_set.rb +221 -0
- data/lib/zernio-sdk/version.rb +1 -1
- data/lib/zernio-sdk.rb +11 -0
- data/openapi.yaml +400 -8
- data/spec/api/ad_accounts_api_spec.rb +66 -0
- data/spec/api/ad_campaigns_api_spec.rb +2 -2
- data/spec/models/create_standalone_ad_request_spec.rb +12 -0
- data/spec/models/create_value_rule_set201_response_spec.rb +42 -0
- data/spec/models/create_value_rule_set_request_spec.rb +54 -0
- data/spec/models/delete_value_rule_set200_response_spec.rb +42 -0
- data/spec/models/get_value_rule_set200_response_spec.rb +36 -0
- data/spec/models/list_value_rule_sets200_response_paging_spec.rb +36 -0
- data/spec/models/list_value_rule_sets200_response_spec.rb +48 -0
- data/spec/models/update_ad_set_request_spec.rb +12 -0
- data/spec/models/update_value_rule_set200_response_spec.rb +54 -0
- data/spec/models/update_value_rule_set_request_spec.rb +48 -0
- data/spec/models/value_rule_criterion_spec.rb +68 -0
- data/spec/models/value_rule_set_spec.rb +48 -0
- data/spec/models/value_rule_spec.rb +70 -0
- data/zernio-sdk-0.0.659.gem +0 -0
- metadata +47 -3
- data/zernio-sdk-0.0.657.gem +0 -0
|
@@ -833,7 +833,7 @@ module Zernio
|
|
|
833
833
|
# @option opts [Date] :from_date Start of the METRICS date range (YYYY-MM-DD). Affects only the spend/impression numbers overlaid on each node, NOT which campaigns are returned. Defaults to 90 days ago.
|
|
834
834
|
# @option opts [Date] :to_date End of metrics date range (YYYY-MM-DD). Defaults to today. Max 730-day range.
|
|
835
835
|
# @option opts [String] :sort Campaign-level sort order. `newest` (default) / `oldest` order by the campaign's newest-ad createdAt. `spend_desc` / `spend_asc` order by aggregated spend in the requested date range; campaigns with no spend land at the end. (default to 'newest')
|
|
836
|
-
# @option opts [Integer] :time_increment Set to `1` to also return a daily breakdown. Mirrors Meta Insights' `time_increment=1`: each node gains a `daily[]` array of per-day metrics (same fields as the aggregated `metrics`) alongside the range total, so you get per-entity daily trends in ONE call instead of calling the tree once per day. Only `1` (daily) is supported. The daily series covers the same date range and uses the same source data as `metrics`, except
|
|
836
|
+
# @option opts [Integer] :time_increment Set to `1` to also return a daily breakdown. Mirrors Meta Insights' `time_increment=1`: each node gains a `daily[]` array of per-day metrics (same fields as the aggregated `metrics`) alongside the range total, so you get per-entity daily trends in ONE call instead of calling the tree once per day. Only `1` (daily) is supported. The daily series covers the same date range and uses the same source data as `metrics`, except `reach` on Meta and TikTok: the range total is the platform's de-duplicated value, so daily reach does not sum to it. See `dailyLevel` to control which levels carry it.
|
|
837
837
|
# @option opts [String] :daily_level Which tree levels get the `daily[]` series when `timeIncrement=1`. `campaign` (default) attaches it on campaign nodes only — the common per-campaign-trend case, and the smallest payload. `adset` adds it on ad sets too; `ad` adds it on every ad in `ads[]` as well (heaviest — a long range × up to 100 ads per ad set). Scope with `campaignId` to keep `ad`-level responses small. Ignored when `timeIncrement` is unset. (default to 'campaign')
|
|
838
838
|
# @return [GetAdTree200Response]
|
|
839
839
|
def get_ad_tree(opts = {})
|
|
@@ -857,7 +857,7 @@ module Zernio
|
|
|
857
857
|
# @option opts [Date] :from_date Start of the METRICS date range (YYYY-MM-DD). Affects only the spend/impression numbers overlaid on each node, NOT which campaigns are returned. Defaults to 90 days ago.
|
|
858
858
|
# @option opts [Date] :to_date End of metrics date range (YYYY-MM-DD). Defaults to today. Max 730-day range.
|
|
859
859
|
# @option opts [String] :sort Campaign-level sort order. `newest` (default) / `oldest` order by the campaign's newest-ad createdAt. `spend_desc` / `spend_asc` order by aggregated spend in the requested date range; campaigns with no spend land at the end. (default to 'newest')
|
|
860
|
-
# @option opts [Integer] :time_increment Set to `1` to also return a daily breakdown. Mirrors Meta Insights' `time_increment=1`: each node gains a `daily[]` array of per-day metrics (same fields as the aggregated `metrics`) alongside the range total, so you get per-entity daily trends in ONE call instead of calling the tree once per day. Only `1` (daily) is supported. The daily series covers the same date range and uses the same source data as `metrics`, except
|
|
860
|
+
# @option opts [Integer] :time_increment Set to `1` to also return a daily breakdown. Mirrors Meta Insights' `time_increment=1`: each node gains a `daily[]` array of per-day metrics (same fields as the aggregated `metrics`) alongside the range total, so you get per-entity daily trends in ONE call instead of calling the tree once per day. Only `1` (daily) is supported. The daily series covers the same date range and uses the same source data as `metrics`, except `reach` on Meta and TikTok: the range total is the platform's de-duplicated value, so daily reach does not sum to it. See `dailyLevel` to control which levels carry it.
|
|
861
861
|
# @option opts [String] :daily_level Which tree levels get the `daily[]` series when `timeIncrement=1`. `campaign` (default) attaches it on campaign nodes only — the common per-campaign-trend case, and the smallest payload. `adset` adds it on ad sets too; `ad` adds it on every ad in `ads[]` as well (heaviest — a long range × up to 100 ads per ad set). Scope with `campaignId` to keep `ad`-level responses small. Ignored when `timeIncrement` is unset. (default to 'campaign')
|
|
862
862
|
# @return [Array<(GetAdTree200Response, Integer, Hash)>] GetAdTree200Response data, response status code and response headers
|
|
863
863
|
def get_ad_tree_with_http_info(opts = {})
|
|
@@ -1603,7 +1603,7 @@ module Zernio
|
|
|
1603
1603
|
end
|
|
1604
1604
|
|
|
1605
1605
|
# Update an ad set
|
|
1606
|
-
# Ad-set-level writes. Use this for ABO budget updates, ad-set-scoped pause/resume, bid-strategy edits, and Meta-only post-launch delivery settings via `platformSpecificData`. At least one updatable field is required. Bid strategy compatibility (per Meta's spec): - `LOWEST_COST_WITHOUT_CAP`: no `bidAmount`, no `roasAverageFloor`. - `LOWEST_COST_WITH_BID_CAP` / `COST_CAP`: `bidAmount` REQUIRED (whole currency units). - `LOWEST_COST_WITH_MIN_ROAS`: `roasAverageFloor` REQUIRED (decimal multiplier, e.g. 2.0 = 2.0x ROAS). Delivery settings are validated by Meta against the campaign objective; incompatible combinations (e.g. a billingEvent the optimization goal doesn't allow) surface as 400s from Meta. When updating `budget` on an ABO campaign: if the parent campaign is CBO, the response is 409 with code BUDGET_LEVEL_MISMATCH — route to PUT /v1/ads/campaigns/{campaignId} instead.
|
|
1606
|
+
# Ad-set-level writes. Use this for ABO budget updates, ad-set-scoped pause/resume, bid-strategy edits, Meta value-rule-set attach/detach, and Meta-only post-launch delivery settings via `platformSpecificData`. At least one updatable field is required. Value rule sets (Meta only, see `/v1/ads/value-rule-sets`): - ATTACH or REPLACE: send `valueRuleSetId`. Attachment is driven by the id's presence, so `valueRulesApplied: true` is optional. Sending a different id replaces the previous association; there is no separate replace call. - DETACH: send `valueRulesApplied: false` and OMIT `valueRuleSetId`. - Sending `valueRulesApplied: false` TOGETHER with `valueRuleSetId` returns 400 `mutually_exclusive_fields`. This is deliberate: Meta attaches the rule set whenever `value_rule_set_id` is present, even with `value_rules_applied` false, so echoing stored state while asking to detach would silently keep the bid adjustments live. - Eligibility: only ad sets on `LOWEST_COST_WITHOUT_CAP` or `COST_CAP`. Meta rejects the rest server-side. - Read back with `GET /v1/ads/ad-sets/{adSetId}?fields=value_rule_set_id`. Meta does not document `value_rules_applied` as a readable ad-set field, so the boolean cannot be read back. Bid strategy compatibility (per Meta's spec): - `LOWEST_COST_WITHOUT_CAP`: no `bidAmount`, no `roasAverageFloor`. - `LOWEST_COST_WITH_BID_CAP` / `COST_CAP`: `bidAmount` REQUIRED (whole currency units). - `LOWEST_COST_WITH_MIN_ROAS`: `roasAverageFloor` REQUIRED (decimal multiplier, e.g. 2.0 = 2.0x ROAS). Delivery settings are validated by Meta against the campaign objective; incompatible combinations (e.g. a billingEvent the optimization goal doesn't allow) surface as 400s from Meta. When updating `budget` on an ABO campaign: if the parent campaign is CBO, the response is 409 with code BUDGET_LEVEL_MISMATCH — route to PUT /v1/ads/campaigns/{campaignId} instead.
|
|
1607
1607
|
# @param ad_set_id [String] Platform ad set ID
|
|
1608
1608
|
# @param update_ad_set_request [UpdateAdSetRequest]
|
|
1609
1609
|
# @param [Hash] opts the optional parameters
|
|
@@ -1614,7 +1614,7 @@ module Zernio
|
|
|
1614
1614
|
end
|
|
1615
1615
|
|
|
1616
1616
|
# Update an ad set
|
|
1617
|
-
# Ad-set-level writes. Use this for ABO budget updates, ad-set-scoped pause/resume, bid-strategy edits, and Meta-only post-launch delivery settings via `platformSpecificData`. At least one updatable field is required. Bid strategy compatibility (per Meta's spec): - `LOWEST_COST_WITHOUT_CAP`: no `bidAmount`, no `roasAverageFloor`. - `LOWEST_COST_WITH_BID_CAP` / `COST_CAP`: `bidAmount` REQUIRED (whole currency units). - `LOWEST_COST_WITH_MIN_ROAS`: `roasAverageFloor` REQUIRED (decimal multiplier, e.g. 2.0 = 2.0x ROAS). Delivery settings are validated by Meta against the campaign objective; incompatible combinations (e.g. a billingEvent the optimization goal doesn't allow) surface as 400s from Meta. When updating `budget` on an ABO campaign: if the parent campaign is CBO, the response is 409 with code BUDGET_LEVEL_MISMATCH — route to PUT /v1/ads/campaigns/{campaignId} instead.
|
|
1617
|
+
# Ad-set-level writes. Use this for ABO budget updates, ad-set-scoped pause/resume, bid-strategy edits, Meta value-rule-set attach/detach, and Meta-only post-launch delivery settings via `platformSpecificData`. At least one updatable field is required. Value rule sets (Meta only, see `/v1/ads/value-rule-sets`): - ATTACH or REPLACE: send `valueRuleSetId`. Attachment is driven by the id's presence, so `valueRulesApplied: true` is optional. Sending a different id replaces the previous association; there is no separate replace call. - DETACH: send `valueRulesApplied: false` and OMIT `valueRuleSetId`. - Sending `valueRulesApplied: false` TOGETHER with `valueRuleSetId` returns 400 `mutually_exclusive_fields`. This is deliberate: Meta attaches the rule set whenever `value_rule_set_id` is present, even with `value_rules_applied` false, so echoing stored state while asking to detach would silently keep the bid adjustments live. - Eligibility: only ad sets on `LOWEST_COST_WITHOUT_CAP` or `COST_CAP`. Meta rejects the rest server-side. - Read back with `GET /v1/ads/ad-sets/{adSetId}?fields=value_rule_set_id`. Meta does not document `value_rules_applied` as a readable ad-set field, so the boolean cannot be read back. Bid strategy compatibility (per Meta's spec): - `LOWEST_COST_WITHOUT_CAP`: no `bidAmount`, no `roasAverageFloor`. - `LOWEST_COST_WITH_BID_CAP` / `COST_CAP`: `bidAmount` REQUIRED (whole currency units). - `LOWEST_COST_WITH_MIN_ROAS`: `roasAverageFloor` REQUIRED (decimal multiplier, e.g. 2.0 = 2.0x ROAS). Delivery settings are validated by Meta against the campaign objective; incompatible combinations (e.g. a billingEvent the optimization goal doesn't allow) surface as 400s from Meta. When updating `budget` on an ABO campaign: if the parent campaign is CBO, the response is 409 with code BUDGET_LEVEL_MISMATCH — route to PUT /v1/ads/campaigns/{campaignId} instead.
|
|
1618
1618
|
# @param ad_set_id [String] Platform ad set ID
|
|
1619
1619
|
# @param update_ad_set_request [UpdateAdSetRequest]
|
|
1620
1620
|
# @param [Hash] opts the optional parameters
|
|
@@ -14,13 +14,13 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Zernio
|
|
17
|
-
# One day of metrics. Same fields as `AdMetrics` plus the `date` they apply to. Returned inside a node's `daily[]` when `GET /v1/ads/tree` is called with `timeIncrement=1`. Rate metrics (ctr/cpc/cpm/costPerConversion/ roas/videoAvgTimeWatchedActions) are recomputed per day from that day's sums, so summing the additive fields across a node's `daily[]` reproduces its aggregated `metrics` total. `reach` is the exception: on Meta the aggregated total is de-duplicated across the range, so daily reach does not sum to it. Do NOT sum or plain-average `videoAvgTimeWatchedActions` across days: the range value is the play-weighted average of the daily values.
|
|
17
|
+
# One day of metrics. Same fields as `AdMetrics` plus the `date` they apply to. Returned inside a node's `daily[]` when `GET /v1/ads/tree` is called with `timeIncrement=1`. Rate metrics (ctr/cpc/cpm/costPerConversion/ roas/videoAvgTimeWatchedActions) are recomputed per day from that day's sums, so summing the additive fields across a node's `daily[]` reproduces its aggregated `metrics` total. `reach` is the exception: on Meta and TikTok the aggregated total is de-duplicated across the range, so daily reach does not sum to it. Do NOT sum or plain-average `videoAvgTimeWatchedActions` across days: the range value is the play-weighted average of the daily values.
|
|
18
18
|
class AdDailyMetrics < ApiModelBase
|
|
19
19
|
attr_accessor :spend
|
|
20
20
|
|
|
21
21
|
attr_accessor :impressions
|
|
22
22
|
|
|
23
|
-
# Unique people reached in the requested date range. Meta (facebook/instagram):
|
|
23
|
+
# Unique people reached in the requested date range. Meta (facebook/instagram) and TikTok: the platform's own de-duplicated reach for the exact range, fetched live and cached up to ~1 hour (may lag recent delivery; on a transient platform error the value temporarily falls back to a sum of per-day reach, which overcounts people reached on multiple days or by multiple child ads). Because it is de-duplicated, reach is NOT additive on these platforms: neither daily values nor child nodes sum to the range total. Google, LinkedIn, X, Pinterest and OpenAI report 0 (reach not synced). Frequency (impressions / reach) is only meaningful for Meta and TikTok.
|
|
24
24
|
attr_accessor :reach
|
|
25
25
|
|
|
26
26
|
attr_accessor :clicks
|
|
@@ -19,7 +19,7 @@ module Zernio
|
|
|
19
19
|
|
|
20
20
|
attr_accessor :impressions
|
|
21
21
|
|
|
22
|
-
# Unique people reached in the requested date range. Meta (facebook/instagram):
|
|
22
|
+
# Unique people reached in the requested date range. Meta (facebook/instagram) and TikTok: the platform's own de-duplicated reach for the exact range, fetched live and cached up to ~1 hour (may lag recent delivery; on a transient platform error the value temporarily falls back to a sum of per-day reach, which overcounts people reached on multiple days or by multiple child ads). Because it is de-duplicated, reach is NOT additive on these platforms: neither daily values nor child nodes sum to the range total. Google, LinkedIn, X, Pinterest and OpenAI report 0 (reach not synced). Frequency (impressions / reach) is only meaningful for Meta and TikTok.
|
|
23
23
|
attr_accessor :reach
|
|
24
24
|
|
|
25
25
|
attr_accessor :clicks
|
|
@@ -222,6 +222,12 @@ module Zernio
|
|
|
222
222
|
# Minimum ROAS as a decimal multiplier (e.g. 2.0 = 2.0x ROAS). Required when `bidStrategy` is `LOWEST_COST_WITH_MIN_ROAS`. Sent to Meta as `bid_constraints.roas_average_floor` × 10000.
|
|
223
223
|
attr_accessor :roas_average_floor
|
|
224
224
|
|
|
225
|
+
# Meta only (facebook, instagram; other platforms return 400). Value rule set to attach to the new ad set, from `/v1/ads/value-rule-sets`. Attachment is driven by this id, so `valueRulesApplied` is optional alongside it. Rejected with 400 in `adSetId` attach mode: that shape inherits the existing ad set's attachment, so the field would be silently ignored. Use `PUT /v1/ads/ad-sets/{adSetId}` there instead. Ignored (stripped before the ad-set create) when `buyingType` is `RESERVED`: value rules only apply to auction ad sets on `LOWEST_COST_WITHOUT_CAP` or `COST_CAP`, and a Reach & Frequency reservation has no auction bid strategy. Read back with `GET /v1/ads/ad-sets/{adSetId}?fields=value_rule_set_id`; the attachment is not mirrored onto Zernio's ad documents.
|
|
226
|
+
attr_accessor :value_rule_set_id
|
|
227
|
+
|
|
228
|
+
# Meta only (facebook, instagram; other platforms return 400). Optional when attaching, and requires `valueRuleSetId`. `false` is REJECTED here with 400: a newly created ad set has nothing to detach, so detaching lives on `PUT /v1/ads/ad-sets/{adSetId}`.
|
|
229
|
+
attr_accessor :value_rules_applied
|
|
230
|
+
|
|
225
231
|
attr_accessor :platform_specific_data
|
|
226
232
|
|
|
227
233
|
# Legal entity that benefits from the ad. Required when targeting EU users (EU DSA, Article 26). Optional if the ad account has a default beneficiary: set it once via `PATCH /v1/ads/accounts` or in Meta Ads Manager, and Meta fills it in whenever the field is omitted.
|
|
@@ -335,6 +341,8 @@ module Zernio
|
|
|
335
341
|
:'bid_strategy' => :'bidStrategy',
|
|
336
342
|
:'bid_amount' => :'bidAmount',
|
|
337
343
|
:'roas_average_floor' => :'roasAverageFloor',
|
|
344
|
+
:'value_rule_set_id' => :'valueRuleSetId',
|
|
345
|
+
:'value_rules_applied' => :'valueRulesApplied',
|
|
338
346
|
:'platform_specific_data' => :'platformSpecificData',
|
|
339
347
|
:'dsa_beneficiary' => :'dsaBeneficiary',
|
|
340
348
|
:'dsa_payor' => :'dsaPayor',
|
|
@@ -430,6 +438,8 @@ module Zernio
|
|
|
430
438
|
:'bid_strategy' => :'BidStrategy',
|
|
431
439
|
:'bid_amount' => :'Float',
|
|
432
440
|
:'roas_average_floor' => :'Float',
|
|
441
|
+
:'value_rule_set_id' => :'String',
|
|
442
|
+
:'value_rules_applied' => :'Boolean',
|
|
433
443
|
:'platform_specific_data' => :'LinkedInAdsPlatformData',
|
|
434
444
|
:'dsa_beneficiary' => :'String',
|
|
435
445
|
:'dsa_payor' => :'String',
|
|
@@ -805,6 +815,14 @@ module Zernio
|
|
|
805
815
|
self.roas_average_floor = attributes[:'roas_average_floor']
|
|
806
816
|
end
|
|
807
817
|
|
|
818
|
+
if attributes.key?(:'value_rule_set_id')
|
|
819
|
+
self.value_rule_set_id = attributes[:'value_rule_set_id']
|
|
820
|
+
end
|
|
821
|
+
|
|
822
|
+
if attributes.key?(:'value_rules_applied')
|
|
823
|
+
self.value_rules_applied = attributes[:'value_rules_applied']
|
|
824
|
+
end
|
|
825
|
+
|
|
808
826
|
if attributes.key?(:'platform_specific_data')
|
|
809
827
|
self.platform_specific_data = attributes[:'platform_specific_data']
|
|
810
828
|
end
|
|
@@ -919,6 +937,11 @@ module Zernio
|
|
|
919
937
|
invalid_properties.push('invalid value for "attribution_spec", number of items must be greater than or equal to 1.')
|
|
920
938
|
end
|
|
921
939
|
|
|
940
|
+
pattern = Regexp.new(/^\d+$/)
|
|
941
|
+
if !@value_rule_set_id.nil? && @value_rule_set_id !~ pattern
|
|
942
|
+
invalid_properties.push("invalid value for \"value_rule_set_id\", must conform to the pattern #{pattern}.")
|
|
943
|
+
end
|
|
944
|
+
|
|
922
945
|
if !@dsa_beneficiary.nil? && @dsa_beneficiary.to_s.length > 100
|
|
923
946
|
invalid_properties.push('invalid value for "dsa_beneficiary", the character length must be smaller than or equal to 100.')
|
|
924
947
|
end
|
|
@@ -975,6 +998,7 @@ module Zernio
|
|
|
975
998
|
return false if !@attribution_spec.nil? && @attribution_spec.length < 1
|
|
976
999
|
gender_validator = EnumAttributeValidator.new('String', ["all", "male", "female"])
|
|
977
1000
|
return false unless gender_validator.valid?(@gender)
|
|
1001
|
+
return false if !@value_rule_set_id.nil? && @value_rule_set_id !~ Regexp.new(/^\d+$/)
|
|
978
1002
|
return false if !@dsa_beneficiary.nil? && @dsa_beneficiary.to_s.length > 100
|
|
979
1003
|
return false if !@dsa_payor.nil? && @dsa_payor.to_s.length > 100
|
|
980
1004
|
identity_type_validator = EnumAttributeValidator.new('String', ["TT_USER", "CUSTOMIZED_USER"])
|
|
@@ -1304,6 +1328,21 @@ module Zernio
|
|
|
1304
1328
|
@gender = gender
|
|
1305
1329
|
end
|
|
1306
1330
|
|
|
1331
|
+
# Custom attribute writer method with validation
|
|
1332
|
+
# @param [Object] value_rule_set_id Value to be assigned
|
|
1333
|
+
def value_rule_set_id=(value_rule_set_id)
|
|
1334
|
+
if value_rule_set_id.nil?
|
|
1335
|
+
fail ArgumentError, 'value_rule_set_id cannot be nil'
|
|
1336
|
+
end
|
|
1337
|
+
|
|
1338
|
+
pattern = Regexp.new(/^\d+$/)
|
|
1339
|
+
if value_rule_set_id !~ pattern
|
|
1340
|
+
fail ArgumentError, "invalid value for \"value_rule_set_id\", must conform to the pattern #{pattern}."
|
|
1341
|
+
end
|
|
1342
|
+
|
|
1343
|
+
@value_rule_set_id = value_rule_set_id
|
|
1344
|
+
end
|
|
1345
|
+
|
|
1307
1346
|
# Custom attribute writer method with validation
|
|
1308
1347
|
# @param [Object] dsa_beneficiary Value to be assigned
|
|
1309
1348
|
def dsa_beneficiary=(dsa_beneficiary)
|
|
@@ -1420,6 +1459,8 @@ module Zernio
|
|
|
1420
1459
|
bid_strategy == o.bid_strategy &&
|
|
1421
1460
|
bid_amount == o.bid_amount &&
|
|
1422
1461
|
roas_average_floor == o.roas_average_floor &&
|
|
1462
|
+
value_rule_set_id == o.value_rule_set_id &&
|
|
1463
|
+
value_rules_applied == o.value_rules_applied &&
|
|
1423
1464
|
platform_specific_data == o.platform_specific_data &&
|
|
1424
1465
|
dsa_beneficiary == o.dsa_beneficiary &&
|
|
1425
1466
|
dsa_payor == o.dsa_payor &&
|
|
@@ -1437,7 +1478,7 @@ module Zernio
|
|
|
1437
1478
|
# Calculates hash code according to all attributes.
|
|
1438
1479
|
# @return [Integer] Hash code
|
|
1439
1480
|
def hash
|
|
1440
|
-
[account_id, ad_account_id, name, campaign_name, ad_set_name, ad_name, tracking, goal, optimization_goal, billing_event, buying_type, rf_prediction_id, creative_features, validate_only, budget_amount, budget_type, status, budget_level, currency, headline, long_headline, body, description, call_to_action, link_url, lead_gen_form_id, image_url, images, video, creatives, ad_set_id, existing_campaign_id, existing_creative_id, business_name, board_id, organization_id, targeting, countries, cities, regions, age_min, age_max, interests, zips, metros, custom_locations, behaviors, income_tier, languages, placements, saved_targeting_id, raw_targeting, special_ad_categories, special_ad_category_country, end_date, start_date, instagram_account_id, dynamic_creative, carousel_cards, default_locale, translations, placement_assets, audience_id, campaign_type, keywords, additional_headlines, additional_descriptions, advantage_audience, attribution_spec, gender, bid_strategy, bid_amount, roas_average_floor, platform_specific_data, dsa_beneficiary, dsa_payor, brand_identity, identity_type, promoted_object].hash
|
|
1481
|
+
[account_id, ad_account_id, name, campaign_name, ad_set_name, ad_name, tracking, goal, optimization_goal, billing_event, buying_type, rf_prediction_id, creative_features, validate_only, budget_amount, budget_type, status, budget_level, currency, headline, long_headline, body, description, call_to_action, link_url, lead_gen_form_id, image_url, images, video, creatives, ad_set_id, existing_campaign_id, existing_creative_id, business_name, board_id, organization_id, targeting, countries, cities, regions, age_min, age_max, interests, zips, metros, custom_locations, behaviors, income_tier, languages, placements, saved_targeting_id, raw_targeting, special_ad_categories, special_ad_category_country, end_date, start_date, instagram_account_id, dynamic_creative, carousel_cards, default_locale, translations, placement_assets, audience_id, campaign_type, keywords, additional_headlines, additional_descriptions, advantage_audience, attribution_spec, gender, bid_strategy, bid_amount, roas_average_floor, value_rule_set_id, value_rules_applied, platform_specific_data, dsa_beneficiary, dsa_payor, brand_identity, identity_type, promoted_object].hash
|
|
1441
1482
|
end
|
|
1442
1483
|
|
|
1443
1484
|
# Builds the object from hash
|
|
@@ -0,0 +1,158 @@
|
|
|
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.4
|
|
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 Zernio
|
|
17
|
+
class CreateValueRuleSet201Response < ApiModelBase
|
|
18
|
+
attr_accessor :ad_account_id
|
|
19
|
+
|
|
20
|
+
# The new rule set id. Meta does not document the create response body, so this is null on the (unobserved) case where it omits the id.
|
|
21
|
+
attr_accessor :value_rule_set_id
|
|
22
|
+
|
|
23
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
24
|
+
def self.attribute_map
|
|
25
|
+
{
|
|
26
|
+
:'ad_account_id' => :'adAccountId',
|
|
27
|
+
:'value_rule_set_id' => :'valueRuleSetId'
|
|
28
|
+
}
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Returns attribute mapping this model knows about
|
|
32
|
+
def self.acceptable_attribute_map
|
|
33
|
+
attribute_map
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Returns all the JSON keys this model knows about
|
|
37
|
+
def self.acceptable_attributes
|
|
38
|
+
acceptable_attribute_map.values
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Attribute type mapping.
|
|
42
|
+
def self.openapi_types
|
|
43
|
+
{
|
|
44
|
+
:'ad_account_id' => :'String',
|
|
45
|
+
:'value_rule_set_id' => :'String'
|
|
46
|
+
}
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# List of attributes with nullable: true
|
|
50
|
+
def self.openapi_nullable
|
|
51
|
+
Set.new([
|
|
52
|
+
:'value_rule_set_id'
|
|
53
|
+
])
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Initializes the object
|
|
57
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
58
|
+
def initialize(attributes = {})
|
|
59
|
+
if (!attributes.is_a?(Hash))
|
|
60
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::CreateValueRuleSet201Response` initialize method"
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
64
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
65
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
66
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
67
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::CreateValueRuleSet201Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
68
|
+
end
|
|
69
|
+
h[k.to_sym] = v
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if attributes.key?(:'ad_account_id')
|
|
73
|
+
self.ad_account_id = attributes[:'ad_account_id']
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
if attributes.key?(:'value_rule_set_id')
|
|
77
|
+
self.value_rule_set_id = attributes[:'value_rule_set_id']
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
82
|
+
# @return Array for valid properties with the reasons
|
|
83
|
+
def list_invalid_properties
|
|
84
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
85
|
+
invalid_properties = Array.new
|
|
86
|
+
invalid_properties
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# Check to see if the all the properties in the model are valid
|
|
90
|
+
# @return true if the model is valid
|
|
91
|
+
def valid?
|
|
92
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
93
|
+
true
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# Checks equality by comparing each attribute.
|
|
97
|
+
# @param [Object] Object to be compared
|
|
98
|
+
def ==(o)
|
|
99
|
+
return true if self.equal?(o)
|
|
100
|
+
self.class == o.class &&
|
|
101
|
+
ad_account_id == o.ad_account_id &&
|
|
102
|
+
value_rule_set_id == o.value_rule_set_id
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# @see the `==` method
|
|
106
|
+
# @param [Object] Object to be compared
|
|
107
|
+
def eql?(o)
|
|
108
|
+
self == o
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# Calculates hash code according to all attributes.
|
|
112
|
+
# @return [Integer] Hash code
|
|
113
|
+
def hash
|
|
114
|
+
[ad_account_id, value_rule_set_id].hash
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Builds the object from hash
|
|
118
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
119
|
+
# @return [Object] Returns the model itself
|
|
120
|
+
def self.build_from_hash(attributes)
|
|
121
|
+
return nil unless attributes.is_a?(Hash)
|
|
122
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
123
|
+
transformed_hash = {}
|
|
124
|
+
openapi_types.each_pair do |key, type|
|
|
125
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
126
|
+
transformed_hash["#{key}"] = nil
|
|
127
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
128
|
+
# check to ensure the input is an array given that the attribute
|
|
129
|
+
# is documented as an array but the input is not
|
|
130
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
131
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
132
|
+
end
|
|
133
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
134
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
135
|
+
end
|
|
136
|
+
end
|
|
137
|
+
new(transformed_hash)
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
# Returns the object in the form of hash
|
|
141
|
+
# @return [Hash] Returns the object in the form of hash
|
|
142
|
+
def to_hash
|
|
143
|
+
hash = {}
|
|
144
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
145
|
+
value = self.send(attr)
|
|
146
|
+
if value.nil?
|
|
147
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
148
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
hash[param] = _to_hash(value)
|
|
152
|
+
end
|
|
153
|
+
hash
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
end
|
|
@@ -0,0 +1,283 @@
|
|
|
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.4
|
|
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 Zernio
|
|
17
|
+
class CreateValueRuleSetRequest < ApiModelBase
|
|
18
|
+
# Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
|
|
19
|
+
attr_accessor :account_id
|
|
20
|
+
|
|
21
|
+
# Meta ad account id (act_<n>).
|
|
22
|
+
attr_accessor :ad_account_id
|
|
23
|
+
|
|
24
|
+
attr_accessor :name
|
|
25
|
+
|
|
26
|
+
# Evaluated in order; the first matching rule wins.
|
|
27
|
+
attr_accessor :rules
|
|
28
|
+
|
|
29
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
30
|
+
def self.attribute_map
|
|
31
|
+
{
|
|
32
|
+
:'account_id' => :'accountId',
|
|
33
|
+
:'ad_account_id' => :'adAccountId',
|
|
34
|
+
:'name' => :'name',
|
|
35
|
+
:'rules' => :'rules'
|
|
36
|
+
}
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Returns attribute mapping this model knows about
|
|
40
|
+
def self.acceptable_attribute_map
|
|
41
|
+
attribute_map
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# Returns all the JSON keys this model knows about
|
|
45
|
+
def self.acceptable_attributes
|
|
46
|
+
acceptable_attribute_map.values
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Attribute type mapping.
|
|
50
|
+
def self.openapi_types
|
|
51
|
+
{
|
|
52
|
+
:'account_id' => :'String',
|
|
53
|
+
:'ad_account_id' => :'String',
|
|
54
|
+
:'name' => :'String',
|
|
55
|
+
:'rules' => :'Array<ValueRule>'
|
|
56
|
+
}
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# List of attributes with nullable: true
|
|
60
|
+
def self.openapi_nullable
|
|
61
|
+
Set.new([
|
|
62
|
+
])
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Initializes the object
|
|
66
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
67
|
+
def initialize(attributes = {})
|
|
68
|
+
if (!attributes.is_a?(Hash))
|
|
69
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::CreateValueRuleSetRequest` initialize method"
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
73
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
74
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
75
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
76
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::CreateValueRuleSetRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
77
|
+
end
|
|
78
|
+
h[k.to_sym] = v
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if attributes.key?(:'account_id')
|
|
82
|
+
self.account_id = attributes[:'account_id']
|
|
83
|
+
else
|
|
84
|
+
self.account_id = nil
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
if attributes.key?(:'ad_account_id')
|
|
88
|
+
self.ad_account_id = attributes[:'ad_account_id']
|
|
89
|
+
else
|
|
90
|
+
self.ad_account_id = nil
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
if attributes.key?(:'name')
|
|
94
|
+
self.name = attributes[:'name']
|
|
95
|
+
else
|
|
96
|
+
self.name = nil
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
if attributes.key?(:'rules')
|
|
100
|
+
if (value = attributes[:'rules']).is_a?(Array)
|
|
101
|
+
self.rules = value
|
|
102
|
+
end
|
|
103
|
+
else
|
|
104
|
+
self.rules = nil
|
|
105
|
+
end
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
109
|
+
# @return Array for valid properties with the reasons
|
|
110
|
+
def list_invalid_properties
|
|
111
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
112
|
+
invalid_properties = Array.new
|
|
113
|
+
if @account_id.nil?
|
|
114
|
+
invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
if @ad_account_id.nil?
|
|
118
|
+
invalid_properties.push('invalid value for "ad_account_id", ad_account_id cannot be nil.')
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
if @name.nil?
|
|
122
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
if @name.to_s.length > 255
|
|
126
|
+
invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 255.')
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
if @name.to_s.length < 1
|
|
130
|
+
invalid_properties.push('invalid value for "name", the character length must be greater than or equal to 1.')
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
if @rules.nil?
|
|
134
|
+
invalid_properties.push('invalid value for "rules", rules cannot be nil.')
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
if @rules.length > 10
|
|
138
|
+
invalid_properties.push('invalid value for "rules", number of items must be less than or equal to 10.')
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
if @rules.length < 1
|
|
142
|
+
invalid_properties.push('invalid value for "rules", number of items must be greater than or equal to 1.')
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
invalid_properties
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
# Check to see if the all the properties in the model are valid
|
|
149
|
+
# @return true if the model is valid
|
|
150
|
+
def valid?
|
|
151
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
152
|
+
return false if @account_id.nil?
|
|
153
|
+
return false if @ad_account_id.nil?
|
|
154
|
+
return false if @name.nil?
|
|
155
|
+
return false if @name.to_s.length > 255
|
|
156
|
+
return false if @name.to_s.length < 1
|
|
157
|
+
return false if @rules.nil?
|
|
158
|
+
return false if @rules.length > 10
|
|
159
|
+
return false if @rules.length < 1
|
|
160
|
+
true
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
# Custom attribute writer method with validation
|
|
164
|
+
# @param [Object] account_id Value to be assigned
|
|
165
|
+
def account_id=(account_id)
|
|
166
|
+
if account_id.nil?
|
|
167
|
+
fail ArgumentError, 'account_id cannot be nil'
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
@account_id = account_id
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
# Custom attribute writer method with validation
|
|
174
|
+
# @param [Object] ad_account_id Value to be assigned
|
|
175
|
+
def ad_account_id=(ad_account_id)
|
|
176
|
+
if ad_account_id.nil?
|
|
177
|
+
fail ArgumentError, 'ad_account_id cannot be nil'
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
@ad_account_id = ad_account_id
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
# Custom attribute writer method with validation
|
|
184
|
+
# @param [Object] name Value to be assigned
|
|
185
|
+
def name=(name)
|
|
186
|
+
if name.nil?
|
|
187
|
+
fail ArgumentError, 'name cannot be nil'
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
if name.to_s.length > 255
|
|
191
|
+
fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 255.'
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
if name.to_s.length < 1
|
|
195
|
+
fail ArgumentError, 'invalid value for "name", the character length must be greater than or equal to 1.'
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
@name = name
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
# Custom attribute writer method with validation
|
|
202
|
+
# @param [Object] rules Value to be assigned
|
|
203
|
+
def rules=(rules)
|
|
204
|
+
if rules.nil?
|
|
205
|
+
fail ArgumentError, 'rules cannot be nil'
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
if rules.length > 10
|
|
209
|
+
fail ArgumentError, 'invalid value for "rules", number of items must be less than or equal to 10.'
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
if rules.length < 1
|
|
213
|
+
fail ArgumentError, 'invalid value for "rules", number of items must be greater than or equal to 1.'
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
@rules = rules
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
# Checks equality by comparing each attribute.
|
|
220
|
+
# @param [Object] Object to be compared
|
|
221
|
+
def ==(o)
|
|
222
|
+
return true if self.equal?(o)
|
|
223
|
+
self.class == o.class &&
|
|
224
|
+
account_id == o.account_id &&
|
|
225
|
+
ad_account_id == o.ad_account_id &&
|
|
226
|
+
name == o.name &&
|
|
227
|
+
rules == o.rules
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
# @see the `==` method
|
|
231
|
+
# @param [Object] Object to be compared
|
|
232
|
+
def eql?(o)
|
|
233
|
+
self == o
|
|
234
|
+
end
|
|
235
|
+
|
|
236
|
+
# Calculates hash code according to all attributes.
|
|
237
|
+
# @return [Integer] Hash code
|
|
238
|
+
def hash
|
|
239
|
+
[account_id, ad_account_id, name, rules].hash
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
# Builds the object from hash
|
|
243
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
244
|
+
# @return [Object] Returns the model itself
|
|
245
|
+
def self.build_from_hash(attributes)
|
|
246
|
+
return nil unless attributes.is_a?(Hash)
|
|
247
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
248
|
+
transformed_hash = {}
|
|
249
|
+
openapi_types.each_pair do |key, type|
|
|
250
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
251
|
+
transformed_hash["#{key}"] = nil
|
|
252
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
253
|
+
# check to ensure the input is an array given that the attribute
|
|
254
|
+
# is documented as an array but the input is not
|
|
255
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
256
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
257
|
+
end
|
|
258
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
259
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
260
|
+
end
|
|
261
|
+
end
|
|
262
|
+
new(transformed_hash)
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
# Returns the object in the form of hash
|
|
266
|
+
# @return [Hash] Returns the object in the form of hash
|
|
267
|
+
def to_hash
|
|
268
|
+
hash = {}
|
|
269
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
270
|
+
value = self.send(attr)
|
|
271
|
+
if value.nil?
|
|
272
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
273
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
274
|
+
end
|
|
275
|
+
|
|
276
|
+
hash[param] = _to_hash(value)
|
|
277
|
+
end
|
|
278
|
+
hash
|
|
279
|
+
end
|
|
280
|
+
|
|
281
|
+
end
|
|
282
|
+
|
|
283
|
+
end
|