late-sdk 0.0.97 → 0.0.99

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +53 -0
  3. data/docs/Ad.md +58 -0
  4. data/docs/AdAudiencesApi.md +365 -0
  5. data/docs/AdBudget.md +20 -0
  6. data/docs/AdCampaign.md +40 -0
  7. data/docs/AdCampaignsApi.md +165 -0
  8. data/docs/AdMetrics.md +34 -0
  9. data/docs/AdSchedule.md +20 -0
  10. data/docs/AddUsersToAdAudience200Response.md +22 -0
  11. data/docs/AddUsersToAdAudienceRequest.md +18 -0
  12. data/docs/AddUsersToAdAudienceRequestUsersInner.md +20 -0
  13. data/docs/AdsApi.md +726 -0
  14. data/docs/BoostPostRequest.md +36 -0
  15. data/docs/BoostPostRequestBudget.md +20 -0
  16. data/docs/BoostPostRequestSchedule.md +20 -0
  17. data/docs/BoostPostRequestTargeting.md +24 -0
  18. data/docs/CreateAdAudience201Response.md +20 -0
  19. data/docs/CreateAdAudienceRequest.md +36 -0
  20. data/docs/CreateStandaloneAdRequest.md +56 -0
  21. data/docs/GetAd200Response.md +18 -0
  22. data/docs/GetAdAnalytics200Response.md +20 -0
  23. data/docs/GetAdAnalytics200ResponseAd.md +24 -0
  24. data/docs/GetAdAnalytics200ResponseAnalytics.md +22 -0
  25. data/docs/GetAdAnalytics200ResponseAnalyticsDailyInner.md +36 -0
  26. data/docs/GetAdAudience200Response.md +20 -0
  27. data/docs/ListAdAccounts200Response.md +18 -0
  28. data/docs/ListAdAccounts200ResponseAccountsInner.md +24 -0
  29. data/docs/ListAdAudiences200Response.md +18 -0
  30. data/docs/ListAdAudiences200ResponseAudiencesInner.md +32 -0
  31. data/docs/ListAdCampaigns200Response.md +20 -0
  32. data/docs/ListAds200Response.md +20 -0
  33. data/docs/SearchAdInterests200Response.md +18 -0
  34. data/docs/SearchAdInterests200ResponseInterestsInner.md +22 -0
  35. data/docs/SyncExternalAds200Response.md +24 -0
  36. data/docs/UpdateAd200Response.md +20 -0
  37. data/docs/UpdateAdCampaignStatus200Response.md +22 -0
  38. data/docs/UpdateAdCampaignStatusRequest.md +20 -0
  39. data/docs/UpdateAdRequest.md +24 -0
  40. data/docs/UpdateAdRequestBudget.md +20 -0
  41. data/docs/UpdateAdRequestTargeting.md +24 -0
  42. data/docs/UpdatePostMetadataRequest.md +7 -1
  43. data/lib/late-sdk/api/ad_audiences_api.rb +368 -0
  44. data/lib/late-sdk/api/ad_campaigns_api.rb +201 -0
  45. data/lib/late-sdk/api/ads_api.rb +719 -0
  46. data/lib/late-sdk/models/ad.rb +399 -0
  47. data/lib/late-sdk/models/ad_budget.rb +190 -0
  48. data/lib/late-sdk/models/ad_campaign.rb +293 -0
  49. data/lib/late-sdk/models/ad_metrics.rb +222 -0
  50. data/lib/late-sdk/models/ad_schedule.rb +156 -0
  51. data/lib/late-sdk/models/add_users_to_ad_audience200_response.rb +165 -0
  52. data/lib/late-sdk/models/add_users_to_ad_audience_request.rb +175 -0
  53. data/lib/late-sdk/models/add_users_to_ad_audience_request_users_inner.rb +157 -0
  54. data/lib/late-sdk/models/boost_post_request.rb +350 -0
  55. data/lib/late-sdk/models/boost_post_request_budget.rb +215 -0
  56. data/lib/late-sdk/models/boost_post_request_schedule.rb +157 -0
  57. data/lib/late-sdk/models/boost_post_request_targeting.rb +234 -0
  58. data/lib/late-sdk/models/create_ad_audience201_response.rb +156 -0
  59. data/lib/late-sdk/models/create_ad_audience_request.rb +391 -0
  60. data/lib/late-sdk/models/create_standalone_ad_request.rb +585 -0
  61. data/lib/late-sdk/models/get_ad200_response.rb +147 -0
  62. data/lib/late-sdk/models/get_ad_analytics200_response.rb +156 -0
  63. data/lib/late-sdk/models/get_ad_analytics200_response_ad.rb +174 -0
  64. data/lib/late-sdk/models/get_ad_analytics200_response_analytics.rb +169 -0
  65. data/lib/late-sdk/models/get_ad_analytics200_response_analytics_daily_inner.rb +238 -0
  66. data/lib/late-sdk/models/get_ad_audience200_response.rb +157 -0
  67. data/lib/late-sdk/models/list_ad_accounts200_response.rb +149 -0
  68. data/lib/late-sdk/models/list_ad_accounts200_response_accounts_inner.rb +175 -0
  69. data/lib/late-sdk/models/list_ad_audiences200_response.rb +149 -0
  70. data/lib/late-sdk/models/list_ad_audiences200_response_audiences_inner.rb +244 -0
  71. data/lib/late-sdk/models/list_ad_campaigns200_response.rb +158 -0
  72. data/lib/late-sdk/models/list_ads200_response.rb +158 -0
  73. data/lib/late-sdk/models/search_ad_interests200_response.rb +149 -0
  74. data/lib/late-sdk/models/search_ad_interests200_response_interests_inner.rb +165 -0
  75. data/lib/late-sdk/models/sync_external_ads200_response.rb +177 -0
  76. data/lib/late-sdk/models/update_ad200_response.rb +156 -0
  77. data/lib/late-sdk/models/update_ad_campaign_status200_response.rb +169 -0
  78. data/lib/late-sdk/models/update_ad_campaign_status_request.rb +216 -0
  79. data/lib/late-sdk/models/update_ad_request.rb +208 -0
  80. data/lib/late-sdk/models/update_ad_request_budget.rb +191 -0
  81. data/lib/late-sdk/models/update_ad_request_targeting.rb +235 -0
  82. data/lib/late-sdk/models/update_post_metadata_request.rb +34 -4
  83. data/lib/late-sdk/version.rb +1 -1
  84. data/lib/late-sdk.rb +39 -0
  85. data/openapi.yaml +693 -0
  86. data/spec/api/ad_audiences_api_spec.rb +98 -0
  87. data/spec/api/ad_campaigns_api_spec.rb +67 -0
  88. data/spec/api/ads_api_spec.rb +163 -0
  89. data/spec/models/ad_budget_spec.rb +46 -0
  90. data/spec/models/ad_campaign_spec.rb +110 -0
  91. data/spec/models/ad_metrics_spec.rb +84 -0
  92. data/spec/models/ad_schedule_spec.rb +42 -0
  93. data/spec/models/ad_spec.rb +172 -0
  94. data/spec/models/add_users_to_ad_audience200_response_spec.rb +48 -0
  95. data/spec/models/add_users_to_ad_audience_request_spec.rb +36 -0
  96. data/spec/models/add_users_to_ad_audience_request_users_inner_spec.rb +42 -0
  97. data/spec/models/boost_post_request_budget_spec.rb +46 -0
  98. data/spec/models/boost_post_request_schedule_spec.rb +42 -0
  99. data/spec/models/boost_post_request_spec.rb +94 -0
  100. data/spec/models/boost_post_request_targeting_spec.rb +54 -0
  101. data/spec/models/create_ad_audience201_response_spec.rb +42 -0
  102. data/spec/models/create_ad_audience_request_spec.rb +94 -0
  103. data/spec/models/create_standalone_ad_request_spec.rb +166 -0
  104. data/spec/models/get_ad200_response_spec.rb +36 -0
  105. data/spec/models/get_ad_analytics200_response_ad_spec.rb +54 -0
  106. data/spec/models/get_ad_analytics200_response_analytics_daily_inner_spec.rb +90 -0
  107. data/spec/models/get_ad_analytics200_response_analytics_spec.rb +48 -0
  108. data/spec/models/get_ad_analytics200_response_spec.rb +42 -0
  109. data/spec/models/get_ad_audience200_response_spec.rb +42 -0
  110. data/spec/models/list_ad_accounts200_response_accounts_inner_spec.rb +54 -0
  111. data/spec/models/list_ad_accounts200_response_spec.rb +36 -0
  112. data/spec/models/list_ad_audiences200_response_audiences_inner_spec.rb +82 -0
  113. data/spec/models/list_ad_audiences200_response_spec.rb +36 -0
  114. data/spec/models/list_ad_campaigns200_response_spec.rb +42 -0
  115. data/spec/models/list_ads200_response_spec.rb +42 -0
  116. data/spec/models/search_ad_interests200_response_interests_inner_spec.rb +48 -0
  117. data/spec/models/search_ad_interests200_response_spec.rb +36 -0
  118. data/spec/models/sync_external_ads200_response_spec.rb +54 -0
  119. data/spec/models/update_ad200_response_spec.rb +42 -0
  120. data/spec/models/update_ad_campaign_status200_response_spec.rb +48 -0
  121. data/spec/models/update_ad_campaign_status_request_spec.rb +50 -0
  122. data/spec/models/update_ad_request_budget_spec.rb +46 -0
  123. data/spec/models/update_ad_request_spec.rb +58 -0
  124. data/spec/models/update_ad_request_targeting_spec.rb +54 -0
  125. data/spec/models/update_post_metadata_request_spec.rb +18 -0
  126. data/zernio-sdk-0.0.99.gem +0 -0
  127. metadata +159 -3
  128. data/zernio-sdk-0.0.97.gem +0 -0
