zernio-sdk 0.0.543 → 0.0.545

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 (131) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +53 -4
  3. data/docs/AdAudiencesApi.md +5 -5
  4. data/docs/AdCampaignsApi.md +142 -0
  5. data/docs/AdsApi.md +795 -37
  6. data/docs/CreateAdCampaign201Response.md +24 -0
  7. data/docs/CreateAdCampaignRequest.md +32 -0
  8. data/docs/CreateAdCreative201Response.md +20 -0
  9. data/docs/CreateAdCreativeRequest.md +40 -0
  10. data/docs/CreateAdCreativeRequestCarouselCardsInner.md +26 -0
  11. data/docs/CreateSmsSenderId200Response.md +22 -0
  12. data/docs/CreateSmsSenderIdRequest.md +18 -0
  13. data/docs/CreateStandaloneAd200Response.md +22 -0
  14. data/docs/CreateStandaloneAd200ResponseResultsInner.md +22 -0
  15. data/docs/CreateStandaloneAdRequest.md +4 -0
  16. data/docs/DeleteAdCreative200Response.md +20 -0
  17. data/docs/DeleteSmsSenderId200Response.md +18 -0
  18. data/docs/DiscordApi.md +153 -1
  19. data/docs/{ListDiscordGuildMembers200ResponseDataInner.md → DiscordGuildMember.md} +3 -3
  20. data/docs/{ListDiscordGuildMembers200ResponseDataInnerUser.md → DiscordGuildMemberUser.md} +2 -2
  21. data/docs/DuplicateAd200Response.md +22 -0
  22. data/docs/DuplicateAdRequest.md +28 -0
  23. data/docs/DuplicateAdSet200Response.md +22 -0
  24. data/docs/DuplicateAdSetRequest.md +36 -0
  25. data/docs/GetAdCreative200Response.md +18 -0
  26. data/docs/GetDiscordGuildMember200Response.md +18 -0
  27. data/docs/ListAdCreatives200Response.md +22 -0
  28. data/docs/ListAdImages200Response.md +22 -0
  29. data/docs/ListAdLabels200Response.md +22 -0
  30. data/docs/ListDiscordGuildMembers200Response.md +1 -1
  31. data/docs/ListHighDemandPeriods200Response.md +22 -0
  32. data/docs/ListMetaBusinesses200Response.md +20 -0
  33. data/docs/ListSmsSenderIds200Response.md +20 -0
  34. data/docs/ListSmsSenderIds200ResponseBudget.md +24 -0
  35. data/docs/ListSmsSenderIds200ResponseBudgetPendingRequest.md +22 -0
  36. data/docs/ListSmsSenderIds200ResponseSenderIdsInner.md +24 -0
  37. data/docs/RequestSmsSenderIdLimitIncrease200Response.md +20 -0
  38. data/docs/RequestSmsSenderIdLimitIncreaseRequest.md +20 -0
  39. data/docs/SMSApi.md +275 -0
  40. data/docs/SearchDiscordGuildMembers200Response.md +18 -0
  41. data/docs/UpdateAdCreative200Response.md +22 -0
  42. data/docs/UpdateAdCreativeRequest.md +20 -0
  43. data/docs/WhatsAppApi.md +72 -0
  44. data/lib/zernio-sdk/api/ad_audiences_api.rb +4 -4
  45. data/lib/zernio-sdk/api/ad_campaigns_api.rb +142 -0
  46. data/lib/zernio-sdk/api/ads_api.rb +829 -51
  47. data/lib/zernio-sdk/api/discord_api.rb +174 -2
  48. data/lib/zernio-sdk/api/sms_api.rb +254 -0
  49. data/lib/zernio-sdk/api/whats_app_api.rb +70 -0
  50. data/lib/zernio-sdk/models/create_ad_campaign201_response.rb +210 -0
  51. data/lib/zernio-sdk/models/create_ad_campaign_request.rb +343 -0
  52. data/lib/zernio-sdk/models/create_ad_creative201_response.rb +157 -0
  53. data/lib/zernio-sdk/models/create_ad_creative_request.rb +424 -0
  54. data/lib/zernio-sdk/models/create_ad_creative_request_carousel_cards_inner.rb +255 -0
  55. data/lib/zernio-sdk/models/create_sms_sender_id200_response.rb +166 -0
  56. data/lib/zernio-sdk/models/create_sms_sender_id_request.rb +183 -0
  57. data/lib/zernio-sdk/models/create_standalone_ad200_response.rb +201 -0
  58. data/lib/zernio-sdk/models/create_standalone_ad200_response_results_inner.rb +212 -0
  59. data/lib/zernio-sdk/models/create_standalone_ad_request.rb +23 -1
  60. data/lib/zernio-sdk/models/delete_ad_creative200_response.rb +156 -0
  61. data/lib/zernio-sdk/models/delete_sms_sender_id200_response.rb +147 -0
  62. data/lib/zernio-sdk/models/{list_discord_guild_members200_response_data_inner.rb → discord_guild_member.rb} +5 -4
  63. data/lib/zernio-sdk/models/{list_discord_guild_members200_response_data_inner_user.rb → discord_guild_member_user.rb} +3 -3
  64. data/lib/zernio-sdk/models/duplicate_ad200_response.rb +200 -0
  65. data/lib/zernio-sdk/models/duplicate_ad_request.rb +243 -0
  66. data/lib/zernio-sdk/models/duplicate_ad_set200_response.rb +201 -0
  67. data/lib/zernio-sdk/models/duplicate_ad_set_request.rb +302 -0
  68. data/lib/zernio-sdk/models/get_ad_creative200_response.rb +148 -0
  69. data/lib/zernio-sdk/models/get_discord_guild_member200_response.rb +147 -0
  70. data/lib/zernio-sdk/models/list_ad_creatives200_response.rb +167 -0
  71. data/lib/zernio-sdk/models/list_ad_images200_response.rb +167 -0
  72. data/lib/zernio-sdk/models/list_ad_labels200_response.rb +167 -0
  73. data/lib/zernio-sdk/models/list_discord_guild_members200_response.rb +1 -1
  74. data/lib/zernio-sdk/models/list_high_demand_periods200_response.rb +168 -0
  75. data/lib/zernio-sdk/models/list_meta_businesses200_response.rb +158 -0
  76. data/lib/zernio-sdk/models/list_sms_sender_ids200_response.rb +158 -0
  77. data/lib/zernio-sdk/models/list_sms_sender_ids200_response_budget.rb +178 -0
  78. data/lib/zernio-sdk/models/list_sms_sender_ids200_response_budget_pending_request.rb +167 -0
  79. data/lib/zernio-sdk/models/list_sms_sender_ids200_response_sender_ids_inner.rb +175 -0
  80. data/lib/zernio-sdk/models/request_sms_sender_id_limit_increase200_response.rb +156 -0
  81. data/lib/zernio-sdk/models/request_sms_sender_id_limit_increase_request.rb +210 -0
  82. data/lib/zernio-sdk/models/search_discord_guild_members200_response.rb +149 -0
  83. data/lib/zernio-sdk/models/update_ad_creative200_response.rb +165 -0
  84. data/lib/zernio-sdk/models/update_ad_creative_request.rb +200 -0
  85. data/lib/zernio-sdk/version.rb +1 -1
  86. data/lib/zernio-sdk.rb +33 -3
  87. data/openapi.yaml +741 -28
  88. data/spec/api/ad_audiences_api_spec.rb +2 -2
  89. data/spec/api/ad_campaigns_api_spec.rb +25 -0
  90. data/spec/api/ads_api_spec.rb +143 -1
  91. data/spec/api/discord_api_spec.rb +30 -1
  92. data/spec/api/sms_api_spec.rb +46 -0
  93. data/spec/api/whats_app_api_spec.rb +13 -0
  94. data/spec/models/create_ad_campaign201_response_spec.rb +58 -0
  95. data/spec/models/create_ad_campaign_request_spec.rb +94 -0
  96. data/spec/models/create_ad_creative201_response_spec.rb +42 -0
  97. data/spec/models/create_ad_creative_request_carousel_cards_inner_spec.rb +60 -0
  98. data/spec/models/create_ad_creative_request_spec.rb +106 -0
  99. data/spec/models/create_sms_sender_id200_response_spec.rb +48 -0
  100. data/spec/models/create_sms_sender_id_request_spec.rb +36 -0
  101. data/spec/models/create_standalone_ad200_response_results_inner_spec.rb +56 -0
  102. data/spec/models/create_standalone_ad200_response_spec.rb +52 -0
  103. data/spec/models/create_standalone_ad_request_spec.rb +16 -0
  104. data/spec/models/delete_ad_creative200_response_spec.rb +42 -0
  105. data/spec/models/delete_sms_sender_id200_response_spec.rb +36 -0
  106. data/spec/models/{list_discord_guild_members200_response_data_inner_spec.rb → discord_guild_member_spec.rb} +6 -6
  107. data/spec/models/{list_discord_guild_members200_response_data_inner_user_spec.rb → discord_guild_member_user_spec.rb} +6 -6
  108. data/spec/models/duplicate_ad200_response_spec.rb +52 -0
  109. data/spec/models/duplicate_ad_request_spec.rb +74 -0
  110. data/spec/models/duplicate_ad_set200_response_spec.rb +52 -0
  111. data/spec/models/duplicate_ad_set_request_spec.rb +102 -0
  112. data/spec/models/get_ad_creative200_response_spec.rb +36 -0
  113. data/spec/models/get_discord_guild_member200_response_spec.rb +36 -0
  114. data/spec/models/list_ad_creatives200_response_spec.rb +48 -0
  115. data/spec/models/list_ad_images200_response_spec.rb +48 -0
  116. data/spec/models/list_ad_labels200_response_spec.rb +48 -0
  117. data/spec/models/list_high_demand_periods200_response_spec.rb +48 -0
  118. data/spec/models/list_meta_businesses200_response_spec.rb +42 -0
  119. data/spec/models/list_sms_sender_ids200_response_budget_pending_request_spec.rb +48 -0
  120. data/spec/models/list_sms_sender_ids200_response_budget_spec.rb +54 -0
  121. data/spec/models/list_sms_sender_ids200_response_sender_ids_inner_spec.rb +54 -0
  122. data/spec/models/list_sms_sender_ids200_response_spec.rb +42 -0
  123. data/spec/models/request_sms_sender_id_limit_increase200_response_spec.rb +42 -0
  124. data/spec/models/request_sms_sender_id_limit_increase_request_spec.rb +42 -0
  125. data/spec/models/search_discord_guild_members200_response_spec.rb +36 -0
  126. data/spec/models/update_ad_creative200_response_spec.rb +48 -0
  127. data/spec/models/update_ad_creative_request_spec.rb +42 -0
  128. metadata +133 -13
  129. data/docs/InboxApi.md +0 -79
  130. data/lib/zernio-sdk/api/inbox_api.rb +0 -92
  131. data/spec/api/inbox_api_spec.rb +0 -48
