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,216 @@
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 UpdateAdCampaignStatusRequest < ApiModelBase
18
+ attr_accessor :status
19
+
20
+ attr_accessor :platform
21
+
22
+ class EnumAttributeValidator
23
+ attr_reader :datatype
24
+ attr_reader :allowable_values
25
+
26
+ def initialize(datatype, allowable_values)
27
+ @allowable_values = allowable_values.map do |value|
28
+ case datatype.to_s
29
+ when /Integer/i
30
+ value.to_i
31
+ when /Float/i
32
+ value.to_f
33
+ else
34
+ value
35
+ end
36
+ end
37
+ end
38
+
39
+ def valid?(value)
40
+ !value || allowable_values.include?(value)
41
+ end
42
+ end
43
+
44
+ # Attribute mapping from ruby-style variable name to JSON key.
45
+ def self.attribute_map
46
+ {
47
+ :'status' => :'status',
48
+ :'platform' => :'platform'
49
+ }
50
+ end
51
+
52
+ # Returns attribute mapping this model knows about
53
+ def self.acceptable_attribute_map
54
+ attribute_map
55
+ end
56
+
57
+ # Returns all the JSON keys this model knows about
58
+ def self.acceptable_attributes
59
+ acceptable_attribute_map.values
60
+ end
61
+
62
+ # Attribute type mapping.
63
+ def self.openapi_types
64
+ {
65
+ :'status' => :'String',
66
+ :'platform' => :'String'
67
+ }
68
+ end
69
+
70
+ # List of attributes with nullable: true
71
+ def self.openapi_nullable
72
+ Set.new([
73
+ ])
74
+ end
75
+
76
+ # Initializes the object
77
+ # @param [Hash] attributes Model attributes in the form of hash
78
+ def initialize(attributes = {})
79
+ if (!attributes.is_a?(Hash))
80
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::UpdateAdCampaignStatusRequest` initialize method"
81
+ end
82
+
83
+ # check to see if the attribute exists and convert string to symbol for hash key
84
+ acceptable_attribute_map = self.class.acceptable_attribute_map
85
+ attributes = attributes.each_with_object({}) { |(k, v), h|
86
+ if (!acceptable_attribute_map.key?(k.to_sym))
87
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::UpdateAdCampaignStatusRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
88
+ end
89
+ h[k.to_sym] = v
90
+ }
91
+
92
+ if attributes.key?(:'status')
93
+ self.status = attributes[:'status']
94
+ else
95
+ self.status = nil
96
+ end
97
+
98
+ if attributes.key?(:'platform')
99
+ self.platform = attributes[:'platform']
100
+ else
101
+ self.platform = nil
102
+ end
103
+ end
104
+
105
+ # Show invalid properties with the reasons. Usually used together with valid?
106
+ # @return Array for valid properties with the reasons
107
+ def list_invalid_properties
108
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
109
+ invalid_properties = Array.new
110
+ if @status.nil?
111
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
112
+ end
113
+
114
+ if @platform.nil?
115
+ invalid_properties.push('invalid value for "platform", platform cannot be nil.')
116
+ end
117
+
118
+ invalid_properties
119
+ end
120
+
121
+ # Check to see if the all the properties in the model are valid
122
+ # @return true if the model is valid
123
+ def valid?
124
+ warn '[DEPRECATED] the `valid?` method is obsolete'
125
+ return false if @status.nil?
126
+ status_validator = EnumAttributeValidator.new('String', ["active", "paused"])
127
+ return false unless status_validator.valid?(@status)
128
+ return false if @platform.nil?
129
+ platform_validator = EnumAttributeValidator.new('String', ["facebook", "instagram", "tiktok", "linkedin", "pinterest", "google", "twitter"])
130
+ return false unless platform_validator.valid?(@platform)
131
+ true
132
+ end
133
+
134
+ # Custom attribute writer method checking allowed values (enum).
135
+ # @param [Object] status Object to be assigned
136
+ def status=(status)
137
+ validator = EnumAttributeValidator.new('String', ["active", "paused"])
138
+ unless validator.valid?(status)
139
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
140
+ end
141
+ @status = status
142
+ end
143
+
144
+ # Custom attribute writer method checking allowed values (enum).
145
+ # @param [Object] platform Object to be assigned
146
+ def platform=(platform)
147
+ validator = EnumAttributeValidator.new('String', ["facebook", "instagram", "tiktok", "linkedin", "pinterest", "google", "twitter"])
148
+ unless validator.valid?(platform)
149
+ fail ArgumentError, "invalid value for \"platform\", must be one of #{validator.allowable_values}."
150
+ end
151
+ @platform = platform
152
+ end
153
+
154
+ # Checks equality by comparing each attribute.
155
+ # @param [Object] Object to be compared
156
+ def ==(o)
157
+ return true if self.equal?(o)
158
+ self.class == o.class &&
159
+ status == o.status &&
160
+ platform == o.platform
161
+ end
162
+
163
+ # @see the `==` method
164
+ # @param [Object] Object to be compared
165
+ def eql?(o)
166
+ self == o
167
+ end
168
+
169
+ # Calculates hash code according to all attributes.
170
+ # @return [Integer] Hash code
171
+ def hash
172
+ [status, platform].hash
173
+ end
174
+
175
+ # Builds the object from hash
176
+ # @param [Hash] attributes Model attributes in the form of hash
177
+ # @return [Object] Returns the model itself
178
+ def self.build_from_hash(attributes)
179
+ return nil unless attributes.is_a?(Hash)
180
+ attributes = attributes.transform_keys(&:to_sym)
181
+ transformed_hash = {}
182
+ openapi_types.each_pair do |key, type|
183
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
184
+ transformed_hash["#{key}"] = nil
185
+ elsif type =~ /\AArray<(.*)>/i
186
+ # check to ensure the input is an array given that the attribute
187
+ # is documented as an array but the input is not
188
+ if attributes[attribute_map[key]].is_a?(Array)
189
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
190
+ end
191
+ elsif !attributes[attribute_map[key]].nil?
192
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
193
+ end
194
+ end
195
+ new(transformed_hash)
196
+ end
197
+
198
+ # Returns the object in the form of hash
199
+ # @return [Hash] Returns the object in the form of hash
200
+ def to_hash
201
+ hash = {}
202
+ self.class.attribute_map.each_pair do |attr, param|
203
+ value = self.send(attr)
204
+ if value.nil?
205
+ is_nullable = self.class.openapi_nullable.include?(attr)
206
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
207
+ end
208
+
209
+ hash[param] = _to_hash(value)
210
+ end
211
+ hash
212
+ end
213
+
214
+ end
215
+
216
+ end
@@ -0,0 +1,208 @@
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 UpdateAdRequest < ApiModelBase
18
+ attr_accessor :status
19
+
20
+ attr_accessor :budget
21
+
22
+ attr_accessor :targeting
23
+
24
+ attr_accessor :name
25
+
26
+ class EnumAttributeValidator
27
+ attr_reader :datatype
28
+ attr_reader :allowable_values
29
+
30
+ def initialize(datatype, allowable_values)
31
+ @allowable_values = allowable_values.map do |value|
32
+ case datatype.to_s
33
+ when /Integer/i
34
+ value.to_i
35
+ when /Float/i
36
+ value.to_f
37
+ else
38
+ value
39
+ end
40
+ end
41
+ end
42
+
43
+ def valid?(value)
44
+ !value || allowable_values.include?(value)
45
+ end
46
+ end
47
+
48
+ # Attribute mapping from ruby-style variable name to JSON key.
49
+ def self.attribute_map
50
+ {
51
+ :'status' => :'status',
52
+ :'budget' => :'budget',
53
+ :'targeting' => :'targeting',
54
+ :'name' => :'name'
55
+ }
56
+ end
57
+
58
+ # Returns attribute mapping this model knows about
59
+ def self.acceptable_attribute_map
60
+ attribute_map
61
+ end
62
+
63
+ # Returns all the JSON keys this model knows about
64
+ def self.acceptable_attributes
65
+ acceptable_attribute_map.values
66
+ end
67
+
68
+ # Attribute type mapping.
69
+ def self.openapi_types
70
+ {
71
+ :'status' => :'String',
72
+ :'budget' => :'UpdateAdRequestBudget',
73
+ :'targeting' => :'UpdateAdRequestTargeting',
74
+ :'name' => :'String'
75
+ }
76
+ end
77
+
78
+ # List of attributes with nullable: true
79
+ def self.openapi_nullable
80
+ Set.new([
81
+ ])
82
+ end
83
+
84
+ # Initializes the object
85
+ # @param [Hash] attributes Model attributes in the form of hash
86
+ def initialize(attributes = {})
87
+ if (!attributes.is_a?(Hash))
88
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::UpdateAdRequest` initialize method"
89
+ end
90
+
91
+ # check to see if the attribute exists and convert string to symbol for hash key
92
+ acceptable_attribute_map = self.class.acceptable_attribute_map
93
+ attributes = attributes.each_with_object({}) { |(k, v), h|
94
+ if (!acceptable_attribute_map.key?(k.to_sym))
95
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::UpdateAdRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
96
+ end
97
+ h[k.to_sym] = v
98
+ }
99
+
100
+ if attributes.key?(:'status')
101
+ self.status = attributes[:'status']
102
+ end
103
+
104
+ if attributes.key?(:'budget')
105
+ self.budget = attributes[:'budget']
106
+ end
107
+
108
+ if attributes.key?(:'targeting')
109
+ self.targeting = attributes[:'targeting']
110
+ end
111
+
112
+ if attributes.key?(:'name')
113
+ self.name = attributes[:'name']
114
+ end
115
+ end
116
+
117
+ # Show invalid properties with the reasons. Usually used together with valid?
118
+ # @return Array for valid properties with the reasons
119
+ def list_invalid_properties
120
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
121
+ invalid_properties = Array.new
122
+ invalid_properties
123
+ end
124
+
125
+ # Check to see if the all the properties in the model are valid
126
+ # @return true if the model is valid
127
+ def valid?
128
+ warn '[DEPRECATED] the `valid?` method is obsolete'
129
+ status_validator = EnumAttributeValidator.new('String', ["active", "paused"])
130
+ return false unless status_validator.valid?(@status)
131
+ true
132
+ end
133
+
134
+ # Custom attribute writer method checking allowed values (enum).
135
+ # @param [Object] status Object to be assigned
136
+ def status=(status)
137
+ validator = EnumAttributeValidator.new('String', ["active", "paused"])
138
+ unless validator.valid?(status)
139
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
140
+ end
141
+ @status = status
142
+ end
143
+
144
+ # Checks equality by comparing each attribute.
145
+ # @param [Object] Object to be compared
146
+ def ==(o)
147
+ return true if self.equal?(o)
148
+ self.class == o.class &&
149
+ status == o.status &&
150
+ budget == o.budget &&
151
+ targeting == o.targeting &&
152
+ name == o.name
153
+ end
154
+
155
+ # @see the `==` method
156
+ # @param [Object] Object to be compared
157
+ def eql?(o)
158
+ self == o
159
+ end
160
+
161
+ # Calculates hash code according to all attributes.
162
+ # @return [Integer] Hash code
163
+ def hash
164
+ [status, budget, targeting, name].hash
165
+ end
166
+
167
+ # Builds the object from hash
168
+ # @param [Hash] attributes Model attributes in the form of hash
169
+ # @return [Object] Returns the model itself
170
+ def self.build_from_hash(attributes)
171
+ return nil unless attributes.is_a?(Hash)
172
+ attributes = attributes.transform_keys(&:to_sym)
173
+ transformed_hash = {}
174
+ openapi_types.each_pair do |key, type|
175
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
176
+ transformed_hash["#{key}"] = nil
177
+ elsif type =~ /\AArray<(.*)>/i
178
+ # check to ensure the input is an array given that the attribute
179
+ # is documented as an array but the input is not
180
+ if attributes[attribute_map[key]].is_a?(Array)
181
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
182
+ end
183
+ elsif !attributes[attribute_map[key]].nil?
184
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
185
+ end
186
+ end
187
+ new(transformed_hash)
188
+ end
189
+
190
+ # Returns the object in the form of hash
191
+ # @return [Hash] Returns the object in the form of hash
192
+ def to_hash
193
+ hash = {}
194
+ self.class.attribute_map.each_pair do |attr, param|
195
+ value = self.send(attr)
196
+ if value.nil?
197
+ is_nullable = self.class.openapi_nullable.include?(attr)
198
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
199
+ end
200
+
201
+ hash[param] = _to_hash(value)
202
+ end
203
+ hash
204
+ end
205
+
206
+ end
207
+
208
+ end
@@ -0,0 +1,191 @@
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 UpdateAdRequestBudget < ApiModelBase
18
+ # Minimum varies by platform: TikTok=$20, Pinterest=$5, others=$1
19
+ attr_accessor :amount
20
+
21
+ attr_accessor :type
22
+
23
+ class EnumAttributeValidator
24
+ attr_reader :datatype
25
+ attr_reader :allowable_values
26
+
27
+ def initialize(datatype, allowable_values)
28
+ @allowable_values = allowable_values.map do |value|
29
+ case datatype.to_s
30
+ when /Integer/i
31
+ value.to_i
32
+ when /Float/i
33
+ value.to_f
34
+ else
35
+ value
36
+ end
37
+ end
38
+ end
39
+
40
+ def valid?(value)
41
+ !value || allowable_values.include?(value)
42
+ end
43
+ end
44
+
45
+ # Attribute mapping from ruby-style variable name to JSON key.
46
+ def self.attribute_map
47
+ {
48
+ :'amount' => :'amount',
49
+ :'type' => :'type'
50
+ }
51
+ end
52
+
53
+ # Returns attribute mapping this model knows about
54
+ def self.acceptable_attribute_map
55
+ attribute_map
56
+ end
57
+
58
+ # Returns all the JSON keys this model knows about
59
+ def self.acceptable_attributes
60
+ acceptable_attribute_map.values
61
+ end
62
+
63
+ # Attribute type mapping.
64
+ def self.openapi_types
65
+ {
66
+ :'amount' => :'Float',
67
+ :'type' => :'String'
68
+ }
69
+ end
70
+
71
+ # List of attributes with nullable: true
72
+ def self.openapi_nullable
73
+ Set.new([
74
+ ])
75
+ end
76
+
77
+ # Initializes the object
78
+ # @param [Hash] attributes Model attributes in the form of hash
79
+ def initialize(attributes = {})
80
+ if (!attributes.is_a?(Hash))
81
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Late::UpdateAdRequestBudget` initialize method"
82
+ end
83
+
84
+ # check to see if the attribute exists and convert string to symbol for hash key
85
+ acceptable_attribute_map = self.class.acceptable_attribute_map
86
+ attributes = attributes.each_with_object({}) { |(k, v), h|
87
+ if (!acceptable_attribute_map.key?(k.to_sym))
88
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Late::UpdateAdRequestBudget`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
89
+ end
90
+ h[k.to_sym] = v
91
+ }
92
+
93
+ if attributes.key?(:'amount')
94
+ self.amount = attributes[:'amount']
95
+ end
96
+
97
+ if attributes.key?(:'type')
98
+ self.type = attributes[:'type']
99
+ end
100
+ end
101
+
102
+ # Show invalid properties with the reasons. Usually used together with valid?
103
+ # @return Array for valid properties with the reasons
104
+ def list_invalid_properties
105
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
106
+ invalid_properties = Array.new
107
+ invalid_properties
108
+ end
109
+
110
+ # Check to see if the all the properties in the model are valid
111
+ # @return true if the model is valid
112
+ def valid?
113
+ warn '[DEPRECATED] the `valid?` method is obsolete'
114
+ type_validator = EnumAttributeValidator.new('String', ["daily", "lifetime"])
115
+ return false unless type_validator.valid?(@type)
116
+ true
117
+ end
118
+
119
+ # Custom attribute writer method checking allowed values (enum).
120
+ # @param [Object] type Object to be assigned
121
+ def type=(type)
122
+ validator = EnumAttributeValidator.new('String', ["daily", "lifetime"])
123
+ unless validator.valid?(type)
124
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
125
+ end
126
+ @type = type
127
+ end
128
+
129
+ # Checks equality by comparing each attribute.
130
+ # @param [Object] Object to be compared
131
+ def ==(o)
132
+ return true if self.equal?(o)
133
+ self.class == o.class &&
134
+ amount == o.amount &&
135
+ type == o.type
136
+ end
137
+
138
+ # @see the `==` method
139
+ # @param [Object] Object to be compared
140
+ def eql?(o)
141
+ self == o
142
+ end
143
+
144
+ # Calculates hash code according to all attributes.
145
+ # @return [Integer] Hash code
146
+ def hash
147
+ [amount, type].hash
148
+ end
149
+
150
+ # Builds the object from hash
151
+ # @param [Hash] attributes Model attributes in the form of hash
152
+ # @return [Object] Returns the model itself
153
+ def self.build_from_hash(attributes)
154
+ return nil unless attributes.is_a?(Hash)
155
+ attributes = attributes.transform_keys(&:to_sym)
156
+ transformed_hash = {}
157
+ openapi_types.each_pair do |key, type|
158
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
159
+ transformed_hash["#{key}"] = nil
160
+ elsif type =~ /\AArray<(.*)>/i
161
+ # check to ensure the input is an array given that the attribute
162
+ # is documented as an array but the input is not
163
+ if attributes[attribute_map[key]].is_a?(Array)
164
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
165
+ end
166
+ elsif !attributes[attribute_map[key]].nil?
167
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
168
+ end
169
+ end
170
+ new(transformed_hash)
171
+ end
172
+
173
+ # Returns the object in the form of hash
174
+ # @return [Hash] Returns the object in the form of hash
175
+ def to_hash
176
+ hash = {}
177
+ self.class.attribute_map.each_pair do |attr, param|
178
+ value = self.send(attr)
179
+ if value.nil?
180
+ is_nullable = self.class.openapi_nullable.include?(attr)
181
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
182
+ end
183
+
184
+ hash[param] = _to_hash(value)
185
+ end
186
+ hash
187
+ end
188
+
189
+ end
190
+
191
+ end