Class: Zernio::UploadedOrDerivedAudience
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- Zernio::UploadedOrDerivedAudience
- Defined in:
- lib/zernio-sdk/models/uploaded_or_derived_audience.rb
Overview
customer_list, website, or lookalike audience (uploaded or derived from a source).
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#account_id ⇒ Object
Returns the value of attribute account_id.
-
#ad_account_id ⇒ Object
Platform ad account ID.
-
#companies ⇒ Object
Required for company_list audiences (LinkedIn only): plain-text company rows for account targeting.
-
#country ⇒ Object
2-letter code, required for lookalike audiences.
-
#customer_file_source ⇒ Object
Data source declaration for GDPR compliance (customer_list only).
-
#description ⇒ Object
Returns the value of attribute description.
-
#engagement_source ⇒ Object
Required for meta_engagement audiences (Meta only): what people engaged with.
-
#engagement_sources ⇒ Object
Required for engagement audiences.
-
#event ⇒ Object
meta_engagement only.
-
#lookback_days ⇒ Object
Required for engagement audiences.
-
#match_rules ⇒ Object
Required for website_retargeting audiences (LinkedIn only).
-
#name ⇒ Object
Returns the value of attribute name.
-
#pixel_id ⇒ Object
Required for website audiences.
-
#ratio ⇒ Object
Required for lookalike audiences.
-
#retention_days ⇒ Object
Required for website (max 180) and meta_engagement (max 365) audiences.
-
#rule ⇒ Object
Optional raw Meta rule, forwarded verbatim: pixel event rule for website audiences, or the engagement rule for meta_engagement (overrides the built rule, e.g. for event/canvas/lead-form sources).
-
#source_audience_id ⇒ Object
Required for lookalike audiences.
-
#source_id ⇒ Object
Required for meta_engagement: the Page / IG account / video id.
-
#source_type ⇒ Object
Required for engagement audiences (LinkedIn only): what members engaged with — a video/leadgen/single-image ad campaign, a Company Page or an Event page.
-
#trigger ⇒ Object
Required for engagement audiences.
-
#type ⇒ Object
Returns the value of attribute type.
Class Method Summary collapse
-
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about.
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ UploadedOrDerivedAudience
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Methods inherited from ApiModelBase
_deserialize, #_to_hash, #to_body, #to_s
Constructor Details
#initialize(attributes = {}) ⇒ UploadedOrDerivedAudience
Initializes the object
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 |
# File 'lib/zernio-sdk/models/uploaded_or_derived_audience.rb', line 172 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::UploadedOrDerivedAudience` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::UploadedOrDerivedAudience`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'account_id') self.account_id = attributes[:'account_id'] else self.account_id = nil end if attributes.key?(:'ad_account_id') self.ad_account_id = attributes[:'ad_account_id'] else self.ad_account_id = nil end if attributes.key?(:'name') self.name = attributes[:'name'] else self.name = nil end if attributes.key?(:'description') self.description = attributes[:'description'] end if attributes.key?(:'type') self.type = attributes[:'type'] else self.type = nil end if attributes.key?(:'match_rules') if (value = attributes[:'match_rules']).is_a?(Array) self.match_rules = value end end if attributes.key?(:'source_type') self.source_type = attributes[:'source_type'] end if attributes.key?(:'trigger') self.trigger = attributes[:'trigger'] end if attributes.key?(:'lookback_days') self.lookback_days = attributes[:'lookback_days'] end if attributes.key?(:'engagement_sources') if (value = attributes[:'engagement_sources']).is_a?(Array) self.engagement_sources = value end end if attributes.key?(:'companies') if (value = attributes[:'companies']).is_a?(Array) self.companies = value end end if attributes.key?(:'pixel_id') self.pixel_id = attributes[:'pixel_id'] end if attributes.key?(:'retention_days') self.retention_days = attributes[:'retention_days'] end if attributes.key?(:'engagement_source') self.engagement_source = attributes[:'engagement_source'] end if attributes.key?(:'source_id') self.source_id = attributes[:'source_id'] end if attributes.key?(:'event') self.event = attributes[:'event'] end if attributes.key?(:'source_audience_id') self.source_audience_id = attributes[:'source_audience_id'] end if attributes.key?(:'country') self.country = attributes[:'country'] end if attributes.key?(:'ratio') self.ratio = attributes[:'ratio'] end if attributes.key?(:'rule') self.rule = attributes[:'rule'] end if attributes.key?(:'customer_file_source') self.customer_file_source = attributes[:'customer_file_source'] end end |
Instance Attribute Details
#account_id ⇒ Object
Returns the value of attribute account_id.
19 20 21 |
# File 'lib/zernio-sdk/models/uploaded_or_derived_audience.rb', line 19 def account_id @account_id end |
#ad_account_id ⇒ Object
Platform ad account ID. Must start with act_ for Meta; bare platform id for others (Google customer id, X/TikTok/LinkedIn/Pinterest account id).
22 23 24 |
# File 'lib/zernio-sdk/models/uploaded_or_derived_audience.rb', line 22 def ad_account_id @ad_account_id end |
#companies ⇒ Object
Required for company_list audiences (LinkedIn only): plain-text company rows for account targeting. Each row needs at least one identifier. LinkedIn recommends 1,000+ companies for a usable match rate and takes up to 48h to process the list.
46 47 48 |
# File 'lib/zernio-sdk/models/uploaded_or_derived_audience.rb', line 46 def companies @companies end |
#country ⇒ Object
2-letter code, required for lookalike audiences
67 68 69 |
# File 'lib/zernio-sdk/models/uploaded_or_derived_audience.rb', line 67 def country @country end |
#customer_file_source ⇒ Object
Data source declaration for GDPR compliance (customer_list only)
76 77 78 |
# File 'lib/zernio-sdk/models/uploaded_or_derived_audience.rb', line 76 def customer_file_source @customer_file_source end |
#description ⇒ Object
Returns the value of attribute description.
26 27 28 |
# File 'lib/zernio-sdk/models/uploaded_or_derived_audience.rb', line 26 def description @description end |
#engagement_source ⇒ Object
Required for meta_engagement audiences (Meta only): what people engaged with. page = a Facebook Page, instagram = an IG professional account, video = a video. The source object must be eligible for engagement audiences or Meta rejects with subcode 1713151 ("Invalid Event Name"), surfaced verbatim.
55 56 57 |
# File 'lib/zernio-sdk/models/uploaded_or_derived_audience.rb', line 55 def engagement_source @engagement_source end |
#engagement_sources ⇒ Object
Required for engagement audiences. Campaign URNs for the ad source types, organization URNs for pages and events. LinkedIn creates one rule per source, all sharing the same trigger and lookbackDays.
43 44 45 |
# File 'lib/zernio-sdk/models/uploaded_or_derived_audience.rb', line 43 def engagement_sources @engagement_sources end |
#event ⇒ Object
meta_engagement only. The engagement event; defaults per source (page → page_engaged, instagram → ig_business_profile_all, video → video_watched). Ignored when rule is provided.
61 62 63 |
# File 'lib/zernio-sdk/models/uploaded_or_derived_audience.rb', line 61 def event @event end |
#lookback_days ⇒ Object
Required for engagement audiences. Rolling window.
40 41 42 |
# File 'lib/zernio-sdk/models/uploaded_or_derived_audience.rb', line 40 def lookback_days @lookback_days end |
#match_rules ⇒ Object
Required for website_retargeting audiences (LinkedIn only). Each rule is a URL pattern; a member who visits any matching page enters the segment. Needs the LinkedIn Insight Tag installed on the customer's site — the segment only starts filling once the tag reports visits. The response's platformAudienceId is the LinkedIn adSegment id, valid for downstream use. These segments appear in GET /v1/ads/audiences with type: website_retargeting once LinkedIn has finished building them.
31 32 33 |
# File 'lib/zernio-sdk/models/uploaded_or_derived_audience.rb', line 31 def match_rules @match_rules end |
#name ⇒ Object
Returns the value of attribute name.
24 25 26 |
# File 'lib/zernio-sdk/models/uploaded_or_derived_audience.rb', line 24 def name @name end |
#pixel_id ⇒ Object
Required for website audiences
49 50 51 |
# File 'lib/zernio-sdk/models/uploaded_or_derived_audience.rb', line 49 def pixel_id @pixel_id end |
#ratio ⇒ Object
Required for lookalike audiences
70 71 72 |
# File 'lib/zernio-sdk/models/uploaded_or_derived_audience.rb', line 70 def ratio @ratio end |
#retention_days ⇒ Object
Required for website (max 180) and meta_engagement (max 365) audiences.
52 53 54 |
# File 'lib/zernio-sdk/models/uploaded_or_derived_audience.rb', line 52 def retention_days @retention_days end |
#rule ⇒ Object
Optional raw Meta rule, forwarded verbatim: pixel event rule for website audiences, or the engagement rule for meta_engagement (overrides the built rule, e.g. for event/canvas/lead-form sources).
73 74 75 |
# File 'lib/zernio-sdk/models/uploaded_or_derived_audience.rb', line 73 def rule @rule end |
#source_audience_id ⇒ Object
Required for lookalike audiences
64 65 66 |
# File 'lib/zernio-sdk/models/uploaded_or_derived_audience.rb', line 64 def source_audience_id @source_audience_id end |
#source_id ⇒ Object
Required for meta_engagement: the Page / IG account / video id.
58 59 60 |
# File 'lib/zernio-sdk/models/uploaded_or_derived_audience.rb', line 58 def source_id @source_id end |
#source_type ⇒ Object
Required for engagement audiences (LinkedIn only): what members engaged with — a video/leadgen/single-image ad campaign, a Company Page or an Event page.
34 35 36 |
# File 'lib/zernio-sdk/models/uploaded_or_derived_audience.rb', line 34 def source_type @source_type end |
#trigger ⇒ Object
Required for engagement audiences. The action, validated by LinkedIn against sourceType. Common values: VIDEO_ADS FIRST_QUARTILE / MIDPOINT / THIRD_QUARTILE / FULL_COMPLETE; LEAD_GEN_FORMS VIEW_FORM / LEAD_FORM_SUBMIT; ORGANIZATION_PAGES VIEW / CTA_CLICK; EVENT_PAGES RSVPED / VIDEO_VIEWED / ENGAGEMENT / CLICK.
37 38 39 |
# File 'lib/zernio-sdk/models/uploaded_or_derived_audience.rb', line 37 def trigger @trigger end |
#type ⇒ Object
Returns the value of attribute type.
28 29 30 |
# File 'lib/zernio-sdk/models/uploaded_or_derived_audience.rb', line 28 def type @type end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
128 129 130 |
# File 'lib/zernio-sdk/models/uploaded_or_derived_audience.rb', line 128 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
133 134 135 |
# File 'lib/zernio-sdk/models/uploaded_or_derived_audience.rb', line 133 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
# File 'lib/zernio-sdk/models/uploaded_or_derived_audience.rb', line 101 def self.attribute_map { :'account_id' => :'accountId', :'ad_account_id' => :'adAccountId', :'name' => :'name', :'description' => :'description', :'type' => :'type', :'match_rules' => :'matchRules', :'source_type' => :'sourceType', :'trigger' => :'trigger', :'lookback_days' => :'lookbackDays', :'engagement_sources' => :'engagementSources', :'companies' => :'companies', :'pixel_id' => :'pixelId', :'retention_days' => :'retentionDays', :'engagement_source' => :'engagementSource', :'source_id' => :'sourceId', :'event' => :'event', :'source_audience_id' => :'sourceAudienceId', :'country' => :'country', :'ratio' => :'ratio', :'rule' => :'rule', :'customer_file_source' => :'customerFileSource' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 |
# File 'lib/zernio-sdk/models/uploaded_or_derived_audience.rb', line 590 def self.build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) transformed_hash = {} openapi_types.each_pair do |key, type| if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[attribute_map[key]].is_a?(Array) transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end elsif !attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end new(transformed_hash) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
165 166 167 168 |
# File 'lib/zernio-sdk/models/uploaded_or_derived_audience.rb', line 165 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 |
# File 'lib/zernio-sdk/models/uploaded_or_derived_audience.rb', line 138 def self.openapi_types { :'account_id' => :'String', :'ad_account_id' => :'String', :'name' => :'String', :'description' => :'String', :'type' => :'String', :'match_rules' => :'Array<UploadedOrDerivedAudienceMatchRulesInner>', :'source_type' => :'String', :'trigger' => :'String', :'lookback_days' => :'Integer', :'engagement_sources' => :'Array<String>', :'companies' => :'Array<UploadedOrDerivedAudienceCompaniesInner>', :'pixel_id' => :'String', :'retention_days' => :'Integer', :'engagement_source' => :'String', :'source_id' => :'String', :'event' => :'String', :'source_audience_id' => :'String', :'country' => :'String', :'ratio' => :'Float', :'rule' => :'Object', :'customer_file_source' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 |
# File 'lib/zernio-sdk/models/uploaded_or_derived_audience.rb', line 549 def ==(o) return true if self.equal?(o) self.class == o.class && account_id == o.account_id && ad_account_id == o.ad_account_id && name == o.name && description == o.description && type == o.type && match_rules == o.match_rules && source_type == o.source_type && trigger == o.trigger && lookback_days == o.lookback_days && engagement_sources == o.engagement_sources && companies == o.companies && pixel_id == o.pixel_id && retention_days == o.retention_days && engagement_source == o.engagement_source && source_id == o.source_id && event == o.event && source_audience_id == o.source_audience_id && country == o.country && ratio == o.ratio && rule == o.rule && customer_file_source == o.customer_file_source end |
#eql?(o) ⇒ Boolean
577 578 579 |
# File 'lib/zernio-sdk/models/uploaded_or_derived_audience.rb', line 577 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
583 584 585 |
# File 'lib/zernio-sdk/models/uploaded_or_derived_audience.rb', line 583 def hash [account_id, ad_account_id, name, description, type, match_rules, source_type, trigger, lookback_days, engagement_sources, companies, pixel_id, retention_days, engagement_source, source_id, event, source_audience_id, country, ratio, rule, customer_file_source].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 |
# File 'lib/zernio-sdk/models/uploaded_or_derived_audience.rb', line 287 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @account_id.nil? invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') end if @ad_account_id.nil? invalid_properties.push('invalid value for "ad_account_id", ad_account_id cannot be nil.') end if @name.nil? invalid_properties.push('invalid value for "name", name cannot be nil.') end if @name.to_s.length > 255 invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 255.') end if @type.nil? invalid_properties.push('invalid value for "type", type cannot be nil.') end if !@match_rules.nil? && @match_rules.length > 50 invalid_properties.push('invalid value for "match_rules", number of items must be less than or equal to 50.') end if !@match_rules.nil? && @match_rules.length < 1 invalid_properties.push('invalid value for "match_rules", number of items must be greater than or equal to 1.') end if !@engagement_sources.nil? && @engagement_sources.length > 50 invalid_properties.push('invalid value for "engagement_sources", number of items must be less than or equal to 50.') end if !@engagement_sources.nil? && @engagement_sources.length < 1 invalid_properties.push('invalid value for "engagement_sources", number of items must be greater than or equal to 1.') end if !@companies.nil? && @companies.length > 300000 invalid_properties.push('invalid value for "companies", number of items must be less than or equal to 300000.') end if !@companies.nil? && @companies.length < 1 invalid_properties.push('invalid value for "companies", number of items must be greater than or equal to 1.') end if !@retention_days.nil? && @retention_days > 365 invalid_properties.push('invalid value for "retention_days", must be smaller than or equal to 365.') end if !@retention_days.nil? && @retention_days < 1 invalid_properties.push('invalid value for "retention_days", must be greater than or equal to 1.') end if !@ratio.nil? && @ratio > 0.2 invalid_properties.push('invalid value for "ratio", must be smaller than or equal to 0.2.') end if !@ratio.nil? && @ratio < 0.01 invalid_properties.push('invalid value for "ratio", must be greater than or equal to 0.01.') end invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
612 613 614 615 616 617 618 619 620 621 622 623 624 |
# File 'lib/zernio-sdk/models/uploaded_or_derived_audience.rb', line 612 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 |
# File 'lib/zernio-sdk/models/uploaded_or_derived_audience.rb', line 355 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @account_id.nil? return false if @ad_account_id.nil? return false if @name.nil? return false if @name.to_s.length > 255 return false if @type.nil? type_validator = EnumAttributeValidator.new('String', ["customer_list", "company_list", "engagement", "meta_engagement", "website", "website_retargeting", "lookalike"]) return false unless type_validator.valid?(@type) return false if !@match_rules.nil? && @match_rules.length > 50 return false if !@match_rules.nil? && @match_rules.length < 1 source_type_validator = EnumAttributeValidator.new('String', ["VIDEO_ADS", "LEAD_GEN_FORMS", "ORGANIZATION_PAGES", "EVENT_PAGES", "SINGLE_IMAGE_ADS"]) return false unless source_type_validator.valid?(@source_type) lookback_days_validator = EnumAttributeValidator.new('Integer', [30, 60, 90, 180, 365]) return false unless lookback_days_validator.valid?(@lookback_days) return false if !@engagement_sources.nil? && @engagement_sources.length > 50 return false if !@engagement_sources.nil? && @engagement_sources.length < 1 return false if !@companies.nil? && @companies.length > 300000 return false if !@companies.nil? && @companies.length < 1 return false if !@retention_days.nil? && @retention_days > 365 return false if !@retention_days.nil? && @retention_days < 1 engagement_source_validator = EnumAttributeValidator.new('String', ["page", "instagram", "video"]) return false unless engagement_source_validator.valid?(@engagement_source) return false if !@ratio.nil? && @ratio > 0.2 return false if !@ratio.nil? && @ratio < 0.01 true end |