late-sdk 0.0.98 → 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 (125) 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/lib/late-sdk/api/ad_audiences_api.rb +368 -0
  43. data/lib/late-sdk/api/ad_campaigns_api.rb +201 -0
  44. data/lib/late-sdk/api/ads_api.rb +719 -0
  45. data/lib/late-sdk/models/ad.rb +399 -0
  46. data/lib/late-sdk/models/ad_budget.rb +190 -0
  47. data/lib/late-sdk/models/ad_campaign.rb +293 -0
  48. data/lib/late-sdk/models/ad_metrics.rb +222 -0
  49. data/lib/late-sdk/models/ad_schedule.rb +156 -0
  50. data/lib/late-sdk/models/add_users_to_ad_audience200_response.rb +165 -0
  51. data/lib/late-sdk/models/add_users_to_ad_audience_request.rb +175 -0
  52. data/lib/late-sdk/models/add_users_to_ad_audience_request_users_inner.rb +157 -0
  53. data/lib/late-sdk/models/boost_post_request.rb +350 -0
  54. data/lib/late-sdk/models/boost_post_request_budget.rb +215 -0
  55. data/lib/late-sdk/models/boost_post_request_schedule.rb +157 -0
  56. data/lib/late-sdk/models/boost_post_request_targeting.rb +234 -0
  57. data/lib/late-sdk/models/create_ad_audience201_response.rb +156 -0
  58. data/lib/late-sdk/models/create_ad_audience_request.rb +391 -0
  59. data/lib/late-sdk/models/create_standalone_ad_request.rb +585 -0
  60. data/lib/late-sdk/models/get_ad200_response.rb +147 -0
  61. data/lib/late-sdk/models/get_ad_analytics200_response.rb +156 -0
  62. data/lib/late-sdk/models/get_ad_analytics200_response_ad.rb +174 -0
  63. data/lib/late-sdk/models/get_ad_analytics200_response_analytics.rb +169 -0
  64. data/lib/late-sdk/models/get_ad_analytics200_response_analytics_daily_inner.rb +238 -0
  65. data/lib/late-sdk/models/get_ad_audience200_response.rb +157 -0
  66. data/lib/late-sdk/models/list_ad_accounts200_response.rb +149 -0
  67. data/lib/late-sdk/models/list_ad_accounts200_response_accounts_inner.rb +175 -0
  68. data/lib/late-sdk/models/list_ad_audiences200_response.rb +149 -0
  69. data/lib/late-sdk/models/list_ad_audiences200_response_audiences_inner.rb +244 -0
  70. data/lib/late-sdk/models/list_ad_campaigns200_response.rb +158 -0
  71. data/lib/late-sdk/models/list_ads200_response.rb +158 -0
  72. data/lib/late-sdk/models/search_ad_interests200_response.rb +149 -0
  73. data/lib/late-sdk/models/search_ad_interests200_response_interests_inner.rb +165 -0
  74. data/lib/late-sdk/models/sync_external_ads200_response.rb +177 -0
  75. data/lib/late-sdk/models/update_ad200_response.rb +156 -0
  76. data/lib/late-sdk/models/update_ad_campaign_status200_response.rb +169 -0
  77. data/lib/late-sdk/models/update_ad_campaign_status_request.rb +216 -0
  78. data/lib/late-sdk/models/update_ad_request.rb +208 -0
  79. data/lib/late-sdk/models/update_ad_request_budget.rb +191 -0
  80. data/lib/late-sdk/models/update_ad_request_targeting.rb +235 -0
  81. data/lib/late-sdk/version.rb +1 -1
  82. data/lib/late-sdk.rb +39 -0
  83. data/openapi.yaml +684 -0
  84. data/spec/api/ad_audiences_api_spec.rb +98 -0
  85. data/spec/api/ad_campaigns_api_spec.rb +67 -0
  86. data/spec/api/ads_api_spec.rb +163 -0
  87. data/spec/models/ad_budget_spec.rb +46 -0
  88. data/spec/models/ad_campaign_spec.rb +110 -0
  89. data/spec/models/ad_metrics_spec.rb +84 -0
  90. data/spec/models/ad_schedule_spec.rb +42 -0
  91. data/spec/models/ad_spec.rb +172 -0
  92. data/spec/models/add_users_to_ad_audience200_response_spec.rb +48 -0
  93. data/spec/models/add_users_to_ad_audience_request_spec.rb +36 -0
  94. data/spec/models/add_users_to_ad_audience_request_users_inner_spec.rb +42 -0
  95. data/spec/models/boost_post_request_budget_spec.rb +46 -0
  96. data/spec/models/boost_post_request_schedule_spec.rb +42 -0
  97. data/spec/models/boost_post_request_spec.rb +94 -0
  98. data/spec/models/boost_post_request_targeting_spec.rb +54 -0
  99. data/spec/models/create_ad_audience201_response_spec.rb +42 -0
  100. data/spec/models/create_ad_audience_request_spec.rb +94 -0
  101. data/spec/models/create_standalone_ad_request_spec.rb +166 -0
  102. data/spec/models/get_ad200_response_spec.rb +36 -0
  103. data/spec/models/get_ad_analytics200_response_ad_spec.rb +54 -0
  104. data/spec/models/get_ad_analytics200_response_analytics_daily_inner_spec.rb +90 -0
  105. data/spec/models/get_ad_analytics200_response_analytics_spec.rb +48 -0
  106. data/spec/models/get_ad_analytics200_response_spec.rb +42 -0
  107. data/spec/models/get_ad_audience200_response_spec.rb +42 -0
  108. data/spec/models/list_ad_accounts200_response_accounts_inner_spec.rb +54 -0
  109. data/spec/models/list_ad_accounts200_response_spec.rb +36 -0
  110. data/spec/models/list_ad_audiences200_response_audiences_inner_spec.rb +82 -0
  111. data/spec/models/list_ad_audiences200_response_spec.rb +36 -0
  112. data/spec/models/list_ad_campaigns200_response_spec.rb +42 -0
  113. data/spec/models/list_ads200_response_spec.rb +42 -0
  114. data/spec/models/search_ad_interests200_response_interests_inner_spec.rb +48 -0
  115. data/spec/models/search_ad_interests200_response_spec.rb +36 -0
  116. data/spec/models/sync_external_ads200_response_spec.rb +54 -0
  117. data/spec/models/update_ad200_response_spec.rb +42 -0
  118. data/spec/models/update_ad_campaign_status200_response_spec.rb +48 -0
  119. data/spec/models/update_ad_campaign_status_request_spec.rb +50 -0
  120. data/spec/models/update_ad_request_budget_spec.rb +46 -0
  121. data/spec/models/update_ad_request_spec.rb +58 -0
  122. data/spec/models/update_ad_request_targeting_spec.rb +54 -0
  123. data/zernio-sdk-0.0.99.gem +0 -0
  124. metadata +158 -2
  125. data/zernio-sdk-0.0.98.gem +0 -0
