Class: PinterestSdkClient::AccountTemplate
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- PinterestSdkClient::AccountTemplate
- Defined in:
- lib/pinterest_sdk/models/account_template.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#ad_account_id ⇒ Object
ID of the Ad Account that owns the template.
-
#ad_account_ids ⇒ Object
IDs of the Ad Accounts that have access to this template.
-
#ade_columns ⇒ Object
A list of ADE columns.
-
#attribution_type ⇒ Object
Attribution type for Brand/Category/SKU reports.
-
#click_window_days ⇒ Object
The length of the sliding window over which click conversions will be attributed.
-
#columns ⇒ Object
A list of columns to be included in the report.
-
#conversion_report_time_type ⇒ Object
Conversion report time type.
-
#creation_source ⇒ Object
The surface used to create this template.
-
#custom_column_ids ⇒ Object
A list of custom column IDs.
-
#display_metadata ⇒ Object
Additional metadata about this reporting template.
-
#engagement_window_days ⇒ Object
The length of the sliding window over which engagement conversions will be attributed.
-
#filters_json ⇒ Object
A JSON representation of any filters to be applied before returning report data.
-
#granularity ⇒ Object
Returns the value of attribute granularity.
-
#id ⇒ Object
Template ID.
-
#ingestion_sources ⇒ Object
The filter on the conversion ingestion source method for conversion metrics.
-
#is_default ⇒ Object
A boolean representing if this is the default view that loads for this template type.
-
#is_deleted ⇒ Object
A boolean that indicates if the template has been deleted.
-
#is_owned_by_user ⇒ Object
A boolean value that indicates if the user owns the template.
-
#is_scheduled ⇒ Object
A boolean value that indicates if this template has been used to create a scheduled report.
-
#name ⇒ Object
Template Name.
-
#report_end_relative_days_in_past ⇒ Object
The number of days prior to the day the report will be delivered at which the report will end.
-
#report_format ⇒ Object
Returns the value of attribute report_format.
-
#report_level ⇒ Object
Returns the value of attribute report_level.
-
#report_start_relative_days_in_past ⇒ Object
The number of days prior to the day the report will be delivered at which the report will start.
-
#reporting_time_zone ⇒ Object
Timezone for reporting data.
-
#sort_by ⇒ Object
Unified metric sort configuration.
-
#type ⇒ Object
Type of the template.
-
#updated_time ⇒ Object
Time of last update in seconds since Unix epoch.
-
#user_id ⇒ Object
ID of the user who created the template.
-
#view_window_days ⇒ Object
The length of the sliding window over which view conversions will be attributed.
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 = {}) ⇒ AccountTemplate
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 = {}) ⇒ AccountTemplate
Initializes the object
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 284 285 286 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 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 |
# File 'lib/pinterest_sdk/models/account_template.rb', line 224 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `PinterestSdkClient::AccountTemplate` 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::AccountTemplate`. 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?(:'ad_account_id') self.ad_account_id = attributes[:'ad_account_id'] end if attributes.key?(:'ad_account_ids') if (value = attributes[:'ad_account_ids']).is_a?(Array) self.ad_account_ids = value end end if attributes.key?(:'ade_columns') if (value = attributes[:'ade_columns']).is_a?(Array) self.ade_columns = value end end if attributes.key?(:'attribution_type') self.attribution_type = attributes[:'attribution_type'] end if attributes.key?(:'click_window_days') self.click_window_days = attributes[:'click_window_days'] end if attributes.key?(:'columns') if (value = attributes[:'columns']).is_a?(Array) self.columns = value end end if attributes.key?(:'conversion_report_time_type') self.conversion_report_time_type = attributes[:'conversion_report_time_type'] end if attributes.key?(:'creation_source') self.creation_source = attributes[:'creation_source'] end if attributes.key?(:'custom_column_ids') if (value = attributes[:'custom_column_ids']).is_a?(Array) self.custom_column_ids = value end end if attributes.key?(:'display_metadata') self. = attributes[:'display_metadata'] end if attributes.key?(:'engagement_window_days') self.engagement_window_days = attributes[:'engagement_window_days'] end if attributes.key?(:'filters_json') self.filters_json = attributes[:'filters_json'] end if attributes.key?(:'granularity') self.granularity = attributes[:'granularity'] end if attributes.key?(:'id') self.id = attributes[:'id'] else self.id = nil end if attributes.key?(:'ingestion_sources') if (value = attributes[:'ingestion_sources']).is_a?(Array) self.ingestion_sources = value end end if attributes.key?(:'is_default') self.is_default = attributes[:'is_default'] end if attributes.key?(:'is_deleted') self.is_deleted = attributes[:'is_deleted'] end if attributes.key?(:'is_owned_by_user') self.is_owned_by_user = attributes[:'is_owned_by_user'] end if attributes.key?(:'is_scheduled') self.is_scheduled = attributes[:'is_scheduled'] end if attributes.key?(:'name') self.name = attributes[:'name'] end if attributes.key?(:'report_end_relative_days_in_past') self.report_end_relative_days_in_past = attributes[:'report_end_relative_days_in_past'] end if attributes.key?(:'report_format') self.report_format = attributes[:'report_format'] end if attributes.key?(:'report_level') self.report_level = attributes[:'report_level'] end if attributes.key?(:'report_start_relative_days_in_past') self.report_start_relative_days_in_past = attributes[:'report_start_relative_days_in_past'] end if attributes.key?(:'reporting_time_zone') self.reporting_time_zone = attributes[:'reporting_time_zone'] end if attributes.key?(:'sort_by') self.sort_by = attributes[:'sort_by'] end if attributes.key?(:'type') self.type = attributes[:'type'] end if attributes.key?(:'updated_time') self.updated_time = attributes[:'updated_time'] end if attributes.key?(:'user_id') self.user_id = attributes[:'user_id'] end if attributes.key?(:'view_window_days') self.view_window_days = attributes[:'view_window_days'] end end |
Instance Attribute Details
#ad_account_id ⇒ Object
ID of the Ad Account that owns the template
19 20 21 |
# File 'lib/pinterest_sdk/models/account_template.rb', line 19 def ad_account_id @ad_account_id end |
#ad_account_ids ⇒ Object
IDs of the Ad Accounts that have access to this template
22 23 24 |
# File 'lib/pinterest_sdk/models/account_template.rb', line 22 def ad_account_ids @ad_account_ids end |
#ade_columns ⇒ Object
A list of ADE columns
25 26 27 |
# File 'lib/pinterest_sdk/models/account_template.rb', line 25 def ade_columns @ade_columns end |
#attribution_type ⇒ Object
Attribution type for Brand/Category/SKU reports
28 29 30 |
# File 'lib/pinterest_sdk/models/account_template.rb', line 28 def attribution_type @attribution_type end |
#click_window_days ⇒ Object
The length of the sliding window over which click conversions will be attributed
31 32 33 |
# File 'lib/pinterest_sdk/models/account_template.rb', line 31 def click_window_days @click_window_days end |
#columns ⇒ Object
A list of columns to be included in the report
34 35 36 |
# File 'lib/pinterest_sdk/models/account_template.rb', line 34 def columns @columns end |
#conversion_report_time_type ⇒ Object
Conversion report time type
37 38 39 |
# File 'lib/pinterest_sdk/models/account_template.rb', line 37 def conversion_report_time_type @conversion_report_time_type end |
#creation_source ⇒ Object
The surface used to create this template
40 41 42 |
# File 'lib/pinterest_sdk/models/account_template.rb', line 40 def creation_source @creation_source end |
#custom_column_ids ⇒ Object
A list of custom column IDs
43 44 45 |
# File 'lib/pinterest_sdk/models/account_template.rb', line 43 def custom_column_ids @custom_column_ids end |
#display_metadata ⇒ Object
Additional metadata about this reporting template
46 47 48 |
# File 'lib/pinterest_sdk/models/account_template.rb', line 46 def end |
#engagement_window_days ⇒ Object
The length of the sliding window over which engagement conversions will be attributed
49 50 51 |
# File 'lib/pinterest_sdk/models/account_template.rb', line 49 def engagement_window_days @engagement_window_days end |
#filters_json ⇒ Object
A JSON representation of any filters to be applied before returning report data. Each filter object should contain all of the following fields:\ "field": The column name\ "operator": The operator. Allowed operators: ["=", "!=", "in", "not_in", "~", ">", "<", "contains_substring"]\ "value": A single value or a list of values
52 53 54 |
# File 'lib/pinterest_sdk/models/account_template.rb', line 52 def filters_json @filters_json end |
#granularity ⇒ Object
Returns the value of attribute granularity.
54 55 56 |
# File 'lib/pinterest_sdk/models/account_template.rb', line 54 def granularity @granularity end |
#id ⇒ Object
Template ID
57 58 59 |
# File 'lib/pinterest_sdk/models/account_template.rb', line 57 def id @id end |
#ingestion_sources ⇒ Object
The filter on the conversion ingestion source method for conversion metrics
60 61 62 |
# File 'lib/pinterest_sdk/models/account_template.rb', line 60 def ingestion_sources @ingestion_sources end |
#is_default ⇒ Object
A boolean representing if this is the default view that loads for this template type
63 64 65 |
# File 'lib/pinterest_sdk/models/account_template.rb', line 63 def is_default @is_default end |
#is_deleted ⇒ Object
A boolean that indicates if the template has been deleted
66 67 68 |
# File 'lib/pinterest_sdk/models/account_template.rb', line 66 def is_deleted @is_deleted end |
#is_owned_by_user ⇒ Object
A boolean value that indicates if the user owns the template
69 70 71 |
# File 'lib/pinterest_sdk/models/account_template.rb', line 69 def is_owned_by_user @is_owned_by_user end |
#is_scheduled ⇒ Object
A boolean value that indicates if this template has been used to create a scheduled report
72 73 74 |
# File 'lib/pinterest_sdk/models/account_template.rb', line 72 def is_scheduled @is_scheduled end |
#name ⇒ Object
Template Name
75 76 77 |
# File 'lib/pinterest_sdk/models/account_template.rb', line 75 def name @name end |
#report_end_relative_days_in_past ⇒ Object
The number of days prior to the day the report will be delivered at which the report will end
78 79 80 |
# File 'lib/pinterest_sdk/models/account_template.rb', line 78 def report_end_relative_days_in_past @report_end_relative_days_in_past end |
#report_format ⇒ Object
Returns the value of attribute report_format.
80 81 82 |
# File 'lib/pinterest_sdk/models/account_template.rb', line 80 def report_format @report_format end |
#report_level ⇒ Object
Returns the value of attribute report_level.
82 83 84 |
# File 'lib/pinterest_sdk/models/account_template.rb', line 82 def report_level @report_level end |
#report_start_relative_days_in_past ⇒ Object
The number of days prior to the day the report will be delivered at which the report will start
85 86 87 |
# File 'lib/pinterest_sdk/models/account_template.rb', line 85 def report_start_relative_days_in_past @report_start_relative_days_in_past end |
#reporting_time_zone ⇒ Object
Timezone for reporting data
88 89 90 |
# File 'lib/pinterest_sdk/models/account_template.rb', line 88 def reporting_time_zone @reporting_time_zone end |
#sort_by ⇒ Object
Unified metric sort configuration
91 92 93 |
# File 'lib/pinterest_sdk/models/account_template.rb', line 91 def sort_by @sort_by end |
#type ⇒ Object
Type of the template
94 95 96 |
# File 'lib/pinterest_sdk/models/account_template.rb', line 94 def type @type end |
#updated_time ⇒ Object
Time of last update in seconds since Unix epoch
97 98 99 |
# File 'lib/pinterest_sdk/models/account_template.rb', line 97 def updated_time @updated_time end |
#user_id ⇒ Object
ID of the user who created the template
100 101 102 |
# File 'lib/pinterest_sdk/models/account_template.rb', line 100 def user_id @user_id end |
#view_window_days ⇒ Object
The length of the sliding window over which view conversions will be attributed
103 104 105 |
# File 'lib/pinterest_sdk/models/account_template.rb', line 103 def view_window_days @view_window_days end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
164 165 166 |
# File 'lib/pinterest_sdk/models/account_template.rb', line 164 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
169 170 171 |
# File 'lib/pinterest_sdk/models/account_template.rb', line 169 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 |
# File 'lib/pinterest_sdk/models/account_template.rb', line 128 def self.attribute_map { :'ad_account_id' => :'ad_account_id', :'ad_account_ids' => :'ad_account_ids', :'ade_columns' => :'ade_columns', :'attribution_type' => :'attribution_type', :'click_window_days' => :'click_window_days', :'columns' => :'columns', :'conversion_report_time_type' => :'conversion_report_time_type', :'creation_source' => :'creation_source', :'custom_column_ids' => :'custom_column_ids', :'display_metadata' => :'display_metadata', :'engagement_window_days' => :'engagement_window_days', :'filters_json' => :'filters_json', :'granularity' => :'granularity', :'id' => :'id', :'ingestion_sources' => :'ingestion_sources', :'is_default' => :'is_default', :'is_deleted' => :'is_deleted', :'is_owned_by_user' => :'is_owned_by_user', :'is_scheduled' => :'is_scheduled', :'name' => :'name', :'report_end_relative_days_in_past' => :'report_end_relative_days_in_past', :'report_format' => :'report_format', :'report_level' => :'report_level', :'report_start_relative_days_in_past' => :'report_start_relative_days_in_past', :'reporting_time_zone' => :'reporting_time_zone', :'sort_by' => :'sort_by', :'type' => :'type', :'updated_time' => :'updated_time', :'user_id' => :'user_id', :'view_window_days' => :'view_window_days' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 |
# File 'lib/pinterest_sdk/models/account_template.rb', line 453 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
210 211 212 213 214 215 216 217 218 219 220 |
# File 'lib/pinterest_sdk/models/account_template.rb', line 210 def self.openapi_nullable Set.new([ :'attribution_type', :'custom_column_ids', :'filters_json', :'ingestion_sources', :'is_deleted', :'name', :'sort_by', ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
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 |
# File 'lib/pinterest_sdk/models/account_template.rb', line 174 def self.openapi_types { :'ad_account_id' => :'String', :'ad_account_ids' => :'Array<String>', :'ade_columns' => :'Array<String>', :'attribution_type' => :'Object', :'click_window_days' => :'Float', :'columns' => :'Array<ReportingColumn>', :'conversion_report_time_type' => :'ConversionReportTimeType', :'creation_source' => :'CreationSource', :'custom_column_ids' => :'Array<String>', :'display_metadata' => :'String', :'engagement_window_days' => :'Float', :'filters_json' => :'String', :'granularity' => :'Granularity', :'id' => :'String', :'ingestion_sources' => :'Array<IngestionSource>', :'is_default' => :'Boolean', :'is_deleted' => :'Boolean', :'is_owned_by_user' => :'Boolean', :'is_scheduled' => :'Boolean', :'name' => :'String', :'report_end_relative_days_in_past' => :'Float', :'report_format' => :'DataOutputFormat', :'report_level' => :'MetricsReportingLevel', :'report_start_relative_days_in_past' => :'Float', :'reporting_time_zone' => :'ReportingTimeZone', :'sort_by' => :'Object', :'type' => :'String', :'updated_time' => :'Float', :'user_id' => :'String', :'view_window_days' => :'Float' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 |
# File 'lib/pinterest_sdk/models/account_template.rb', line 403 def ==(o) return true if self.equal?(o) self.class == o.class && ad_account_id == o.ad_account_id && ad_account_ids == o.ad_account_ids && ade_columns == o.ade_columns && attribution_type == o.attribution_type && click_window_days == o.click_window_days && columns == o.columns && conversion_report_time_type == o.conversion_report_time_type && creation_source == o.creation_source && custom_column_ids == o.custom_column_ids && == o. && engagement_window_days == o.engagement_window_days && filters_json == o.filters_json && granularity == o.granularity && id == o.id && ingestion_sources == o.ingestion_sources && is_default == o.is_default && is_deleted == o.is_deleted && is_owned_by_user == o.is_owned_by_user && is_scheduled == o.is_scheduled && name == o.name && report_end_relative_days_in_past == o.report_end_relative_days_in_past && report_format == o.report_format && report_level == o.report_level && report_start_relative_days_in_past == o.report_start_relative_days_in_past && reporting_time_zone == o.reporting_time_zone && sort_by == o.sort_by && type == o.type && updated_time == o.updated_time && user_id == o.user_id && view_window_days == o.view_window_days end |
#eql?(o) ⇒ Boolean
440 441 442 |
# File 'lib/pinterest_sdk/models/account_template.rb', line 440 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
446 447 448 |
# File 'lib/pinterest_sdk/models/account_template.rb', line 446 def hash [ad_account_id, ad_account_ids, ade_columns, attribution_type, click_window_days, columns, conversion_report_time_type, creation_source, custom_column_ids, , engagement_window_days, filters_json, granularity, id, ingestion_sources, is_default, is_deleted, is_owned_by_user, is_scheduled, name, report_end_relative_days_in_past, report_format, report_level, report_start_relative_days_in_past, reporting_time_zone, sort_by, type, updated_time, user_id, view_window_days].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
373 374 375 376 377 378 379 380 381 |
# File 'lib/pinterest_sdk/models/account_template.rb', line 373 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @id.nil? invalid_properties.push('invalid value for "id", id cannot be nil.') end invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
475 476 477 478 479 480 481 482 483 484 485 486 487 |
# File 'lib/pinterest_sdk/models/account_template.rb', line 475 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
385 386 387 388 389 |
# File 'lib/pinterest_sdk/models/account_template.rb', line 385 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @id.nil? true end |