Class: PinterestSdkClient::AdsAnalyticsCreateAsyncRequest
- Inherits:
-
Object
- Object
- PinterestSdkClient::AdsAnalyticsCreateAsyncRequest
- Defined in:
- lib/pinterest_sdk/models/ads_analytics_create_async_request.rb
Instance Attribute Summary collapse
-
#ad_group_ids ⇒ Object
List of ad group ids.
-
#ad_group_statuses ⇒ Object
List of values for filtering.
-
#ad_ids ⇒ Object
List of ad ids.
-
#ad_statuses ⇒ Object
List of values for filtering.
-
#attribution_types ⇒ Object
List of types of attribution for the conversion report.
-
#campaign_ids ⇒ Object
List of campaign ids.
-
#campaign_objective_types ⇒ Object
List of values for filtering.
-
#campaign_statuses ⇒ Object
List of status values for filtering.
-
#click_window_days ⇒ Object
Number of days to use as the conversion attribution window for a pin click action.
-
#columns ⇒ Object
Metric and entity columns.
-
#conversion_report_time ⇒ Object
The date by which the conversion metrics returned from this endpoint will be reported.
-
#end_date ⇒ Object
Metric report end date (UTC).
-
#engagement_window_days ⇒ Object
Number of days to use as the conversion attribution window for an engagement action.
-
#granularity ⇒ Object
TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly. -
#level ⇒ Object
Level of the report.
-
#metrics_filters ⇒ Object
List of metrics filters.
-
#product_group_ids ⇒ Object
List of product group ids.
-
#product_group_statuses ⇒ Object
List of values for filtering.
-
#product_item_ids ⇒ Object
List of product item ids.
-
#report_format ⇒ Object
Specification for formatting report data.
-
#start_date ⇒ Object
Metric report start date (UTC).
-
#targeting_types ⇒ Object
List of targeting types.
-
#view_window_days ⇒ Object
Number of days to use as the conversion attribution window for a view action.
Class Method Summary collapse
-
.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_all_of ⇒ Object
List of class defined in allOf (OpenAPI v3).
-
.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.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ AdsAnalyticsCreateAsyncRequest
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ AdsAnalyticsCreateAsyncRequest
Initializes the object
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 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 |
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 166 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `PinterestSdkClient::AdsAnalyticsCreateAsyncRequest` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `PinterestSdkClient::AdsAnalyticsCreateAsyncRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'start_date') self.start_date = attributes[:'start_date'] end if attributes.key?(:'end_date') self.end_date = attributes[:'end_date'] end if attributes.key?(:'granularity') self.granularity = attributes[:'granularity'] end if attributes.key?(:'click_window_days') self.click_window_days = attributes[:'click_window_days'] else self.click_window_days = 30 end if attributes.key?(:'engagement_window_days') self.engagement_window_days = attributes[:'engagement_window_days'] else self.engagement_window_days = 30 end if attributes.key?(:'view_window_days') self.view_window_days = attributes[:'view_window_days'] else self.view_window_days = 1 end if attributes.key?(:'conversion_report_time') self.conversion_report_time = attributes[:'conversion_report_time'] else self.conversion_report_time = 'TIME_OF_AD_ACTION' end if attributes.key?(:'attribution_types') if (value = attributes[:'attribution_types']).is_a?(Array) self.attribution_types = value end end if attributes.key?(:'columns') if (value = attributes[:'columns']).is_a?(Array) self.columns = value end end if attributes.key?(:'level') self.level = attributes[:'level'] end if attributes.key?(:'report_format') self.report_format = attributes[:'report_format'] else self.report_format = 'JSON' end if attributes.key?(:'campaign_ids') if (value = attributes[:'campaign_ids']).is_a?(Array) self.campaign_ids = value end end if attributes.key?(:'campaign_statuses') if (value = attributes[:'campaign_statuses']).is_a?(Array) self.campaign_statuses = value end end if attributes.key?(:'campaign_objective_types') if (value = attributes[:'campaign_objective_types']).is_a?(Array) self.campaign_objective_types = value end end if attributes.key?(:'ad_group_ids') if (value = attributes[:'ad_group_ids']).is_a?(Array) self.ad_group_ids = value end end if attributes.key?(:'ad_group_statuses') if (value = attributes[:'ad_group_statuses']).is_a?(Array) self.ad_group_statuses = value end end if attributes.key?(:'ad_ids') if (value = attributes[:'ad_ids']).is_a?(Array) self.ad_ids = value end end if attributes.key?(:'ad_statuses') if (value = attributes[:'ad_statuses']).is_a?(Array) self.ad_statuses = value end end if attributes.key?(:'product_group_ids') if (value = attributes[:'product_group_ids']).is_a?(Array) self.product_group_ids = value end end if attributes.key?(:'product_group_statuses') if (value = attributes[:'product_group_statuses']).is_a?(Array) self.product_group_statuses = value end end if attributes.key?(:'product_item_ids') if (value = attributes[:'product_item_ids']).is_a?(Array) self.product_item_ids = value end end if attributes.key?(:'targeting_types') if (value = attributes[:'targeting_types']).is_a?(Array) self.targeting_types = value end end if attributes.key?(:'metrics_filters') if (value = attributes[:'metrics_filters']).is_a?(Array) self.metrics_filters = value end end end |
Instance Attribute Details
#ad_group_ids ⇒ Object
List of ad group ids
61 62 63 |
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 61 def ad_group_ids @ad_group_ids end |
#ad_group_statuses ⇒ Object
List of values for filtering
64 65 66 |
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 64 def ad_group_statuses @ad_group_statuses end |
#ad_ids ⇒ Object
List of ad ids
67 68 69 |
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 67 def ad_ids @ad_ids end |
#ad_statuses ⇒ Object
List of values for filtering
70 71 72 |
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 70 def ad_statuses @ad_statuses end |
#attribution_types ⇒ Object
List of types of attribution for the conversion report
40 41 42 |
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 40 def attribution_types @attribution_types end |
#campaign_ids ⇒ Object
List of campaign ids
52 53 54 |
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 52 def campaign_ids @campaign_ids end |
#campaign_objective_types ⇒ Object
List of values for filtering
58 59 60 |
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 58 def campaign_objective_types @campaign_objective_types end |
#campaign_statuses ⇒ Object
List of status values for filtering
55 56 57 |
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 55 def campaign_statuses @campaign_statuses end |
#click_window_days ⇒ Object
Number of days to use as the conversion attribution window for a pin click action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to ‘30` days.
28 29 30 |
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 28 def click_window_days @click_window_days end |
#columns ⇒ Object
Metric and entity columns
43 44 45 |
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 43 def columns @columns end |
#conversion_report_time ⇒ Object
The date by which the conversion metrics returned from this endpoint will be reported. There are two dates associated with a conversion event: the date that the user interacted with the ad, and the date that the user completed a conversion event.
37 38 39 |
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 37 def conversion_report_time @conversion_report_time end |
#end_date ⇒ Object
Metric report end date (UTC). Format: YYYY-MM-DD
22 23 24 |
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 22 def end_date @end_date end |
#engagement_window_days ⇒ Object
Number of days to use as the conversion attribution window for an engagement action. Engagements include saves, closeups, link clicks, and carousel card swipes. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to ‘30` days.
31 32 33 |
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 31 def engagement_window_days @engagement_window_days end |
#granularity ⇒ Object
TOTAL - metrics are aggregated over the specified date range.
DAY - metrics are broken down daily.
HOUR - metrics are broken down hourly.
WEEKLY - metrics are broken down weekly.
MONTHLY - metrics are broken down monthly
25 26 27 |
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 25 def granularity @granularity end |
#level ⇒ Object
Level of the report
46 47 48 |
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 46 def level @level end |
#metrics_filters ⇒ Object
List of metrics filters
85 86 87 |
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 85 def metrics_filters @metrics_filters end |
#product_group_ids ⇒ Object
List of product group ids
73 74 75 |
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 73 def product_group_ids @product_group_ids end |
#product_group_statuses ⇒ Object
List of values for filtering
76 77 78 |
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 76 def product_group_statuses @product_group_statuses end |
#product_item_ids ⇒ Object
List of product item ids
79 80 81 |
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 79 def product_item_ids @product_item_ids end |
#report_format ⇒ Object
Specification for formatting report data
49 50 51 |
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 49 def report_format @report_format end |
#start_date ⇒ Object
Metric report start date (UTC). Format: YYYY-MM-DD
19 20 21 |
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 19 def start_date @start_date end |
#targeting_types ⇒ Object
List of targeting types
82 83 84 |
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 82 def targeting_types @targeting_types end |
#view_window_days ⇒ Object
Number of days to use as the conversion attribution window for a view action. Applies to Pinterest Tag conversion metrics. Prior conversion tags use their defined attribution windows. If not specified, defaults to ‘1` day.
34 35 36 |
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 34 def view_window_days @view_window_days end |
Class Method Details
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
117 118 119 |
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 117 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 88 def self.attribute_map { :'start_date' => :'start_date', :'end_date' => :'end_date', :'granularity' => :'granularity', :'click_window_days' => :'click_window_days', :'engagement_window_days' => :'engagement_window_days', :'view_window_days' => :'view_window_days', :'conversion_report_time' => :'conversion_report_time', :'attribution_types' => :'attribution_types', :'columns' => :'columns', :'level' => :'level', :'report_format' => :'report_format', :'campaign_ids' => :'campaign_ids', :'campaign_statuses' => :'campaign_statuses', :'campaign_objective_types' => :'campaign_objective_types', :'ad_group_ids' => :'ad_group_ids', :'ad_group_statuses' => :'ad_group_statuses', :'ad_ids' => :'ad_ids', :'ad_statuses' => :'ad_statuses', :'product_group_ids' => :'product_group_ids', :'product_group_statuses' => :'product_group_statuses', :'product_item_ids' => :'product_item_ids', :'targeting_types' => :'targeting_types', :'metrics_filters' => :'metrics_filters' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
714 715 716 |
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 714 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_all_of ⇒ Object
List of class defined in allOf (OpenAPI v3)
157 158 159 160 161 162 |
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 157 def self.openapi_all_of [ :'AdsAnalyticsCreateAsyncRequestAllOf', :'AdsAnalyticsCreateAsyncRequestAllOf1' ] end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
151 152 153 154 |
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 151 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
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 |
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 122 def self.openapi_types { :'start_date' => :'String', :'end_date' => :'String', :'granularity' => :'Granularity', :'click_window_days' => :'ConversionAttributionWindowDays', :'engagement_window_days' => :'ConversionAttributionWindowDays', :'view_window_days' => :'ConversionAttributionWindowDays', :'conversion_report_time' => :'ConversionReportTimeType', :'attribution_types' => :'Array<ConversionReportAttributionType>', :'columns' => :'Array<ReportingColumnAsync>', :'level' => :'MetricsReportingLevel', :'report_format' => :'DataOutputFormat', :'campaign_ids' => :'Array<String>', :'campaign_statuses' => :'Array<CampaignSummaryStatus>', :'campaign_objective_types' => :'Array<ObjectiveType>', :'ad_group_ids' => :'Array<String>', :'ad_group_statuses' => :'Array<AdGroupSummaryStatus>', :'ad_ids' => :'Array<String>', :'ad_statuses' => :'Array<PinPromotionSummaryStatus>', :'product_group_ids' => :'Array<String>', :'product_group_statuses' => :'Array<ProductGroupSummaryStatus>', :'product_item_ids' => :'Array<String>', :'targeting_types' => :'Array<AdsAnalyticsTargetingType>', :'metrics_filters' => :'Array<AdsAnalyticsMetricsFilter>' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 |
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 671 def ==(o) return true if self.equal?(o) self.class == o.class && start_date == o.start_date && end_date == o.end_date && granularity == o.granularity && click_window_days == o.click_window_days && engagement_window_days == o.engagement_window_days && view_window_days == o.view_window_days && conversion_report_time == o.conversion_report_time && attribution_types == o.attribution_types && columns == o.columns && level == o.level && report_format == o.report_format && campaign_ids == o.campaign_ids && campaign_statuses == o.campaign_statuses && campaign_objective_types == o.campaign_objective_types && ad_group_ids == o.ad_group_ids && ad_group_statuses == o.ad_group_statuses && ad_ids == o.ad_ids && ad_statuses == o.ad_statuses && product_group_ids == o.product_group_ids && product_group_statuses == o.product_group_statuses && product_item_ids == o.product_item_ids && targeting_types == o.targeting_types && metrics_filters == o.metrics_filters end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 |
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 744 def _deserialize(type, value) case type.to_sym when :Time Time.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model # models (e.g. Pet) or oneOf klass = PinterestSdkClient.const_get(type) klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
815 816 817 818 819 820 821 822 823 824 825 826 827 |
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 815 def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 |
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 721 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.openapi_types.each_pair do |key, type| if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{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[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) end end self end |
#eql?(o) ⇒ Boolean
701 702 703 |
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 701 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
707 708 709 |
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 707 def hash [start_date, end_date, granularity, click_window_days, engagement_window_days, view_window_days, conversion_report_time, attribution_types, columns, level, report_format, campaign_ids, campaign_statuses, campaign_objective_types, ad_group_ids, ad_group_statuses, ad_ids, ad_statuses, product_group_ids, product_group_statuses, product_item_ids, targeting_types, metrics_filters].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
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 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 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 437 |
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 312 def list_invalid_properties invalid_properties = Array.new if @start_date.nil? invalid_properties.push('invalid value for "start_date", start_date cannot be nil.') end pattern = Regexp.new(/^(\d{4})-(\d{2})-(\d{2})$/) if @start_date !~ pattern invalid_properties.push("invalid value for \"start_date\", must conform to the pattern #{pattern}.") end if @end_date.nil? invalid_properties.push('invalid value for "end_date", end_date cannot be nil.') end pattern = Regexp.new(/^(\d{4})-(\d{2})-(\d{2})$/) if @end_date !~ pattern invalid_properties.push("invalid value for \"end_date\", must conform to the pattern #{pattern}.") end if @granularity.nil? invalid_properties.push('invalid value for "granularity", granularity cannot be nil.') end if @columns.nil? invalid_properties.push('invalid value for "columns", columns cannot be nil.') end if @level.nil? invalid_properties.push('invalid value for "level", level cannot be nil.') end if !@campaign_ids.nil? && @campaign_ids.length > 500 invalid_properties.push('invalid value for "campaign_ids", number of items must be less than or equal to 500.') end if !@campaign_ids.nil? && @campaign_ids.length < 1 invalid_properties.push('invalid value for "campaign_ids", number of items must be greater than or equal to 1.') end if !@campaign_statuses.nil? && @campaign_statuses.length > 6 invalid_properties.push('invalid value for "campaign_statuses", number of items must be less than or equal to 6.') end if !@campaign_statuses.nil? && @campaign_statuses.length < 1 invalid_properties.push('invalid value for "campaign_statuses", number of items must be greater than or equal to 1.') end if !@campaign_objective_types.nil? && @campaign_objective_types.length > 6 invalid_properties.push('invalid value for "campaign_objective_types", number of items must be less than or equal to 6.') end if !@campaign_objective_types.nil? && @campaign_objective_types.length < 1 invalid_properties.push('invalid value for "campaign_objective_types", number of items must be greater than or equal to 1.') end if !@ad_group_ids.nil? && @ad_group_ids.length > 500 invalid_properties.push('invalid value for "ad_group_ids", number of items must be less than or equal to 500.') end if !@ad_group_ids.nil? && @ad_group_ids.length < 1 invalid_properties.push('invalid value for "ad_group_ids", number of items must be greater than or equal to 1.') end if !@ad_group_statuses.nil? && @ad_group_statuses.length > 6 invalid_properties.push('invalid value for "ad_group_statuses", number of items must be less than or equal to 6.') end if !@ad_group_statuses.nil? && @ad_group_statuses.length < 1 invalid_properties.push('invalid value for "ad_group_statuses", number of items must be greater than or equal to 1.') end if !@ad_ids.nil? && @ad_ids.length > 500 invalid_properties.push('invalid value for "ad_ids", number of items must be less than or equal to 500.') end if !@ad_ids.nil? && @ad_ids.length < 1 invalid_properties.push('invalid value for "ad_ids", number of items must be greater than or equal to 1.') end if !@ad_statuses.nil? && @ad_statuses.length > 6 invalid_properties.push('invalid value for "ad_statuses", number of items must be less than or equal to 6.') end if !@ad_statuses.nil? && @ad_statuses.length < 1 invalid_properties.push('invalid value for "ad_statuses", number of items must be greater than or equal to 1.') end if !@product_group_ids.nil? && @product_group_ids.length > 500 invalid_properties.push('invalid value for "product_group_ids", number of items must be less than or equal to 500.') end if !@product_group_ids.nil? && @product_group_ids.length < 1 invalid_properties.push('invalid value for "product_group_ids", number of items must be greater than or equal to 1.') end if !@product_group_statuses.nil? && @product_group_statuses.length > 6 invalid_properties.push('invalid value for "product_group_statuses", number of items must be less than or equal to 6.') end if !@product_group_statuses.nil? && @product_group_statuses.length < 1 invalid_properties.push('invalid value for "product_group_statuses", number of items must be greater than or equal to 1.') end if !@product_item_ids.nil? && @product_item_ids.length > 500 invalid_properties.push('invalid value for "product_item_ids", number of items must be less than or equal to 500.') end if !@product_item_ids.nil? && @product_item_ids.length < 1 invalid_properties.push('invalid value for "product_item_ids", number of items must be greater than or equal to 1.') end if !@targeting_types.nil? && @targeting_types.length > 5 invalid_properties.push('invalid value for "targeting_types", number of items must be less than or equal to 5.') end if !@targeting_types.nil? && @targeting_types.length < 1 invalid_properties.push('invalid value for "targeting_types", number of items must be greater than or equal to 1.') end if !@metrics_filters.nil? && @metrics_filters.length < 1 invalid_properties.push('invalid value for "metrics_filters", number of items must be greater than or equal to 1.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
791 792 793 |
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 791 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
797 798 799 800 801 802 803 804 805 806 807 808 809 |
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 797 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 |
#to_s ⇒ String
Returns the string representation of the object
785 786 787 |
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 785 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 |
# File 'lib/pinterest_sdk/models/ads_analytics_create_async_request.rb', line 441 def valid? return false if @start_date.nil? return false if @start_date !~ Regexp.new(/^(\d{4})-(\d{2})-(\d{2})$/) return false if @end_date.nil? return false if @end_date !~ Regexp.new(/^(\d{4})-(\d{2})-(\d{2})$/) return false if @granularity.nil? return false if @columns.nil? return false if @level.nil? return false if !@campaign_ids.nil? && @campaign_ids.length > 500 return false if !@campaign_ids.nil? && @campaign_ids.length < 1 return false if !@campaign_statuses.nil? && @campaign_statuses.length > 6 return false if !@campaign_statuses.nil? && @campaign_statuses.length < 1 return false if !@campaign_objective_types.nil? && @campaign_objective_types.length > 6 return false if !@campaign_objective_types.nil? && @campaign_objective_types.length < 1 return false if !@ad_group_ids.nil? && @ad_group_ids.length > 500 return false if !@ad_group_ids.nil? && @ad_group_ids.length < 1 return false if !@ad_group_statuses.nil? && @ad_group_statuses.length > 6 return false if !@ad_group_statuses.nil? && @ad_group_statuses.length < 1 return false if !@ad_ids.nil? && @ad_ids.length > 500 return false if !@ad_ids.nil? && @ad_ids.length < 1 return false if !@ad_statuses.nil? && @ad_statuses.length > 6 return false if !@ad_statuses.nil? && @ad_statuses.length < 1 return false if !@product_group_ids.nil? && @product_group_ids.length > 500 return false if !@product_group_ids.nil? && @product_group_ids.length < 1 return false if !@product_group_statuses.nil? && @product_group_statuses.length > 6 return false if !@product_group_statuses.nil? && @product_group_statuses.length < 1 return false if !@product_item_ids.nil? && @product_item_ids.length > 500 return false if !@product_item_ids.nil? && @product_item_ids.length < 1 return false if !@targeting_types.nil? && @targeting_types.length > 5 return false if !@targeting_types.nil? && @targeting_types.length < 1 return false if !@metrics_filters.nil? && @metrics_filters.length < 1 true end |