@@ -0,0 +1,210 @@
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.4
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 Zernio
17
+ class CreateAdCampaign201Response < ApiModelBase
18
+ attr_accessor :ad_account_id
19
+
20
+ # Platform id of the new campaign
21
+ attr_accessor :campaign_id
22
+
23
+ # Resolved ODAX objective (e.g. OUTCOME_SALES).
24
+ attr_accessor :objective
25
+
26
+ attr_accessor :status
27
+
28
+ class EnumAttributeValidator
29
+ attr_reader :datatype
30
+ attr_reader :allowable_values
31
+
32
+ def initialize(datatype, allowable_values)
33
+ @allowable_values = allowable_values.map do |value|
34
+ case datatype.to_s
35
+ when /Integer/i
36
+ value.to_i
37
+ when /Float/i
38
+ value.to_f
39
+ else
40
+ value
41
+ end
42
+ end
43
+ end
44
+
45
+ def valid?(value)
46
+ !value || allowable_values.include?(value)
47
+ end
48
+ end
49
+
50
+ # Attribute mapping from ruby-style variable name to JSON key.
51
+ def self.attribute_map
52
+ {
53
+ :'ad_account_id' => :'adAccountId',
54
+ :'campaign_id' => :'campaignId',
55
+ :'objective' => :'objective',
56
+ :'status' => :'status'
57
+ }
58
+ end
59
+
60
+ # Returns attribute mapping this model knows about
61
+ def self.acceptable_attribute_map
62
+ attribute_map
63
+ end
64
+
65
+ # Returns all the JSON keys this model knows about
66
+ def self.acceptable_attributes
67
+ acceptable_attribute_map.values
68
+ end
69
+
70
+ # Attribute type mapping.
71
+ def self.openapi_types
72
+ {
73
+ :'ad_account_id' => :'String',
74
+ :'campaign_id' => :'String',
75
+ :'objective' => :'String',
76
+ :'status' => :'String'
77
+ }
78
+ end
79
+
80
+ # List of attributes with nullable: true
81
+ def self.openapi_nullable
82
+ Set.new([
83
+ ])
84
+ end
85
+
86
+ # Initializes the object
87
+ # @param [Hash] attributes Model attributes in the form of hash
88
+ def initialize(attributes = {})
89
+ if (!attributes.is_a?(Hash))
90
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::CreateAdCampaign201Response` initialize method"
91
+ end
92
+
93
+ # check to see if the attribute exists and convert string to symbol for hash key
94
+ acceptable_attribute_map = self.class.acceptable_attribute_map
95
+ attributes = attributes.each_with_object({}) { |(k, v), h|
96
+ if (!acceptable_attribute_map.key?(k.to_sym))
97
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::CreateAdCampaign201Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
98
+ end
99
+ h[k.to_sym] = v
100
+ }
101
+
102
+ if attributes.key?(:'ad_account_id')
103
+ self.ad_account_id = attributes[:'ad_account_id']
104
+ end
105
+
106
+ if attributes.key?(:'campaign_id')
107
+ self.campaign_id = attributes[:'campaign_id']
108
+ end
109
+
110
+ if attributes.key?(:'objective')
111
+ self.objective = attributes[:'objective']
112
+ end
113
+
114
+ if attributes.key?(:'status')
115
+ self.status = attributes[:'status']
116
+ end
117
+ end
118
+
119
+ # Show invalid properties with the reasons. Usually used together with valid?
120
+ # @return Array for valid properties with the reasons
121
+ def list_invalid_properties
122
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
123
+ invalid_properties = Array.new
124
+ invalid_properties
125
+ end
126
+
127
+ # Check to see if the all the properties in the model are valid
128
+ # @return true if the model is valid
129
+ def valid?
130
+ warn '[DEPRECATED] the `valid?` method is obsolete'
131
+ status_validator = EnumAttributeValidator.new('String', ["ACTIVE", "PAUSED"])
132
+ return false unless status_validator.valid?(@status)
133
+ true
134
+ end
135
+
136
+ # Custom attribute writer method checking allowed values (enum).
137
+ # @param [Object] status Object to be assigned
138
+ def status=(status)
139
+ validator = EnumAttributeValidator.new('String', ["ACTIVE", "PAUSED"])
140
+ unless validator.valid?(status)
141
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
142
+ end
143
+ @status = status
144
+ end
145
+
146
+ # Checks equality by comparing each attribute.
147
+ # @param [Object] Object to be compared
148
+ def ==(o)
149
+ return true if self.equal?(o)
150
+ self.class == o.class &&
151
+ ad_account_id == o.ad_account_id &&
152
+ campaign_id == o.campaign_id &&
153
+ objective == o.objective &&
154
+ status == o.status
155
+ end
156
+
157
+ # @see the `==` method
158
+ # @param [Object] Object to be compared
159
+ def eql?(o)
160
+ self == o
161
+ end
162
+
163
+ # Calculates hash code according to all attributes.
164
+ # @return [Integer] Hash code
165
+ def hash
166
+ [ad_account_id, campaign_id, objective, status].hash
167
+ end
168
+
169
+ # Builds the object from hash
170
+ # @param [Hash] attributes Model attributes in the form of hash
171
+ # @return [Object] Returns the model itself
172
+ def self.build_from_hash(attributes)
173
+ return nil unless attributes.is_a?(Hash)
174
+ attributes = attributes.transform_keys(&:to_sym)
175
+ transformed_hash = {}
176
+ openapi_types.each_pair do |key, type|
177
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
178
+ transformed_hash["#{key}"] = nil
179
+ elsif type =~ /\AArray<(.*)>/i
180
+ # check to ensure the input is an array given that the attribute
181
+ # is documented as an array but the input is not
182
+ if attributes[attribute_map[key]].is_a?(Array)
183
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
184
+ end
185
+ elsif !attributes[attribute_map[key]].nil?
186
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
187
+ end
188
+ end
189
+ new(transformed_hash)
190
+ end
191
+
192
+ # Returns the object in the form of hash
193
+ # @return [Hash] Returns the object in the form of hash
194
+ def to_hash
195
+ hash = {}
196
+ self.class.attribute_map.each_pair do |attr, param|
197
+ value = self.send(attr)
198
+ if value.nil?
199
+ is_nullable = self.class.openapi_nullable.include?(attr)
200
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
201
+ end
202
+
203
+ hash[param] = _to_hash(value)
204
+ end
205
+ hash
206
+ end
207
+
208
+ end
209
+
210
+ end
@@ -0,0 +1,343 @@
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.4
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 Zernio
17
+ class CreateAdCampaignRequest < ApiModelBase
18
+ # Zernio SocialAccount id (posting or ads variant) used to resolve the Meta token.
19
+ attr_accessor :account_id
20
+
21
+ # Meta ad account id (act_<n>).
22
+ attr_accessor :ad_account_id
23
+
24
+ attr_accessor :name
25
+
26
+ # Mapped to the ODAX objective (same mapping as POST /v1/ads/create).
27
+ attr_accessor :goal
28
+
29
+ attr_accessor :special_ad_categories
30
+
31
+ # Campaign-level (CBO) budget in whole currency units. Requires budgetType.
32
+ attr_accessor :budget_amount
33
+
34
+ attr_accessor :budget_type
35
+
36
+ attr_accessor :status
37
+
38
+ class EnumAttributeValidator
39
+ attr_reader :datatype
40
+ attr_reader :allowable_values
41
+
42
+ def initialize(datatype, allowable_values)
43
+ @allowable_values = allowable_values.map do |value|
44
+ case datatype.to_s
45
+ when /Integer/i
46
+ value.to_i
47
+ when /Float/i
48
+ value.to_f
49
+ else
50
+ value
51
+ end
52
+ end
53
+ end
54
+
55
+ def valid?(value)
56
+ !value || allowable_values.include?(value)
57
+ end
58
+ end
59
+
60
+ # Attribute mapping from ruby-style variable name to JSON key.
61
+ def self.attribute_map
62
+ {
63
+ :'account_id' => :'accountId',
64
+ :'ad_account_id' => :'adAccountId',
65
+ :'name' => :'name',
66
+ :'goal' => :'goal',
67
+ :'special_ad_categories' => :'specialAdCategories',
68
+ :'budget_amount' => :'budgetAmount',
69
+ :'budget_type' => :'budgetType',
70
+ :'status' => :'status'
71
+ }
72
+ end
73
+
74
+ # Returns attribute mapping this model knows about
75
+ def self.acceptable_attribute_map
76
+ attribute_map
77
+ end
78
+
79
+ # Returns all the JSON keys this model knows about
80
+ def self.acceptable_attributes
81
+ acceptable_attribute_map.values
82
+ end
83
+
84
+ # Attribute type mapping.
85
+ def self.openapi_types
86
+ {
87
+ :'account_id' => :'String',
88
+ :'ad_account_id' => :'String',
89
+ :'name' => :'String',
90
+ :'goal' => :'String',
91
+ :'special_ad_categories' => :'Array<String>',
92
+ :'budget_amount' => :'Float',
93
+ :'budget_type' => :'String',
94
+ :'status' => :'String'
95
+ }
96
+ end
97
+
98
+ # List of attributes with nullable: true
99
+ def self.openapi_nullable
100
+ Set.new([
101
+ ])
102
+ end
103
+
104
+ # Initializes the object
105
+ # @param [Hash] attributes Model attributes in the form of hash
106
+ def initialize(attributes = {})
107
+ if (!attributes.is_a?(Hash))
108
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::CreateAdCampaignRequest` initialize method"
109
+ end
110
+
111
+ # check to see if the attribute exists and convert string to symbol for hash key
112
+ acceptable_attribute_map = self.class.acceptable_attribute_map
113
+ attributes = attributes.each_with_object({}) { |(k, v), h|
114
+ if (!acceptable_attribute_map.key?(k.to_sym))
115
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::CreateAdCampaignRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
116
+ end
117
+ h[k.to_sym] = v
118
+ }
119
+
120
+ if attributes.key?(:'account_id')
121
+ self.account_id = attributes[:'account_id']
122
+ else
123
+ self.account_id = nil
124
+ end
125
+
126
+ if attributes.key?(:'ad_account_id')
127
+ self.ad_account_id = attributes[:'ad_account_id']
128
+ else
129
+ self.ad_account_id = nil
130
+ end
131
+
132
+ if attributes.key?(:'name')
133
+ self.name = attributes[:'name']
134
+ else
135
+ self.name = nil
136
+ end
137
+
138
+ if attributes.key?(:'goal')
139
+ self.goal = attributes[:'goal']
140
+ else
141
+ self.goal = nil
142
+ end
143
+
144
+ if attributes.key?(:'special_ad_categories')
145
+ if (value = attributes[:'special_ad_categories']).is_a?(Array)
146
+ self.special_ad_categories = value
147
+ end
148
+ end
149
+
150
+ if attributes.key?(:'budget_amount')
151
+ self.budget_amount = attributes[:'budget_amount']
152
+ end
153
+
154
+ if attributes.key?(:'budget_type')
155
+ self.budget_type = attributes[:'budget_type']
156
+ end
157
+
158
+ if attributes.key?(:'status')
159
+ self.status = attributes[:'status']
160
+ else
161
+ self.status = 'PAUSED'
162
+ end
163
+ end
164
+
165
+ # Show invalid properties with the reasons. Usually used together with valid?
166
+ # @return Array for valid properties with the reasons
167
+ def list_invalid_properties
168
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
169
+ invalid_properties = Array.new
170
+ if @account_id.nil?
171
+ invalid_properties.push('invalid value for "account_id", account_id cannot be nil.')
172
+ end
173
+
174
+ if @ad_account_id.nil?
175
+ invalid_properties.push('invalid value for "ad_account_id", ad_account_id cannot be nil.')
176
+ end
177
+
178
+ if @name.nil?
179
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
180
+ end
181
+
182
+ if @name.to_s.length > 255
183
+ invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 255.')
184
+ end
185
+
186
+ if @goal.nil?
187
+ invalid_properties.push('invalid value for "goal", goal cannot be nil.')
188
+ end
189
+
190
+ invalid_properties
191
+ end
192
+
193
+ # Check to see if the all the properties in the model are valid
194
+ # @return true if the model is valid
195
+ def valid?
196
+ warn '[DEPRECATED] the `valid?` method is obsolete'
197
+ return false if @account_id.nil?
198
+ return false if @ad_account_id.nil?
199
+ return false if @name.nil?
200
+ return false if @name.to_s.length > 255
201
+ return false if @goal.nil?
202
+ goal_validator = EnumAttributeValidator.new('String', ["engagement", "traffic", "awareness", "video_views", "lead_generation", "lead_conversion", "job_applicants", "conversions", "app_promotion", "catalog_sales"])
203
+ return false unless goal_validator.valid?(@goal)
204
+ budget_type_validator = EnumAttributeValidator.new('String', ["daily", "lifetime"])
205
+ return false unless budget_type_validator.valid?(@budget_type)
206
+ status_validator = EnumAttributeValidator.new('String', ["ACTIVE", "PAUSED"])
207
+ return false unless status_validator.valid?(@status)
208
+ true
209
+ end
210
+
211
+ # Custom attribute writer method with validation
212
+ # @param [Object] account_id Value to be assigned
213
+ def account_id=(account_id)
214
+ if account_id.nil?
215
+ fail ArgumentError, 'account_id cannot be nil'
216
+ end
217
+
218
+ @account_id = account_id
219
+ end
220
+
221
+ # Custom attribute writer method with validation
222
+ # @param [Object] ad_account_id Value to be assigned
223
+ def ad_account_id=(ad_account_id)
224
+ if ad_account_id.nil?
225
+ fail ArgumentError, 'ad_account_id cannot be nil'
226
+ end
227
+
228
+ @ad_account_id = ad_account_id
229
+ end
230
+
231
+ # Custom attribute writer method with validation
232
+ # @param [Object] name Value to be assigned
233
+ def name=(name)
234
+ if name.nil?
235
+ fail ArgumentError, 'name cannot be nil'
236
+ end
237
+
238
+ if name.to_s.length > 255
239
+ fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 255.'
240
+ end
241
+
242
+ @name = name
243
+ end
244
+
245
+ # Custom attribute writer method checking allowed values (enum).
246
+ # @param [Object] goal Object to be assigned
247
+ def goal=(goal)
248
+ validator = EnumAttributeValidator.new('String', ["engagement", "traffic", "awareness", "video_views", "lead_generation", "lead_conversion", "job_applicants", "conversions", "app_promotion", "catalog_sales"])
249
+ unless validator.valid?(goal)
250
+ fail ArgumentError, "invalid value for \"goal\", must be one of #{validator.allowable_values}."
251
+ end
252
+ @goal = goal
253
+ end
254
+
255
+ # Custom attribute writer method checking allowed values (enum).
256
+ # @param [Object] budget_type Object to be assigned
257
+ def budget_type=(budget_type)
258
+ validator = EnumAttributeValidator.new('String', ["daily", "lifetime"])
259
+ unless validator.valid?(budget_type)
260
+ fail ArgumentError, "invalid value for \"budget_type\", must be one of #{validator.allowable_values}."
261
+ end
262
+ @budget_type = budget_type
263
+ end
264
+
265
+ # Custom attribute writer method checking allowed values (enum).
266
+ # @param [Object] status Object to be assigned
267
+ def status=(status)
268
+ validator = EnumAttributeValidator.new('String', ["ACTIVE", "PAUSED"])
269
+ unless validator.valid?(status)
270
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
271
+ end
272
+ @status = status
273
+ end
274
+
275
+ # Checks equality by comparing each attribute.
276
+ # @param [Object] Object to be compared
277
+ def ==(o)
278
+ return true if self.equal?(o)
279
+ self.class == o.class &&
280
+ account_id == o.account_id &&
281
+ ad_account_id == o.ad_account_id &&
282
+ name == o.name &&
283
+ goal == o.goal &&
284
+ special_ad_categories == o.special_ad_categories &&
285
+ budget_amount == o.budget_amount &&
286
+ budget_type == o.budget_type &&
287
+ status == o.status
288
+ end
289
+
290
+ # @see the `==` method
291
+ # @param [Object] Object to be compared
292
+ def eql?(o)
293
+ self == o
294
+ end
295
+
296
+ # Calculates hash code according to all attributes.
297
+ # @return [Integer] Hash code
298
+ def hash
299
+ [account_id, ad_account_id, name, goal, special_ad_categories, budget_amount, budget_type, status].hash
300
+ end
301
+
302
+ # Builds the object from hash
303
+ # @param [Hash] attributes Model attributes in the form of hash
304
+ # @return [Object] Returns the model itself
305
+ def self.build_from_hash(attributes)
306
+ return nil unless attributes.is_a?(Hash)
307
+ attributes = attributes.transform_keys(&:to_sym)
308
+ transformed_hash = {}
309
+ openapi_types.each_pair do |key, type|
310
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
311
+ transformed_hash["#{key}"] = nil
312
+ elsif type =~ /\AArray<(.*)>/i
313
+ # check to ensure the input is an array given that the attribute
314
+ # is documented as an array but the input is not
315
+ if attributes[attribute_map[key]].is_a?(Array)
316
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
317
+ end
318
+ elsif !attributes[attribute_map[key]].nil?
319
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
320
+ end
321
+ end
322
+ new(transformed_hash)
323
+ end
324
+
325
+ # Returns the object in the form of hash
326
+ # @return [Hash] Returns the object in the form of hash
327
+ def to_hash
328
+ hash = {}
329
+ self.class.attribute_map.each_pair do |attr, param|
330
+ value = self.send(attr)
331
+ if value.nil?
332
+ is_nullable = self.class.openapi_nullable.include?(attr)
333
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
334
+ end
335
+
336
+ hash[param] = _to_hash(value)
337
+ end
338
+ hash
339
+ end
340
+
341
+ end
342
+
343
+ end
@@ -0,0 +1,157 @@
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.4
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 Zernio
17
+ class CreateAdCreative201Response < ApiModelBase
18
+ attr_accessor :ad_account_id
19
+
20
+ # Platform creative id, reusable via existingCreativeId.
21
+ attr_accessor :creative_id
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'ad_account_id' => :'adAccountId',
27
+ :'creative_id' => :'creativeId'
28
+ }
29
+ end
30
+
31
+ # Returns attribute mapping this model knows about
32
+ def self.acceptable_attribute_map
33
+ attribute_map
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ acceptable_attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'ad_account_id' => :'String',
45
+ :'creative_id' => :'String'
46
+ }
47
+ end
48
+
49
+ # List of attributes with nullable: true
50
+ def self.openapi_nullable
51
+ Set.new([
52
+ ])
53
+ end
54
+
55
+ # Initializes the object
56
+ # @param [Hash] attributes Model attributes in the form of hash
57
+ def initialize(attributes = {})
58
+ if (!attributes.is_a?(Hash))
59
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::CreateAdCreative201Response` initialize method"
60
+ end
61
+
62
+ # check to see if the attribute exists and convert string to symbol for hash key
63
+ acceptable_attribute_map = self.class.acceptable_attribute_map
64
+ attributes = attributes.each_with_object({}) { |(k, v), h|
65
+ if (!acceptable_attribute_map.key?(k.to_sym))
66
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::CreateAdCreative201Response`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
67
+ end
68
+ h[k.to_sym] = v
69
+ }
70
+
71
+ if attributes.key?(:'ad_account_id')
72
+ self.ad_account_id = attributes[:'ad_account_id']
73
+ end
74
+
75
+ if attributes.key?(:'creative_id')
76
+ self.creative_id = attributes[:'creative_id']
77
+ end
78
+ end
79
+
80
+ # Show invalid properties with the reasons. Usually used together with valid?
81
+ # @return Array for valid properties with the reasons
82
+ def list_invalid_properties
83
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
84
+ invalid_properties = Array.new
85
+ invalid_properties
86
+ end
87
+
88
+ # Check to see if the all the properties in the model are valid
89
+ # @return true if the model is valid
90
+ def valid?
91
+ warn '[DEPRECATED] the `valid?` method is obsolete'
92
+ true
93
+ end
94
+
95
+ # Checks equality by comparing each attribute.
96
+ # @param [Object] Object to be compared
97
+ def ==(o)
98
+ return true if self.equal?(o)
99
+ self.class == o.class &&
100
+ ad_account_id == o.ad_account_id &&
101
+ creative_id == o.creative_id
102
+ end
103
+
104
+ # @see the `==` method
105
+ # @param [Object] Object to be compared
106
+ def eql?(o)
107
+ self == o
108
+ end
109
+
110
+ # Calculates hash code according to all attributes.
111
+ # @return [Integer] Hash code
112
+ def hash
113
+ [ad_account_id, creative_id].hash
114
+ end
115
+
116
+ # Builds the object from hash
117
+ # @param [Hash] attributes Model attributes in the form of hash
118
+ # @return [Object] Returns the model itself
119
+ def self.build_from_hash(attributes)
120
+ return nil unless attributes.is_a?(Hash)
121
+ attributes = attributes.transform_keys(&:to_sym)
122
+ transformed_hash = {}
123
+ openapi_types.each_pair do |key, type|
124
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
125
+ transformed_hash["#{key}"] = nil
126
+ elsif type =~ /\AArray<(.*)>/i
127
+ # check to ensure the input is an array given that the attribute
128
+ # is documented as an array but the input is not
129
+ if attributes[attribute_map[key]].is_a?(Array)
130
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
131
+ end
132
+ elsif !attributes[attribute_map[key]].nil?
133
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
134
+ end
135
+ end
136
+ new(transformed_hash)
137
+ end
138
+
139
+ # Returns the object in the form of hash
140
+ # @return [Hash] Returns the object in the form of hash
141
+ def to_hash
142
+ hash = {}
143
+ self.class.attribute_map.each_pair do |attr, param|
144
+ value = self.send(attr)
145
+ if value.nil?
146
+ is_nullable = self.class.openapi_nullable.include?(attr)
147
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
148
+ end
149
+
150
+ hash[param] = _to_hash(value)
151
+ end
152
+ hash
153
+ end
154
+
155
+ end
156
+
157
+ end