@@ -0,0 +1,175 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
5
+
6
+ The version of the OpenAPI document: 1.0.1
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Late
17
+ class ListAdAccounts200ResponseAccountsInner < ApiModelBase
18
+ # Platform ad account ID (e.g. act_123)
19
+ attr_accessor :id
20
+
21
+ attr_accessor :name
22
+
23
+ attr_accessor :currency
24
+
25
+ attr_accessor :status
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'id' => :'id',
31
+ :'name' => :'name',
32
+ :'currency' => :'currency',
33
+ :'status' => :'status'
34
+ }
35
+ end
36
+
37
+ # Returns attribute mapping this model knows about
38
+ def self.acceptable_attribute_map
39
+ attribute_map
40
+ end
41
+
42
+ # Returns all the JSON keys this model knows about
43
+ def self.acceptable_attributes
44
+ acceptable_attribute_map.values
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.openapi_types
49
+ {
50
+ :'id' => :'String',
51
+ :'name' => :'String',
52
+ :'currency' => :'String',
53
+ :'status' => :'String'
54
+ }
55
+ end
56
+
57
+ # List of attributes with nullable: true
58
+ def self.openapi_nullable
59
+ Set.new([
60
+ ])
61
+ end
62
+
63
+ # Initializes the object
64
+ # @param [Hash] attributes Model attributes in the form of hash
65
+ def initialize(attributes = {})
66
+ if (!attributes.is_a?(Hash))
67
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::ListAdAccounts200ResponseAccountsInner` initialize method"
68
+ end
69
+
70
+ # check to see if the attribute exists and convert string to symbol for hash key
71
+ acceptable_attribute_map = self.class.acceptable_attribute_map
72
+ attributes = attributes.each_with_object({}) { |(k, v), h|
73
+ if (!acceptable_attribute_map.key?(k.to_sym))
74
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::ListAdAccounts200ResponseAccountsInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
75
+ end
76
+ h[k.to_sym] = v
77
+ }
78
+
79
+ if attributes.key?(:'id')
80
+ self.id = attributes[:'id']
81
+ end
82
+
83
+ if attributes.key?(:'name')
84
+ self.name = attributes[:'name']
85
+ end
86
+
87
+ if attributes.key?(:'currency')
88
+ self.currency = attributes[:'currency']
89
+ end
90
+
91
+ if attributes.key?(:'status')
92
+ self.status = attributes[:'status']
93
+ end
94
+ end
95
+
96
+ # Show invalid properties with the reasons. Usually used together with valid?
97
+ # @return Array for valid properties with the reasons
98
+ def list_invalid_properties
99
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
100
+ invalid_properties = Array.new
101
+ invalid_properties
102
+ end
103
+
104
+ # Check to see if the all the properties in the model are valid
105
+ # @return true if the model is valid
106
+ def valid?
107
+ warn '[DEPRECATED] the `valid?` method is obsolete'
108
+ true
109
+ end
110
+
111
+ # Checks equality by comparing each attribute.
112
+ # @param [Object] Object to be compared
113
+ def ==(o)
114
+ return true if self.equal?(o)
115
+ self.class == o.class &&
116
+ id == o.id &&
117
+ name == o.name &&
118
+ currency == o.currency &&
119
+ status == o.status
120
+ end
121
+
122
+ # @see the `==` method
123
+ # @param [Object] Object to be compared
124
+ def eql?(o)
125
+ self == o
126
+ end
127
+
128
+ # Calculates hash code according to all attributes.
129
+ # @return [Integer] Hash code
130
+ def hash
131
+ [id, name, currency, status].hash
132
+ end
133
+
134
+ # Builds the object from hash
135
+ # @param [Hash] attributes Model attributes in the form of hash
136
+ # @return [Object] Returns the model itself
137
+ def self.build_from_hash(attributes)
138
+ return nil unless attributes.is_a?(Hash)
139
+ attributes = attributes.transform_keys(&:to_sym)
140
+ transformed_hash = {}
141
+ openapi_types.each_pair do |key, type|
142
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
143
+ transformed_hash["#{key}"] = nil
144
+ elsif type =~ /\AArray<(.*)>/i
145
+ # check to ensure the input is an array given that the attribute
146
+ # is documented as an array but the input is not
147
+ if attributes[attribute_map[key]].is_a?(Array)
148
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
149
+ end
150
+ elsif !attributes[attribute_map[key]].nil?
151
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
152
+ end
153
+ end
154
+ new(transformed_hash)
155
+ end
156
+
157
+ # Returns the object in the form of hash
158
+ # @return [Hash] Returns the object in the form of hash
159
+ def to_hash
160
+ hash = {}
161
+ self.class.attribute_map.each_pair do |attr, param|
162
+ value = self.send(attr)
163
+ if value.nil?
164
+ is_nullable = self.class.openapi_nullable.include?(attr)
165
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
166
+ end
167
+
168
+ hash[param] = _to_hash(value)
169
+ end
170
+ hash
171
+ end
172
+
173
+ end
174
+
175
+ end
@@ -0,0 +1,149 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
5
+
6
+ The version of the OpenAPI document: 1.0.1
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Late
17
+ class ListAdAudiences200Response < ApiModelBase
18
+ attr_accessor :audiences
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'audiences' => :'audiences'
24
+ }
25
+ end
26
+
27
+ # Returns attribute mapping this model knows about
28
+ def self.acceptable_attribute_map
29
+ attribute_map
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ acceptable_attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'audiences' => :'Array<ListAdAudiences200ResponseAudiencesInner>'
41
+ }
42
+ end
43
+
44
+ # List of attributes with nullable: true
45
+ def self.openapi_nullable
46
+ Set.new([
47
+ ])
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ if (!attributes.is_a?(Hash))
54
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::ListAdAudiences200Response` initialize method"
55
+ end
56
+
57
+ # check to see if the attribute exists and convert string to symbol for hash key
58
+ acceptable_attribute_map = self.class.acceptable_attribute_map
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!acceptable_attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::ListAdAudiences200Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'audiences')
67
+ if (value = attributes[:'audiences']).is_a?(Array)
68
+ self.audiences = value
69
+ end
70
+ end
71
+ end
72
+
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
77
+ invalid_properties = Array.new
78
+ invalid_properties
79
+ end
80
+
81
+ # Check to see if the all the properties in the model are valid
82
+ # @return true if the model is valid
83
+ def valid?
84
+ warn '[DEPRECATED] the `valid?` method is obsolete'
85
+ true
86
+ end
87
+
88
+ # Checks equality by comparing each attribute.
89
+ # @param [Object] Object to be compared
90
+ def ==(o)
91
+ return true if self.equal?(o)
92
+ self.class == o.class &&
93
+ audiences == o.audiences
94
+ end
95
+
96
+ # @see the `==` method
97
+ # @param [Object] Object to be compared
98
+ def eql?(o)
99
+ self == o
100
+ end
101
+
102
+ # Calculates hash code according to all attributes.
103
+ # @return [Integer] Hash code
104
+ def hash
105
+ [audiences].hash
106
+ end
107
+
108
+ # Builds the object from hash
109
+ # @param [Hash] attributes Model attributes in the form of hash
110
+ # @return [Object] Returns the model itself
111
+ def self.build_from_hash(attributes)
112
+ return nil unless attributes.is_a?(Hash)
113
+ attributes = attributes.transform_keys(&:to_sym)
114
+ transformed_hash = {}
115
+ openapi_types.each_pair do |key, type|
116
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
117
+ transformed_hash["#{key}"] = nil
118
+ elsif type =~ /\AArray<(.*)>/i
119
+ # check to ensure the input is an array given that the attribute
120
+ # is documented as an array but the input is not
121
+ if attributes[attribute_map[key]].is_a?(Array)
122
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
123
+ end
124
+ elsif !attributes[attribute_map[key]].nil?
125
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
126
+ end
127
+ end
128
+ new(transformed_hash)
129
+ end
130
+
131
+ # Returns the object in the form of hash
132
+ # @return [Hash] Returns the object in the form of hash
133
+ def to_hash
134
+ hash = {}
135
+ self.class.attribute_map.each_pair do |attr, param|
136
+ value = self.send(attr)
137
+ if value.nil?
138
+ is_nullable = self.class.openapi_nullable.include?(attr)
139
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
140
+ end
141
+
142
+ hash[param] = _to_hash(value)
143
+ end
144
+ hash
145
+ end
146
+
147
+ end
148
+
149
+ end
@@ -0,0 +1,244 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
5
+
6
+ The version of the OpenAPI document: 1.0.1
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Late
17
+ class ListAdAudiences200ResponseAudiencesInner < ApiModelBase
18
+ attr_accessor :id
19
+
20
+ attr_accessor :platform_audience_id
21
+
22
+ attr_accessor :name
23
+
24
+ attr_accessor :description
25
+
26
+ attr_accessor :type
27
+
28
+ attr_accessor :platform
29
+
30
+ attr_accessor :size
31
+
32
+ attr_accessor :status
33
+
34
+ class EnumAttributeValidator
35
+ attr_reader :datatype
36
+ attr_reader :allowable_values
37
+
38
+ def initialize(datatype, allowable_values)
39
+ @allowable_values = allowable_values.map do |value|
40
+ case datatype.to_s
41
+ when /Integer/i
42
+ value.to_i
43
+ when /Float/i
44
+ value.to_f
45
+ else
46
+ value
47
+ end
48
+ end
49
+ end
50
+
51
+ def valid?(value)
52
+ !value || allowable_values.include?(value)
53
+ end
54
+ end
55
+
56
+ # Attribute mapping from ruby-style variable name to JSON key.
57
+ def self.attribute_map
58
+ {
59
+ :'id' => :'id',
60
+ :'platform_audience_id' => :'platformAudienceId',
61
+ :'name' => :'name',
62
+ :'description' => :'description',
63
+ :'type' => :'type',
64
+ :'platform' => :'platform',
65
+ :'size' => :'size',
66
+ :'status' => :'status'
67
+ }
68
+ end
69
+
70
+ # Returns attribute mapping this model knows about
71
+ def self.acceptable_attribute_map
72
+ attribute_map
73
+ end
74
+
75
+ # Returns all the JSON keys this model knows about
76
+ def self.acceptable_attributes
77
+ acceptable_attribute_map.values
78
+ end
79
+
80
+ # Attribute type mapping.
81
+ def self.openapi_types
82
+ {
83
+ :'id' => :'String',
84
+ :'platform_audience_id' => :'String',
85
+ :'name' => :'String',
86
+ :'description' => :'String',
87
+ :'type' => :'String',
88
+ :'platform' => :'String',
89
+ :'size' => :'Integer',
90
+ :'status' => :'String'
91
+ }
92
+ end
93
+
94
+ # List of attributes with nullable: true
95
+ def self.openapi_nullable
96
+ Set.new([
97
+ ])
98
+ end
99
+
100
+ # Initializes the object
101
+ # @param [Hash] attributes Model attributes in the form of hash
102
+ def initialize(attributes = {})
103
+ if (!attributes.is_a?(Hash))
104
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::ListAdAudiences200ResponseAudiencesInner` initialize method"
105
+ end
106
+
107
+ # check to see if the attribute exists and convert string to symbol for hash key
108
+ acceptable_attribute_map = self.class.acceptable_attribute_map
109
+ attributes = attributes.each_with_object({}) { |(k, v), h|
110
+ if (!acceptable_attribute_map.key?(k.to_sym))
111
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::ListAdAudiences200ResponseAudiencesInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
112
+ end
113
+ h[k.to_sym] = v
114
+ }
115
+
116
+ if attributes.key?(:'id')
117
+ self.id = attributes[:'id']
118
+ end
119
+
120
+ if attributes.key?(:'platform_audience_id')
121
+ self.platform_audience_id = attributes[:'platform_audience_id']
122
+ end
123
+
124
+ if attributes.key?(:'name')
125
+ self.name = attributes[:'name']
126
+ end
127
+
128
+ if attributes.key?(:'description')
129
+ self.description = attributes[:'description']
130
+ end
131
+
132
+ if attributes.key?(:'type')
133
+ self.type = attributes[:'type']
134
+ end
135
+
136
+ if attributes.key?(:'platform')
137
+ self.platform = attributes[:'platform']
138
+ end
139
+
140
+ if attributes.key?(:'size')
141
+ self.size = attributes[:'size']
142
+ end
143
+
144
+ if attributes.key?(:'status')
145
+ self.status = attributes[:'status']
146
+ end
147
+ end
148
+
149
+ # Show invalid properties with the reasons. Usually used together with valid?
150
+ # @return Array for valid properties with the reasons
151
+ def list_invalid_properties
152
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
153
+ invalid_properties = Array.new
154
+ invalid_properties
155
+ end
156
+
157
+ # Check to see if the all the properties in the model are valid
158
+ # @return true if the model is valid
159
+ def valid?
160
+ warn '[DEPRECATED] the `valid?` method is obsolete'
161
+ type_validator = EnumAttributeValidator.new('String', ["customer_list", "website", "lookalike"])
162
+ return false unless type_validator.valid?(@type)
163
+ true
164
+ end
165
+
166
+ # Custom attribute writer method checking allowed values (enum).
167
+ # @param [Object] type Object to be assigned
168
+ def type=(type)
169
+ validator = EnumAttributeValidator.new('String', ["customer_list", "website", "lookalike"])
170
+ unless validator.valid?(type)
171
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
172
+ end
173
+ @type = type
174
+ end
175
+
176
+ # Checks equality by comparing each attribute.
177
+ # @param [Object] Object to be compared
178
+ def ==(o)
179
+ return true if self.equal?(o)
180
+ self.class == o.class &&
181
+ id == o.id &&
182
+ platform_audience_id == o.platform_audience_id &&
183
+ name == o.name &&
184
+ description == o.description &&
185
+ type == o.type &&
186
+ platform == o.platform &&
187
+ size == o.size &&
188
+ status == o.status
189
+ end
190
+
191
+ # @see the `==` method
192
+ # @param [Object] Object to be compared
193
+ def eql?(o)
194
+ self == o
195
+ end
196
+
197
+ # Calculates hash code according to all attributes.
198
+ # @return [Integer] Hash code
199
+ def hash
200
+ [id, platform_audience_id, name, description, type, platform, size, status].hash
201
+ end
202
+
203
+ # Builds the object from hash
204
+ # @param [Hash] attributes Model attributes in the form of hash
205
+ # @return [Object] Returns the model itself
206
+ def self.build_from_hash(attributes)
207
+ return nil unless attributes.is_a?(Hash)
208
+ attributes = attributes.transform_keys(&:to_sym)
209
+ transformed_hash = {}
210
+ openapi_types.each_pair do |key, type|
211
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
212
+ transformed_hash["#{key}"] = nil
213
+ elsif type =~ /\AArray<(.*)>/i
214
+ # check to ensure the input is an array given that the attribute
215
+ # is documented as an array but the input is not
216
+ if attributes[attribute_map[key]].is_a?(Array)
217
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
218
+ end
219
+ elsif !attributes[attribute_map[key]].nil?
220
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
221
+ end
222
+ end
223
+ new(transformed_hash)
224
+ end
225
+
226
+ # Returns the object in the form of hash
227
+ # @return [Hash] Returns the object in the form of hash
228
+ def to_hash
229
+ hash = {}
230
+ self.class.attribute_map.each_pair do |attr, param|
231
+ value = self.send(attr)
232
+ if value.nil?
233
+ is_nullable = self.class.openapi_nullable.include?(attr)
234
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
235
+ end
236
+
237
+ hash[param] = _to_hash(value)
238
+ end
239
+ hash
240
+ end
241
+
242
+ end
243
+
244
+ end