Class: Late::AdCreative
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- Late::AdCreative
- Defined in:
- lib/late-sdk/models/ad_creative.rb
Overview
Platform-specific creative data. Fields vary by platform.
Instance Attribute Summary collapse
-
#body ⇒ Object
Ad copy/text.
-
#google_description ⇒ Object
Google Ads description.
-
#google_headline ⇒ Object
Google Ads headline.
-
#image_url ⇒ Object
Alternative image URL.
-
#link_url ⇒ Object
Destination URL.
-
#media_urls ⇒ Object
All media URLs for this ad (carousel images, multiple assets).
-
#pinterest_description ⇒ Object
Returns the value of attribute pinterest_description.
-
#pinterest_image_url ⇒ Object
Returns the value of attribute pinterest_image_url.
-
#pinterest_title ⇒ Object
Returns the value of attribute pinterest_title.
-
#thumbnail_url ⇒ Object
Primary thumbnail/image URL.
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 = {}) ⇒ AdCreative
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 = {}) ⇒ AdCreative
Initializes the object
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 |
# File 'lib/late-sdk/models/ad_creative.rb', line 96 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Late::AdCreative` 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 `Late::AdCreative`. 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?(:'thumbnail_url') self.thumbnail_url = attributes[:'thumbnail_url'] end if attributes.key?(:'image_url') self.image_url = attributes[:'image_url'] end if attributes.key?(:'media_urls') if (value = attributes[:'media_urls']).is_a?(Array) self.media_urls = value end end if attributes.key?(:'body') self.body = attributes[:'body'] end if attributes.key?(:'google_headline') self.google_headline = attributes[:'google_headline'] end if attributes.key?(:'google_description') self.google_description = attributes[:'google_description'] end if attributes.key?(:'link_url') self.link_url = attributes[:'link_url'] end if attributes.key?(:'pinterest_image_url') self.pinterest_image_url = attributes[:'pinterest_image_url'] end if attributes.key?(:'pinterest_title') self.pinterest_title = attributes[:'pinterest_title'] end if attributes.key?(:'pinterest_description') self.pinterest_description = attributes[:'pinterest_description'] end end |
Instance Attribute Details
#body ⇒ Object
Ad copy/text
29 30 31 |
# File 'lib/late-sdk/models/ad_creative.rb', line 29 def body @body end |
#google_description ⇒ Object
Google Ads description
35 36 37 |
# File 'lib/late-sdk/models/ad_creative.rb', line 35 def google_description @google_description end |
#google_headline ⇒ Object
Google Ads headline
32 33 34 |
# File 'lib/late-sdk/models/ad_creative.rb', line 32 def google_headline @google_headline end |
#image_url ⇒ Object
Alternative image URL
23 24 25 |
# File 'lib/late-sdk/models/ad_creative.rb', line 23 def image_url @image_url end |
#link_url ⇒ Object
Destination URL
38 39 40 |
# File 'lib/late-sdk/models/ad_creative.rb', line 38 def link_url @link_url end |
#media_urls ⇒ Object
All media URLs for this ad (carousel images, multiple assets). Populated for Meta (carousel child_attachments), Google Ads (responsive display marketing_images), and LinkedIn (multi-image posts).
26 27 28 |
# File 'lib/late-sdk/models/ad_creative.rb', line 26 def media_urls @media_urls end |
#pinterest_description ⇒ Object
Returns the value of attribute pinterest_description.
44 45 46 |
# File 'lib/late-sdk/models/ad_creative.rb', line 44 def pinterest_description @pinterest_description end |
#pinterest_image_url ⇒ Object
Returns the value of attribute pinterest_image_url.
40 41 42 |
# File 'lib/late-sdk/models/ad_creative.rb', line 40 def pinterest_image_url @pinterest_image_url end |
#pinterest_title ⇒ Object
Returns the value of attribute pinterest_title.
42 43 44 |
# File 'lib/late-sdk/models/ad_creative.rb', line 42 def pinterest_title @pinterest_title end |
#thumbnail_url ⇒ Object
Primary thumbnail/image URL
20 21 22 |
# File 'lib/late-sdk/models/ad_creative.rb', line 20 def thumbnail_url @thumbnail_url end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
63 64 65 |
# File 'lib/late-sdk/models/ad_creative.rb', line 63 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
68 69 70 |
# File 'lib/late-sdk/models/ad_creative.rb', line 68 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/late-sdk/models/ad_creative.rb', line 47 def self.attribute_map { :'thumbnail_url' => :'thumbnailUrl', :'image_url' => :'imageUrl', :'media_urls' => :'mediaUrls', :'body' => :'body', :'google_headline' => :'googleHeadline', :'google_description' => :'googleDescription', :'link_url' => :'linkUrl', :'pinterest_image_url' => :'pinterestImageUrl', :'pinterest_title' => :'pinterestTitle', :'pinterest_description' => :'pinterestDescription' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 |
# File 'lib/late-sdk/models/ad_creative.rb', line 200 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
89 90 91 92 |
# File 'lib/late-sdk/models/ad_creative.rb', line 89 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/late-sdk/models/ad_creative.rb', line 73 def self.openapi_types { :'thumbnail_url' => :'String', :'image_url' => :'String', :'media_urls' => :'Array<String>', :'body' => :'String', :'google_headline' => :'String', :'google_description' => :'String', :'link_url' => :'String', :'pinterest_image_url' => :'String', :'pinterest_title' => :'String', :'pinterest_description' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
170 171 172 173 174 175 176 177 178 179 180 181 182 183 |
# File 'lib/late-sdk/models/ad_creative.rb', line 170 def ==(o) return true if self.equal?(o) self.class == o.class && thumbnail_url == o.thumbnail_url && image_url == o.image_url && media_urls == o.media_urls && body == o.body && google_headline == o.google_headline && google_description == o.google_description && link_url == o.link_url && pinterest_image_url == o.pinterest_image_url && pinterest_title == o.pinterest_title && pinterest_description == o.pinterest_description end |
#eql?(o) ⇒ Boolean
187 188 189 |
# File 'lib/late-sdk/models/ad_creative.rb', line 187 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
193 194 195 |
# File 'lib/late-sdk/models/ad_creative.rb', line 193 def hash [thumbnail_url, image_url, media_urls, body, google_headline, google_description, link_url, pinterest_image_url, pinterest_title, pinterest_description].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
155 156 157 158 159 |
# File 'lib/late-sdk/models/ad_creative.rb', line 155 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
222 223 224 225 226 227 228 229 230 231 232 233 234 |
# File 'lib/late-sdk/models/ad_creative.rb', line 222 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
163 164 165 166 |
# File 'lib/late-sdk/models/ad_creative.rb', line 163 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' true end |