@@ -0,0 +1,293 @@
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 AdCampaign < ApiModelBase
18
+ attr_accessor :platform_campaign_id
19
+
20
+ attr_accessor :platform
21
+
22
+ attr_accessor :campaign_name
23
+
24
+ # Derived from child ad statuses
25
+ attr_accessor :status
26
+
27
+ attr_accessor :ad_count
28
+
29
+ attr_accessor :budget
30
+
31
+ attr_accessor :metrics
32
+
33
+ attr_accessor :platform_ad_account_id
34
+
35
+ attr_accessor :account_id
36
+
37
+ attr_accessor :profile_id
38
+
39
+ attr_accessor :earliest_ad
40
+
41
+ attr_accessor :latest_ad
42
+
43
+ class EnumAttributeValidator
44
+ attr_reader :datatype
45
+ attr_reader :allowable_values
46
+
47
+ def initialize(datatype, allowable_values)
48
+ @allowable_values = allowable_values.map do |value|
49
+ case datatype.to_s
50
+ when /Integer/i
51
+ value.to_i
52
+ when /Float/i
53
+ value.to_f
54
+ else
55
+ value
56
+ end
57
+ end
58
+ end
59
+
60
+ def valid?(value)
61
+ !value || allowable_values.include?(value)
62
+ end
63
+ end
64
+
65
+ # Attribute mapping from ruby-style variable name to JSON key.
66
+ def self.attribute_map
67
+ {
68
+ :'platform_campaign_id' => :'platformCampaignId',
69
+ :'platform' => :'platform',
70
+ :'campaign_name' => :'campaignName',
71
+ :'status' => :'status',
72
+ :'ad_count' => :'adCount',
73
+ :'budget' => :'budget',
74
+ :'metrics' => :'metrics',
75
+ :'platform_ad_account_id' => :'platformAdAccountId',
76
+ :'account_id' => :'accountId',
77
+ :'profile_id' => :'profileId',
78
+ :'earliest_ad' => :'earliestAd',
79
+ :'latest_ad' => :'latestAd'
80
+ }
81
+ end
82
+
83
+ # Returns attribute mapping this model knows about
84
+ def self.acceptable_attribute_map
85
+ attribute_map
86
+ end
87
+
88
+ # Returns all the JSON keys this model knows about
89
+ def self.acceptable_attributes
90
+ acceptable_attribute_map.values
91
+ end
92
+
93
+ # Attribute type mapping.
94
+ def self.openapi_types
95
+ {
96
+ :'platform_campaign_id' => :'String',
97
+ :'platform' => :'String',
98
+ :'campaign_name' => :'String',
99
+ :'status' => :'String',
100
+ :'ad_count' => :'Integer',
101
+ :'budget' => :'AdBudget',
102
+ :'metrics' => :'AdMetrics',
103
+ :'platform_ad_account_id' => :'String',
104
+ :'account_id' => :'String',
105
+ :'profile_id' => :'String',
106
+ :'earliest_ad' => :'Time',
107
+ :'latest_ad' => :'Time'
108
+ }
109
+ end
110
+
111
+ # List of attributes with nullable: true
112
+ def self.openapi_nullable
113
+ Set.new([
114
+ ])
115
+ end
116
+
117
+ # Initializes the object
118
+ # @param [Hash] attributes Model attributes in the form of hash
119
+ def initialize(attributes = {})
120
+ if (!attributes.is_a?(Hash))
121
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::AdCampaign` initialize method"
122
+ end
123
+
124
+ # check to see if the attribute exists and convert string to symbol for hash key
125
+ acceptable_attribute_map = self.class.acceptable_attribute_map
126
+ attributes = attributes.each_with_object({}) { |(k, v), h|
127
+ if (!acceptable_attribute_map.key?(k.to_sym))
128
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::AdCampaign`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
129
+ end
130
+ h[k.to_sym] = v
131
+ }
132
+
133
+ if attributes.key?(:'platform_campaign_id')
134
+ self.platform_campaign_id = attributes[:'platform_campaign_id']
135
+ end
136
+
137
+ if attributes.key?(:'platform')
138
+ self.platform = attributes[:'platform']
139
+ end
140
+
141
+ if attributes.key?(:'campaign_name')
142
+ self.campaign_name = attributes[:'campaign_name']
143
+ end
144
+
145
+ if attributes.key?(:'status')
146
+ self.status = attributes[:'status']
147
+ end
148
+
149
+ if attributes.key?(:'ad_count')
150
+ self.ad_count = attributes[:'ad_count']
151
+ end
152
+
153
+ if attributes.key?(:'budget')
154
+ self.budget = attributes[:'budget']
155
+ end
156
+
157
+ if attributes.key?(:'metrics')
158
+ self.metrics = attributes[:'metrics']
159
+ end
160
+
161
+ if attributes.key?(:'platform_ad_account_id')
162
+ self.platform_ad_account_id = attributes[:'platform_ad_account_id']
163
+ end
164
+
165
+ if attributes.key?(:'account_id')
166
+ self.account_id = attributes[:'account_id']
167
+ end
168
+
169
+ if attributes.key?(:'profile_id')
170
+ self.profile_id = attributes[:'profile_id']
171
+ end
172
+
173
+ if attributes.key?(:'earliest_ad')
174
+ self.earliest_ad = attributes[:'earliest_ad']
175
+ end
176
+
177
+ if attributes.key?(:'latest_ad')
178
+ self.latest_ad = attributes[:'latest_ad']
179
+ end
180
+ end
181
+
182
+ # Show invalid properties with the reasons. Usually used together with valid?
183
+ # @return Array for valid properties with the reasons
184
+ def list_invalid_properties
185
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
186
+ invalid_properties = Array.new
187
+ invalid_properties
188
+ end
189
+
190
+ # Check to see if the all the properties in the model are valid
191
+ # @return true if the model is valid
192
+ def valid?
193
+ warn '[DEPRECATED] the `valid?` method is obsolete'
194
+ platform_validator = EnumAttributeValidator.new('String', ["facebook", "instagram", "tiktok", "linkedin", "pinterest", "google", "twitter"])
195
+ return false unless platform_validator.valid?(@platform)
196
+ status_validator = EnumAttributeValidator.new('String', ["active", "paused", "pending_review", "rejected", "completed", "cancelled", "error"])
197
+ return false unless status_validator.valid?(@status)
198
+ true
199
+ end
200
+
201
+ # Custom attribute writer method checking allowed values (enum).
202
+ # @param [Object] platform Object to be assigned
203
+ def platform=(platform)
204
+ validator = EnumAttributeValidator.new('String', ["facebook", "instagram", "tiktok", "linkedin", "pinterest", "google", "twitter"])
205
+ unless validator.valid?(platform)
206
+ fail ArgumentError, "invalid value for \"platform\", must be one of #{validator.allowable_values}."
207
+ end
208
+ @platform = platform
209
+ end
210
+
211
+ # Custom attribute writer method checking allowed values (enum).
212
+ # @param [Object] status Object to be assigned
213
+ def status=(status)
214
+ validator = EnumAttributeValidator.new('String', ["active", "paused", "pending_review", "rejected", "completed", "cancelled", "error"])
215
+ unless validator.valid?(status)
216
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
217
+ end
218
+ @status = status
219
+ end
220
+
221
+ # Checks equality by comparing each attribute.
222
+ # @param [Object] Object to be compared
223
+ def ==(o)
224
+ return true if self.equal?(o)
225
+ self.class == o.class &&
226
+ platform_campaign_id == o.platform_campaign_id &&
227
+ platform == o.platform &&
228
+ campaign_name == o.campaign_name &&
229
+ status == o.status &&
230
+ ad_count == o.ad_count &&
231
+ budget == o.budget &&
232
+ metrics == o.metrics &&
233
+ platform_ad_account_id == o.platform_ad_account_id &&
234
+ account_id == o.account_id &&
235
+ profile_id == o.profile_id &&
236
+ earliest_ad == o.earliest_ad &&
237
+ latest_ad == o.latest_ad
238
+ end
239
+
240
+ # @see the `==` method
241
+ # @param [Object] Object to be compared
242
+ def eql?(o)
243
+ self == o
244
+ end
245
+
246
+ # Calculates hash code according to all attributes.
247
+ # @return [Integer] Hash code
248
+ def hash
249
+ [platform_campaign_id, platform, campaign_name, status, ad_count, budget, metrics, platform_ad_account_id, account_id, profile_id, earliest_ad, latest_ad].hash
250
+ end
251
+
252
+ # Builds the object from hash
253
+ # @param [Hash] attributes Model attributes in the form of hash
254
+ # @return [Object] Returns the model itself
255
+ def self.build_from_hash(attributes)
256
+ return nil unless attributes.is_a?(Hash)
257
+ attributes = attributes.transform_keys(&:to_sym)
258
+ transformed_hash = {}
259
+ openapi_types.each_pair do |key, type|
260
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
261
+ transformed_hash["#{key}"] = nil
262
+ elsif type =~ /\AArray<(.*)>/i
263
+ # check to ensure the input is an array given that the attribute
264
+ # is documented as an array but the input is not
265
+ if attributes[attribute_map[key]].is_a?(Array)
266
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
267
+ end
268
+ elsif !attributes[attribute_map[key]].nil?
269
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
270
+ end
271
+ end
272
+ new(transformed_hash)
273
+ end
274
+
275
+ # Returns the object in the form of hash
276
+ # @return [Hash] Returns the object in the form of hash
277
+ def to_hash
278
+ hash = {}
279
+ self.class.attribute_map.each_pair do |attr, param|
280
+ value = self.send(attr)
281
+ if value.nil?
282
+ is_nullable = self.class.openapi_nullable.include?(attr)
283
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
284
+ end
285
+
286
+ hash[param] = _to_hash(value)
287
+ end
288
+ hash
289
+ end
290
+
291
+ end
292
+
293
+ end
@@ -0,0 +1,222 @@
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 AdMetrics < ApiModelBase
18
+ attr_accessor :spend
19
+
20
+ attr_accessor :impressions
21
+
22
+ attr_accessor :reach
23
+
24
+ attr_accessor :clicks
25
+
26
+ # Click-through rate (%)
27
+ attr_accessor :ctr
28
+
29
+ # Cost per click
30
+ attr_accessor :cpc
31
+
32
+ # Cost per 1000 impressions
33
+ attr_accessor :cpm
34
+
35
+ attr_accessor :engagement
36
+
37
+ attr_accessor :last_synced_at
38
+
39
+ # Attribute mapping from ruby-style variable name to JSON key.
40
+ def self.attribute_map
41
+ {
42
+ :'spend' => :'spend',
43
+ :'impressions' => :'impressions',
44
+ :'reach' => :'reach',
45
+ :'clicks' => :'clicks',
46
+ :'ctr' => :'ctr',
47
+ :'cpc' => :'cpc',
48
+ :'cpm' => :'cpm',
49
+ :'engagement' => :'engagement',
50
+ :'last_synced_at' => :'lastSyncedAt'
51
+ }
52
+ end
53
+
54
+ # Returns attribute mapping this model knows about
55
+ def self.acceptable_attribute_map
56
+ attribute_map
57
+ end
58
+
59
+ # Returns all the JSON keys this model knows about
60
+ def self.acceptable_attributes
61
+ acceptable_attribute_map.values
62
+ end
63
+
64
+ # Attribute type mapping.
65
+ def self.openapi_types
66
+ {
67
+ :'spend' => :'Float',
68
+ :'impressions' => :'Integer',
69
+ :'reach' => :'Integer',
70
+ :'clicks' => :'Integer',
71
+ :'ctr' => :'Float',
72
+ :'cpc' => :'Float',
73
+ :'cpm' => :'Float',
74
+ :'engagement' => :'Integer',
75
+ :'last_synced_at' => :'Time'
76
+ }
77
+ end
78
+
79
+ # List of attributes with nullable: true
80
+ def self.openapi_nullable
81
+ Set.new([
82
+ ])
83
+ end
84
+
85
+ # Initializes the object
86
+ # @param [Hash] attributes Model attributes in the form of hash
87
+ def initialize(attributes = {})
88
+ if (!attributes.is_a?(Hash))
89
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::AdMetrics` initialize method"
90
+ end
91
+
92
+ # check to see if the attribute exists and convert string to symbol for hash key
93
+ acceptable_attribute_map = self.class.acceptable_attribute_map
94
+ attributes = attributes.each_with_object({}) { |(k, v), h|
95
+ if (!acceptable_attribute_map.key?(k.to_sym))
96
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::AdMetrics`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
97
+ end
98
+ h[k.to_sym] = v
99
+ }
100
+
101
+ if attributes.key?(:'spend')
102
+ self.spend = attributes[:'spend']
103
+ end
104
+
105
+ if attributes.key?(:'impressions')
106
+ self.impressions = attributes[:'impressions']
107
+ end
108
+
109
+ if attributes.key?(:'reach')
110
+ self.reach = attributes[:'reach']
111
+ end
112
+
113
+ if attributes.key?(:'clicks')
114
+ self.clicks = attributes[:'clicks']
115
+ end
116
+
117
+ if attributes.key?(:'ctr')
118
+ self.ctr = attributes[:'ctr']
119
+ end
120
+
121
+ if attributes.key?(:'cpc')
122
+ self.cpc = attributes[:'cpc']
123
+ end
124
+
125
+ if attributes.key?(:'cpm')
126
+ self.cpm = attributes[:'cpm']
127
+ end
128
+
129
+ if attributes.key?(:'engagement')
130
+ self.engagement = attributes[:'engagement']
131
+ end
132
+
133
+ if attributes.key?(:'last_synced_at')
134
+ self.last_synced_at = attributes[:'last_synced_at']
135
+ end
136
+ end
137
+
138
+ # Show invalid properties with the reasons. Usually used together with valid?
139
+ # @return Array for valid properties with the reasons
140
+ def list_invalid_properties
141
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
142
+ invalid_properties = Array.new
143
+ invalid_properties
144
+ end
145
+
146
+ # Check to see if the all the properties in the model are valid
147
+ # @return true if the model is valid
148
+ def valid?
149
+ warn '[DEPRECATED] the `valid?` method is obsolete'
150
+ true
151
+ end
152
+
153
+ # Checks equality by comparing each attribute.
154
+ # @param [Object] Object to be compared
155
+ def ==(o)
156
+ return true if self.equal?(o)
157
+ self.class == o.class &&
158
+ spend == o.spend &&
159
+ impressions == o.impressions &&
160
+ reach == o.reach &&
161
+ clicks == o.clicks &&
162
+ ctr == o.ctr &&
163
+ cpc == o.cpc &&
164
+ cpm == o.cpm &&
165
+ engagement == o.engagement &&
166
+ last_synced_at == o.last_synced_at
167
+ end
168
+
169
+ # @see the `==` method
170
+ # @param [Object] Object to be compared
171
+ def eql?(o)
172
+ self == o
173
+ end
174
+
175
+ # Calculates hash code according to all attributes.
176
+ # @return [Integer] Hash code
177
+ def hash
178
+ [spend, impressions, reach, clicks, ctr, cpc, cpm, engagement, last_synced_at].hash
179
+ end
180
+
181
+ # Builds the object from hash
182
+ # @param [Hash] attributes Model attributes in the form of hash
183
+ # @return [Object] Returns the model itself
184
+ def self.build_from_hash(attributes)
185
+ return nil unless attributes.is_a?(Hash)
186
+ attributes = attributes.transform_keys(&:to_sym)
187
+ transformed_hash = {}
188
+ openapi_types.each_pair do |key, type|
189
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
190
+ transformed_hash["#{key}"] = nil
191
+ elsif type =~ /\AArray<(.*)>/i
192
+ # check to ensure the input is an array given that the attribute
193
+ # is documented as an array but the input is not
194
+ if attributes[attribute_map[key]].is_a?(Array)
195
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
196
+ end
197
+ elsif !attributes[attribute_map[key]].nil?
198
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
199
+ end
200
+ end
201
+ new(transformed_hash)
202
+ end
203
+
204
+ # Returns the object in the form of hash
205
+ # @return [Hash] Returns the object in the form of hash
206
+ def to_hash
207
+ hash = {}
208
+ self.class.attribute_map.each_pair do |attr, param|
209
+ value = self.send(attr)
210
+ if value.nil?
211
+ is_nullable = self.class.openapi_nullable.include?(attr)
212
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
213
+ end
214
+
215
+ hash[param] = _to_hash(value)
216
+ end
217
+ hash
218
+ end
219
+
220
+ end
221
+
222
+ end
@@ -0,0 +1,156 @@
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 AdSchedule < ApiModelBase
18
+ attr_accessor :start_date
19
+
20
+ attr_accessor :end_date
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'start_date' => :'startDate',
26
+ :'end_date' => :'endDate'
27
+ }
28
+ end
29
+
30
+ # Returns attribute mapping this model knows about
31
+ def self.acceptable_attribute_map
32
+ attribute_map
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ acceptable_attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'start_date' => :'Time',
44
+ :'end_date' => :'Time'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ ])
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::AdSchedule` initialize method"
59
+ end
60
+
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ acceptable_attribute_map = self.class.acceptable_attribute_map
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!acceptable_attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::AdSchedule`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'start_date')
71
+ self.start_date = attributes[:'start_date']
72
+ end
73
+
74
+ if attributes.key?(:'end_date')
75
+ self.end_date = attributes[:'end_date']
76
+ end
77
+ end
78
+
79
+ # Show invalid properties with the reasons. Usually used together with valid?
80
+ # @return Array for valid properties with the reasons
81
+ def list_invalid_properties
82
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
83
+ invalid_properties = Array.new
84
+ invalid_properties
85
+ end
86
+
87
+ # Check to see if the all the properties in the model are valid
88
+ # @return true if the model is valid
89
+ def valid?
90
+ warn '[DEPRECATED] the `valid?` method is obsolete'
91
+ true
92
+ end
93
+
94
+ # Checks equality by comparing each attribute.
95
+ # @param [Object] Object to be compared
96
+ def ==(o)
97
+ return true if self.equal?(o)
98
+ self.class == o.class &&
99
+ start_date == o.start_date &&
100
+ end_date == o.end_date
101
+ end
102
+
103
+ # @see the `==` method
104
+ # @param [Object] Object to be compared
105
+ def eql?(o)
106
+ self == o
107
+ end
108
+
109
+ # Calculates hash code according to all attributes.
110
+ # @return [Integer] Hash code
111
+ def hash
112
+ [start_date, end_date].hash
113
+ end
114
+
115
+ # Builds the object from hash
116
+ # @param [Hash] attributes Model attributes in the form of hash
117
+ # @return [Object] Returns the model itself
118
+ def self.build_from_hash(attributes)
119
+ return nil unless attributes.is_a?(Hash)
120
+ attributes = attributes.transform_keys(&:to_sym)
121
+ transformed_hash = {}
122
+ openapi_types.each_pair do |key, type|
123
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
124
+ transformed_hash["#{key}"] = nil
125
+ elsif type =~ /\AArray<(.*)>/i
126
+ # check to ensure the input is an array given that the attribute
127
+ # is documented as an array but the input is not
128
+ if attributes[attribute_map[key]].is_a?(Array)
129
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
130
+ end
131
+ elsif !attributes[attribute_map[key]].nil?
132
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
133
+ end
134
+ end
135
+ new(transformed_hash)
136
+ end
137
+
138
+ # Returns the object in the form of hash
139
+ # @return [Hash] Returns the object in the form of hash
140
+ def to_hash
141
+ hash = {}
142
+ self.class.attribute_map.each_pair do |attr, param|
143
+ value = self.send(attr)
144
+ if value.nil?
145
+ is_nullable = self.class.openapi_nullable.include?(attr)
146
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
147
+ end
148
+
149
+ hash[param] = _to_hash(value)
150
+ end
151
+ hash
152
+ end
153
+
154
+ end
155
+
156
+ end