Class: PinterestSdkClient::ConversionEventsDataItems
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- PinterestSdkClient::ConversionEventsDataItems
- Defined in:
- lib/pinterest_sdk/models/conversion_events_data_items.rb
Instance Attribute Summary collapse
-
#action_source ⇒ Object
The source indicating where the conversion event occurred.
-
#app_id ⇒ Object
The app store app ID.
-
#app_info ⇒ Object
Returns the value of attribute app_info.
-
#app_name ⇒ Object
Name of the app.
-
#app_version ⇒ Object
Version of the app.
-
#custom_data ⇒ Object
Returns the value of attribute custom_data.
-
#device_brand ⇒ Object
Brand of the user device.
-
#device_carrier ⇒ Object
User device's mobile carrier.
-
#device_info ⇒ Object
Returns the value of attribute device_info.
-
#device_model ⇒ Object
Model of the user device.
-
#device_type ⇒ Object
Type of the user device.
-
#event_id ⇒ Object
A unique id string that identifies this event and can be used for deduping between events ingested via both the conversion API and Pinterest tracking.
-
#event_name ⇒ Object
The type of the user event.
-
#event_source_url ⇒ Object
URL of the web conversion event.
-
#event_time ⇒ Object
The time when the event happened.
-
#language ⇒ Object
Two-character ISO-639-1 language code indicating the user's language.
-
#opt_out ⇒ Object
When action_source is web or offline, it defines whether the user has opted out of tracking for web conversion events.
-
#os_version ⇒ Object
Version of the device operating system.
-
#partner_name ⇒ Object
The third party partner name responsible to send the event to Conversions API on behalf of the advertiser.
-
#user_data ⇒ Object
Object containing customer information data.
-
#wifi ⇒ Object
Whether the event occurred when the user device was connected to wifi.
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 = {}) ⇒ ConversionEventsDataItems
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 = {}) ⇒ ConversionEventsDataItems
Initializes the object
161 162 163 164 165 166 167 168 169 170 171 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 |
# File 'lib/pinterest_sdk/models/conversion_events_data_items.rb', line 161 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `PinterestSdkClient::ConversionEventsDataItems` 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 `PinterestSdkClient::ConversionEventsDataItems`. 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?(:'action_source') self.action_source = attributes[:'action_source'] else self.action_source = nil end if attributes.key?(:'app_id') self.app_id = attributes[:'app_id'] end if attributes.key?(:'app_info') self.app_info = attributes[:'app_info'] end if attributes.key?(:'app_name') self.app_name = attributes[:'app_name'] end if attributes.key?(:'app_version') self.app_version = attributes[:'app_version'] end if attributes.key?(:'custom_data') self.custom_data = attributes[:'custom_data'] end if attributes.key?(:'device_brand') self.device_brand = attributes[:'device_brand'] end if attributes.key?(:'device_carrier') self.device_carrier = attributes[:'device_carrier'] end if attributes.key?(:'device_info') self.device_info = attributes[:'device_info'] end if attributes.key?(:'device_model') self.device_model = attributes[:'device_model'] end if attributes.key?(:'device_type') self.device_type = attributes[:'device_type'] end if attributes.key?(:'event_id') self.event_id = attributes[:'event_id'] else self.event_id = nil end if attributes.key?(:'event_name') self.event_name = attributes[:'event_name'] else self.event_name = nil end if attributes.key?(:'event_source_url') self.event_source_url = attributes[:'event_source_url'] end if attributes.key?(:'event_time') self.event_time = attributes[:'event_time'] else self.event_time = nil end if attributes.key?(:'language') self.language = attributes[:'language'] end if attributes.key?(:'opt_out') self.opt_out = attributes[:'opt_out'] end if attributes.key?(:'os_version') self.os_version = attributes[:'os_version'] end if attributes.key?(:'partner_name') self.partner_name = attributes[:'partner_name'] end if attributes.key?(:'user_data') self.user_data = attributes[:'user_data'] else self.user_data = nil end if attributes.key?(:'wifi') self.wifi = attributes[:'wifi'] end end |
Instance Attribute Details
#action_source ⇒ Object
The source indicating where the conversion event occurred. - app_android - app_ios - web - offline
19 20 21 |
# File 'lib/pinterest_sdk/models/conversion_events_data_items.rb', line 19 def action_source @action_source end |
#app_id ⇒ Object
The app store app ID.
22 23 24 |
# File 'lib/pinterest_sdk/models/conversion_events_data_items.rb', line 22 def app_id @app_id end |
#app_info ⇒ Object
Returns the value of attribute app_info.
24 25 26 |
# File 'lib/pinterest_sdk/models/conversion_events_data_items.rb', line 24 def app_info @app_info end |
#app_name ⇒ Object
Name of the app.
27 28 29 |
# File 'lib/pinterest_sdk/models/conversion_events_data_items.rb', line 27 def app_name @app_name end |
#app_version ⇒ Object
Version of the app.
30 31 32 |
# File 'lib/pinterest_sdk/models/conversion_events_data_items.rb', line 30 def app_version @app_version end |
#custom_data ⇒ Object
Returns the value of attribute custom_data.
32 33 34 |
# File 'lib/pinterest_sdk/models/conversion_events_data_items.rb', line 32 def custom_data @custom_data end |
#device_brand ⇒ Object
Brand of the user device.
35 36 37 |
# File 'lib/pinterest_sdk/models/conversion_events_data_items.rb', line 35 def device_brand @device_brand end |
#device_carrier ⇒ Object
User device's mobile carrier.
38 39 40 |
# File 'lib/pinterest_sdk/models/conversion_events_data_items.rb', line 38 def device_carrier @device_carrier end |
#device_info ⇒ Object
Returns the value of attribute device_info.
40 41 42 |
# File 'lib/pinterest_sdk/models/conversion_events_data_items.rb', line 40 def device_info @device_info end |
#device_model ⇒ Object
Model of the user device.
43 44 45 |
# File 'lib/pinterest_sdk/models/conversion_events_data_items.rb', line 43 def device_model @device_model end |
#device_type ⇒ Object
Type of the user device.
46 47 48 |
# File 'lib/pinterest_sdk/models/conversion_events_data_items.rb', line 46 def device_type @device_type end |
#event_id ⇒ Object
A unique id string that identifies this event and can be used for deduping between events ingested via both the conversion API and Pinterest tracking. Without this, event's data is likely to be double counted and will cause report metric inflation. Third-party vendors make sure this field is updated on both Pinterest tag and Conversions API side before rolling out template for Conversions API.
49 50 51 |
# File 'lib/pinterest_sdk/models/conversion_events_data_items.rb', line 49 def event_id @event_id end |
#event_name ⇒ Object
The type of the user event. Please use the right event_name; otherwise the event will not be accepted and show up correctly in reports. - add_payment_info - add_to_cart - add_to_wishlist - app_install - app_open - checkout - contact - custom - customize_product - find_location - initiate_checkout - lead - page_visit - schedule - search - signup - start_trial - submit_application - subscribe - view_category - view_content - watch_video
52 53 54 |
# File 'lib/pinterest_sdk/models/conversion_events_data_items.rb', line 52 def event_name @event_name end |
#event_source_url ⇒ Object
URL of the web conversion event.
55 56 57 |
# File 'lib/pinterest_sdk/models/conversion_events_data_items.rb', line 55 def event_source_url @event_source_url end |
#event_time ⇒ Object
The time when the event happened. Unix timestamp in seconds.
58 59 60 |
# File 'lib/pinterest_sdk/models/conversion_events_data_items.rb', line 58 def event_time @event_time end |
#language ⇒ Object
Two-character ISO-639-1 language code indicating the user's language.
61 62 63 |
# File 'lib/pinterest_sdk/models/conversion_events_data_items.rb', line 61 def language @language end |
#opt_out ⇒ Object
When action_source is web or offline, it defines whether the user has opted out of tracking for web conversion events. While when action_source is app_android or app_ios, it defines whether the user has enabled Limit Ad Tracking on their iOS device, or opted out of Ads Personalization on their Android device.
64 65 66 |
# File 'lib/pinterest_sdk/models/conversion_events_data_items.rb', line 64 def opt_out @opt_out end |
#os_version ⇒ Object
Version of the device operating system.
67 68 69 |
# File 'lib/pinterest_sdk/models/conversion_events_data_items.rb', line 67 def os_version @os_version end |
#partner_name ⇒ Object
The third party partner name responsible to send the event to Conversions API on behalf of the advertiser. The naming convention is "ss-partnername" lowercase. E.g 'ss-shopify'
70 71 72 |
# File 'lib/pinterest_sdk/models/conversion_events_data_items.rb', line 70 def partner_name @partner_name end |
#user_data ⇒ Object
Object containing customer information data. Note, It is required at least one of 1) em, 2) hashed_maids or 3) pair client_ip_address + client_user_agent.
73 74 75 |
# File 'lib/pinterest_sdk/models/conversion_events_data_items.rb', line 73 def user_data @user_data end |
#wifi ⇒ Object
Whether the event occurred when the user device was connected to wifi.
76 77 78 |
# File 'lib/pinterest_sdk/models/conversion_events_data_items.rb', line 76 def wifi @wifi end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
106 107 108 |
# File 'lib/pinterest_sdk/models/conversion_events_data_items.rb', line 106 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
111 112 113 |
# File 'lib/pinterest_sdk/models/conversion_events_data_items.rb', line 111 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/pinterest_sdk/models/conversion_events_data_items.rb', line 79 def self.attribute_map { :'action_source' => :'action_source', :'app_id' => :'app_id', :'app_info' => :'app_info', :'app_name' => :'app_name', :'app_version' => :'app_version', :'custom_data' => :'custom_data', :'device_brand' => :'device_brand', :'device_carrier' => :'device_carrier', :'device_info' => :'device_info', :'device_model' => :'device_model', :'device_type' => :'device_type', :'event_id' => :'event_id', :'event_name' => :'event_name', :'event_source_url' => :'event_source_url', :'event_time' => :'event_time', :'language' => :'language', :'opt_out' => :'opt_out', :'os_version' => :'os_version', :'partner_name' => :'partner_name', :'user_data' => :'user_data', :'wifi' => :'wifi' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 |
# File 'lib/pinterest_sdk/models/conversion_events_data_items.rb', line 403 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
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 |
# File 'lib/pinterest_sdk/models/conversion_events_data_items.rb', line 143 def self.openapi_nullable Set.new([ :'app_id', :'app_name', :'app_version', :'device_brand', :'device_carrier', :'device_model', :'device_type', :'event_source_url', :'language', :'os_version', :'partner_name', ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
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 |
# File 'lib/pinterest_sdk/models/conversion_events_data_items.rb', line 116 def self.openapi_types { :'action_source' => :'String', :'app_id' => :'String', :'app_info' => :'ConversionEventAppInfo', :'app_name' => :'String', :'app_version' => :'String', :'custom_data' => :'ConversionEventsDataItemsCustomData', :'device_brand' => :'String', :'device_carrier' => :'String', :'device_info' => :'ConversionEventDeviceInfo', :'device_model' => :'String', :'device_type' => :'String', :'event_id' => :'String', :'event_name' => :'String', :'event_source_url' => :'String', :'event_time' => :'Integer', :'language' => :'String', :'opt_out' => :'Boolean', :'os_version' => :'String', :'partner_name' => :'String', :'user_data' => :'ConversionEventsUserDataProperties', :'wifi' => :'Boolean' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 |
# File 'lib/pinterest_sdk/models/conversion_events_data_items.rb', line 362 def ==(o) return true if self.equal?(o) self.class == o.class && action_source == o.action_source && app_id == o.app_id && app_info == o.app_info && app_name == o.app_name && app_version == o.app_version && custom_data == o.custom_data && device_brand == o.device_brand && device_carrier == o.device_carrier && device_info == o.device_info && device_model == o.device_model && device_type == o.device_type && event_id == o.event_id && event_name == o.event_name && event_source_url == o.event_source_url && event_time == o.event_time && language == o.language && opt_out == o.opt_out && os_version == o.os_version && partner_name == o.partner_name && user_data == o.user_data && wifi == o.wifi end |
#eql?(o) ⇒ Boolean
390 391 392 |
# File 'lib/pinterest_sdk/models/conversion_events_data_items.rb', line 390 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
396 397 398 |
# File 'lib/pinterest_sdk/models/conversion_events_data_items.rb', line 396 def hash [action_source, app_id, app_info, app_name, app_version, custom_data, device_brand, device_carrier, device_info, device_model, device_type, event_id, event_name, event_source_url, event_time, language, opt_out, os_version, partner_name, user_data, wifi].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 |
# File 'lib/pinterest_sdk/models/conversion_events_data_items.rb', line 272 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @action_source.nil? invalid_properties.push('invalid value for "action_source", action_source cannot be nil.') end if @event_id.nil? invalid_properties.push('invalid value for "event_id", event_id cannot be nil.') end if @event_name.nil? invalid_properties.push('invalid value for "event_name", event_name cannot be nil.') end if @event_time.nil? invalid_properties.push('invalid value for "event_time", event_time cannot be nil.') end if @user_data.nil? invalid_properties.push('invalid value for "user_data", user_data cannot be nil.') end invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
425 426 427 428 429 430 431 432 433 434 435 436 437 |
# File 'lib/pinterest_sdk/models/conversion_events_data_items.rb', line 425 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
300 301 302 303 304 305 306 307 308 |
# File 'lib/pinterest_sdk/models/conversion_events_data_items.rb', line 300 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @action_source.nil? return false if @event_id.nil? return false if @event_name.nil? return false if @event_time.nil? return false if @user_data.nil? true end |