pingram 1.0.31 → 1.0.32

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 (56) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +2 -2
  3. data/lib/pingram/api/broadcasts_api.rb +912 -0
  4. data/lib/pingram/api/library_api.rb +161 -0
  5. data/lib/pingram/api_client.rb +1 -1
  6. data/lib/pingram/client_wrapper.rb +20 -0
  7. data/lib/pingram/models/broadcast_metrics_response.rb +480 -0
  8. data/lib/pingram/models/broadcast_response.rb +525 -0
  9. data/lib/pingram/models/broadcast_response_audience.rb +161 -0
  10. data/lib/pingram/models/create_broadcast_request.rb +366 -0
  11. data/lib/pingram/models/create_library_request.rb +192 -0
  12. data/lib/pingram/models/create_library_response.rb +346 -0
  13. data/lib/pingram/models/get_users_response_users_inner.rb +13 -1
  14. data/lib/pingram/models/get_users_response_users_inner_properties_value.rb +104 -0
  15. data/lib/pingram/models/list_broadcast_recipients_response.rb +175 -0
  16. data/lib/pingram/models/list_broadcast_recipients_response_recipients_inner.rb +324 -0
  17. data/lib/pingram/models/list_broadcasts_response.rb +175 -0
  18. data/lib/pingram/models/list_broadcasts_response_broadcasts_inner.rb +487 -0
  19. data/lib/pingram/models/list_library_response.rb +175 -0
  20. data/lib/pingram/models/list_library_response_items_inner.rb +344 -0
  21. data/lib/pingram/models/logs_get_response_logs_inner.rb +4 -4
  22. data/lib/pingram/models/mfa_status_response.rb +1 -1
  23. data/lib/pingram/models/post_user_request.rb +16 -4
  24. data/lib/pingram/models/schedule_broadcast_request.rb +165 -0
  25. data/lib/pingram/models/sender_post_body_to.rb +13 -1
  26. data/lib/pingram/models/sender_post_body_user.rb +13 -1
  27. data/lib/pingram/models/update_broadcast_request.rb +264 -0
  28. data/lib/pingram/models/user.rb +13 -1
  29. data/lib/pingram/version.rb +1 -1
  30. data/lib/pingram.rb +17 -0
  31. data/vendor/bundle/ruby/3.2.0/cache/io-console-0.9.3.gem +0 -0
  32. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/byebug-13.0.0/gem_make.out +5 -5
  33. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/date-3.5.1/gem_make.out +5 -5
  34. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/{io-console-0.9.2 → io-console-0.9.3}/gem_make.out +11 -10
  35. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.9.3/io/console.so +0 -0
  36. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/{io-console-0.9.2 → io-console-0.9.3}/mkmf.log +10 -6
  37. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/jaro_winkler-1.5.6/gem_make.out +5 -5
  38. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-5.5.0/gem_make.out +5 -5
  39. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/racc-1.8.1/gem_make.out +5 -5
  40. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.2.0/gem_make.out +5 -5
  41. data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.2 → io-console-0.9.3}/ext/io/console/Makefile +2 -2
  42. data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.2 → io-console-0.9.3}/ext/io/console/console.c +98 -13
  43. data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.2 → io-console-0.9.3}/ext/io/console/extconf.rb +15 -1
  44. data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.2 → io-console-0.9.3}/lib/io/console/size.rb +4 -2
  45. data/vendor/bundle/ruby/3.2.0/gems/io-console-0.9.3/lib/io/console.so +0 -0
  46. data/vendor/bundle/ruby/3.2.0/specifications/{io-console-0.9.2.gemspec → io-console-0.9.3.gemspec} +3 -3
  47. metadata +35 -18
  48. data/vendor/bundle/ruby/3.2.0/cache/io-console-0.9.2.gem +0 -0
  49. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.9.2/io/console.so +0 -0
  50. data/vendor/bundle/ruby/3.2.0/gems/io-console-0.9.2/lib/io/console.so +0 -0
  51. /data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/{io-console-0.9.2 → io-console-0.9.3}/gem.build_complete +0 -0
  52. /data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.2 → io-console-0.9.3}/.document +0 -0
  53. /data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.2 → io-console-0.9.3}/BSDL +0 -0
  54. /data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.2 → io-console-0.9.3}/COPYING +0 -0
  55. /data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.2 → io-console-0.9.3}/README.md +0 -0
  56. /data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.2 → io-console-0.9.3}/ext/io/console/win32_vk.inc +0 -0
@@ -0,0 +1,161 @@
1
+ =begin
2
+ #Pingram
3
+
4
+ #Internal API for notification delivery and management
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module Pingram
16
+ class LibraryApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Create an upload slot in the account library. PUT the file to the returned uploadUrl with the same Content-Type, then use the returned url in emails and the editor.
23
+ # @param use_case [String] Library use-case
24
+ # @param create_library_request [CreateLibraryRequest]
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [CreateLibraryResponse]
27
+ def library_create(use_case, create_library_request, opts = {})
28
+ data, _status_code, _headers = library_create_with_http_info(use_case, create_library_request, opts)
29
+ data
30
+ end
31
+
32
+ # Create an upload slot in the account library. PUT the file to the returned uploadUrl with the same Content-Type, then use the returned url in emails and the editor.
33
+ # @param use_case [String] Library use-case
34
+ # @param create_library_request [CreateLibraryRequest]
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(CreateLibraryResponse, Integer, Hash)>] CreateLibraryResponse data, response status code and response headers
37
+ def library_create_with_http_info(use_case, create_library_request, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: LibraryApi.library_create ...'
40
+ end
41
+ # verify the required parameter 'use_case' is set
42
+ if @api_client.config.client_side_validation && use_case.nil?
43
+ fail ArgumentError, "Missing the required parameter 'use_case' when calling LibraryApi.library_create"
44
+ end
45
+ # verify the required parameter 'create_library_request' is set
46
+ if @api_client.config.client_side_validation && create_library_request.nil?
47
+ fail ArgumentError, "Missing the required parameter 'create_library_request' when calling LibraryApi.library_create"
48
+ end
49
+ # resource path
50
+ local_var_path = '/library/{useCase}'.sub('{' + 'useCase' + '}', CGI.escape(use_case.to_s))
51
+
52
+ # query parameters
53
+ query_params = opts[:query_params] || {}
54
+
55
+ # header parameters
56
+ header_params = opts[:header_params] || {}
57
+ # HTTP header 'Accept' (if needed)
58
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
59
+ # HTTP header 'Content-Type'
60
+ content_type = @api_client.select_header_content_type(['application/json'])
61
+ if !content_type.nil?
62
+ header_params['Content-Type'] = content_type
63
+ end
64
+
65
+ # form parameters
66
+ form_params = opts[:form_params] || {}
67
+
68
+ # http body (model)
69
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_library_request)
70
+
71
+ # return_type
72
+ return_type = opts[:debug_return_type] || 'CreateLibraryResponse'
73
+
74
+ # auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
75
+ auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']
76
+
77
+ new_options = opts.merge(
78
+ :operation => :"LibraryApi.library_create",
79
+ :header_params => header_params,
80
+ :query_params => query_params,
81
+ :form_params => form_params,
82
+ :body => post_body,
83
+ :auth_names => auth_names,
84
+ :return_type => return_type
85
+ )
86
+
87
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
88
+ if @api_client.config.debugging
89
+ @api_client.config.logger.debug "API called: LibraryApi#library_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
90
+ end
91
+ return data, status_code, headers
92
+ end
93
+
94
+ # List files in the account library for a use-case, newest first. Paginate with limit (default 50, max 100) and nextToken.
95
+ # @param use_case [String] Library use-case
96
+ # @param [Hash] opts the optional parameters
97
+ # @option opts [Float] :limit Max items to return (default 50)
98
+ # @option opts [String] :next_token Pagination token
99
+ # @return [ListLibraryResponse]
100
+ def library_list(use_case, opts = {})
101
+ data, _status_code, _headers = library_list_with_http_info(use_case, opts)
102
+ data
103
+ end
104
+
105
+ # List files in the account library for a use-case, newest first. Paginate with limit (default 50, max 100) and nextToken.
106
+ # @param use_case [String] Library use-case
107
+ # @param [Hash] opts the optional parameters
108
+ # @option opts [Float] :limit Max items to return (default 50)
109
+ # @option opts [String] :next_token Pagination token
110
+ # @return [Array<(ListLibraryResponse, Integer, Hash)>] ListLibraryResponse data, response status code and response headers
111
+ def library_list_with_http_info(use_case, opts = {})
112
+ if @api_client.config.debugging
113
+ @api_client.config.logger.debug 'Calling API: LibraryApi.library_list ...'
114
+ end
115
+ # verify the required parameter 'use_case' is set
116
+ if @api_client.config.client_side_validation && use_case.nil?
117
+ fail ArgumentError, "Missing the required parameter 'use_case' when calling LibraryApi.library_list"
118
+ end
119
+ # resource path
120
+ local_var_path = '/library/{useCase}'.sub('{' + 'useCase' + '}', CGI.escape(use_case.to_s))
121
+
122
+ # query parameters
123
+ query_params = opts[:query_params] || {}
124
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
125
+ query_params[:'nextToken'] = opts[:'next_token'] if !opts[:'next_token'].nil?
126
+
127
+ # header parameters
128
+ header_params = opts[:header_params] || {}
129
+ # HTTP header 'Accept' (if needed)
130
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
131
+
132
+ # form parameters
133
+ form_params = opts[:form_params] || {}
134
+
135
+ # http body (model)
136
+ post_body = opts[:debug_body]
137
+
138
+ # return_type
139
+ return_type = opts[:debug_return_type] || 'ListLibraryResponse'
140
+
141
+ # auth_names (apiKey last so Bearer wins when multiple schemes set Authorization)
142
+ auth_names = opts[:debug_auth_names] || ['endUserHashed', 'endUser', 'clientCredentials', 'apiKey']
143
+
144
+ new_options = opts.merge(
145
+ :operation => :"LibraryApi.library_list",
146
+ :header_params => header_params,
147
+ :query_params => query_params,
148
+ :form_params => form_params,
149
+ :body => post_body,
150
+ :auth_names => auth_names,
151
+ :return_type => return_type
152
+ )
153
+
154
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
155
+ if @api_client.config.debugging
156
+ @api_client.config.logger.debug "API called: LibraryApi#library_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
157
+ end
158
+ return data, status_code, headers
159
+ end
160
+ end
161
+ end
@@ -32,7 +32,7 @@ module Pingram
32
32
  # @option config [Configuration] Configuration for initializing the object, default to Configuration.default
33
33
  def initialize(config = Configuration.default)
34
34
  @config = config
35
- @user_agent = "pingram-ruby/1.0.31"
35
+ @user_agent = "pingram-ruby/1.0.32"
36
36
  @default_headers = {
37
37
  'Content-Type' => 'application/json',
38
38
  'User-Agent' => @user_agent
@@ -14,6 +14,8 @@ require_relative 'api/accounts_api'
14
14
 
15
15
  require_relative 'api/addresses_api'
16
16
 
17
+ require_relative 'api/broadcasts_api'
18
+
17
19
  require_relative 'api/components_api'
18
20
 
19
21
  require_relative 'api/default_api'
@@ -32,6 +34,8 @@ require_relative 'api/insights_api'
32
34
 
33
35
  require_relative 'api/keys_api'
34
36
 
37
+ require_relative 'api/library_api'
38
+
35
39
  require_relative 'api/logs_api'
36
40
 
37
41
  require_relative 'api/members_api'
@@ -92,6 +96,8 @@ module Pingram
92
96
 
93
97
  @addresses = Pingram::AddressesApi.new(@api_client)
94
98
 
99
+ @broadcasts = Pingram::BroadcastsApi.new(@api_client)
100
+
95
101
  @components = Pingram::ComponentsApi.new(@api_client)
96
102
 
97
103
  @default_api = Pingram::DefaultApi.new(@api_client)
@@ -110,6 +116,8 @@ module Pingram
110
116
 
111
117
  @keys = Pingram::KeysApi.new(@api_client)
112
118
 
119
+ @library = Pingram::LibraryApi.new(@api_client)
120
+
113
121
  @logs = Pingram::LogsApi.new(@api_client)
114
122
 
115
123
  @members = Pingram::MembersApi.new(@api_client)
@@ -157,6 +165,12 @@ module Pingram
157
165
  end
158
166
 
159
167
 
168
+ # @return [Pingram::BroadcastsApi]
169
+ def broadcasts
170
+ @broadcasts
171
+ end
172
+
173
+
160
174
  # @return [Pingram::ComponentsApi]
161
175
  def components
162
176
  @components
@@ -211,6 +225,12 @@ module Pingram
211
225
  end
212
226
 
213
227
 
228
+ # @return [Pingram::LibraryApi]
229
+ def library
230
+ @library
231
+ end
232
+
233
+
214
234
  # @return [Pingram::LogsApi]
215
235
  def logs
216
236
  @logs
@@ -0,0 +1,480 @@
1
+ =begin
2
+ #Pingram
3
+
4
+ #Internal API for notification delivery and management
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
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 Pingram
17
+ # Live send metrics. Counters are flattened at the top level.
18
+ class BroadcastMetricsResponse < ApiModelBase
19
+ attr_accessor :total
20
+
21
+ attr_accessor :sent
22
+
23
+ attr_accessor :delivered
24
+
25
+ attr_accessor :opened
26
+
27
+ attr_accessor :clicked
28
+
29
+ attr_accessor :bounced
30
+
31
+ attr_accessor :complained
32
+
33
+ attr_accessor :unsubscribed
34
+
35
+ attr_accessor :skipped
36
+
37
+ attr_accessor :failed
38
+
39
+ # Lifecycle status of an email broadcast.
40
+ attr_accessor :status
41
+
42
+ attr_accessor :paused_reason
43
+
44
+ attr_accessor :schedule_at
45
+
46
+ class EnumAttributeValidator
47
+ attr_reader :datatype
48
+ attr_reader :allowable_values
49
+
50
+ def initialize(datatype, allowable_values)
51
+ @allowable_values = allowable_values.map do |value|
52
+ case datatype.to_s
53
+ when /Integer/i
54
+ value.to_i
55
+ when /Float/i
56
+ value.to_f
57
+ else
58
+ value
59
+ end
60
+ end
61
+ end
62
+
63
+ def valid?(value)
64
+ !value || allowable_values.include?(value)
65
+ end
66
+ end
67
+
68
+ # Attribute mapping from ruby-style variable name to JSON key.
69
+ def self.attribute_map
70
+ {
71
+ :'total' => :'total',
72
+ :'sent' => :'sent',
73
+ :'delivered' => :'delivered',
74
+ :'opened' => :'opened',
75
+ :'clicked' => :'clicked',
76
+ :'bounced' => :'bounced',
77
+ :'complained' => :'complained',
78
+ :'unsubscribed' => :'unsubscribed',
79
+ :'skipped' => :'skipped',
80
+ :'failed' => :'failed',
81
+ :'status' => :'status',
82
+ :'paused_reason' => :'pausedReason',
83
+ :'schedule_at' => :'scheduleAt'
84
+ }
85
+ end
86
+
87
+ # Returns attribute mapping this model knows about
88
+ def self.acceptable_attribute_map
89
+ attribute_map
90
+ end
91
+
92
+ # Returns all the JSON keys this model knows about
93
+ def self.acceptable_attributes
94
+ acceptable_attribute_map.values
95
+ end
96
+
97
+ # Attribute type mapping.
98
+ def self.openapi_types
99
+ {
100
+ :'total' => :'Float',
101
+ :'sent' => :'Float',
102
+ :'delivered' => :'Float',
103
+ :'opened' => :'Float',
104
+ :'clicked' => :'Float',
105
+ :'bounced' => :'Float',
106
+ :'complained' => :'Float',
107
+ :'unsubscribed' => :'Float',
108
+ :'skipped' => :'Float',
109
+ :'failed' => :'Float',
110
+ :'status' => :'String',
111
+ :'paused_reason' => :'String',
112
+ :'schedule_at' => :'String'
113
+ }
114
+ end
115
+
116
+ # List of attributes with nullable: true
117
+ def self.openapi_nullable
118
+ Set.new([
119
+ ])
120
+ end
121
+
122
+ # Initializes the object
123
+ # @param [Hash] attributes Model attributes in the form of hash
124
+ def initialize(attributes = {})
125
+ if (!attributes.is_a?(Hash))
126
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Pingram::BroadcastMetricsResponse` initialize method"
127
+ end
128
+
129
+ # check to see if the attribute exists and convert string to symbol for hash key
130
+ acceptable_attribute_map = self.class.acceptable_attribute_map
131
+ attributes = attributes.each_with_object({}) { |(k, v), h|
132
+ if (!acceptable_attribute_map.key?(k.to_sym))
133
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Pingram::BroadcastMetricsResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
134
+ end
135
+ h[k.to_sym] = v
136
+ }
137
+
138
+ if attributes.key?(:'total')
139
+ self.total = attributes[:'total']
140
+ else
141
+ self.total = nil
142
+ end
143
+
144
+ if attributes.key?(:'sent')
145
+ self.sent = attributes[:'sent']
146
+ else
147
+ self.sent = nil
148
+ end
149
+
150
+ if attributes.key?(:'delivered')
151
+ self.delivered = attributes[:'delivered']
152
+ else
153
+ self.delivered = nil
154
+ end
155
+
156
+ if attributes.key?(:'opened')
157
+ self.opened = attributes[:'opened']
158
+ else
159
+ self.opened = nil
160
+ end
161
+
162
+ if attributes.key?(:'clicked')
163
+ self.clicked = attributes[:'clicked']
164
+ else
165
+ self.clicked = nil
166
+ end
167
+
168
+ if attributes.key?(:'bounced')
169
+ self.bounced = attributes[:'bounced']
170
+ else
171
+ self.bounced = nil
172
+ end
173
+
174
+ if attributes.key?(:'complained')
175
+ self.complained = attributes[:'complained']
176
+ else
177
+ self.complained = nil
178
+ end
179
+
180
+ if attributes.key?(:'unsubscribed')
181
+ self.unsubscribed = attributes[:'unsubscribed']
182
+ else
183
+ self.unsubscribed = nil
184
+ end
185
+
186
+ if attributes.key?(:'skipped')
187
+ self.skipped = attributes[:'skipped']
188
+ else
189
+ self.skipped = nil
190
+ end
191
+
192
+ if attributes.key?(:'failed')
193
+ self.failed = attributes[:'failed']
194
+ else
195
+ self.failed = nil
196
+ end
197
+
198
+ if attributes.key?(:'status')
199
+ self.status = attributes[:'status']
200
+ else
201
+ self.status = nil
202
+ end
203
+
204
+ if attributes.key?(:'paused_reason')
205
+ self.paused_reason = attributes[:'paused_reason']
206
+ end
207
+
208
+ if attributes.key?(:'schedule_at')
209
+ self.schedule_at = attributes[:'schedule_at']
210
+ end
211
+ end
212
+
213
+ # Show invalid properties with the reasons. Usually used together with valid?
214
+ # @return Array for valid properties with the reasons
215
+ def list_invalid_properties
216
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
217
+ invalid_properties = Array.new
218
+ if @total.nil?
219
+ invalid_properties.push('invalid value for "total", total cannot be nil.')
220
+ end
221
+
222
+ if @sent.nil?
223
+ invalid_properties.push('invalid value for "sent", sent cannot be nil.')
224
+ end
225
+
226
+ if @delivered.nil?
227
+ invalid_properties.push('invalid value for "delivered", delivered cannot be nil.')
228
+ end
229
+
230
+ if @opened.nil?
231
+ invalid_properties.push('invalid value for "opened", opened cannot be nil.')
232
+ end
233
+
234
+ if @clicked.nil?
235
+ invalid_properties.push('invalid value for "clicked", clicked cannot be nil.')
236
+ end
237
+
238
+ if @bounced.nil?
239
+ invalid_properties.push('invalid value for "bounced", bounced cannot be nil.')
240
+ end
241
+
242
+ if @complained.nil?
243
+ invalid_properties.push('invalid value for "complained", complained cannot be nil.')
244
+ end
245
+
246
+ if @unsubscribed.nil?
247
+ invalid_properties.push('invalid value for "unsubscribed", unsubscribed cannot be nil.')
248
+ end
249
+
250
+ if @skipped.nil?
251
+ invalid_properties.push('invalid value for "skipped", skipped cannot be nil.')
252
+ end
253
+
254
+ if @failed.nil?
255
+ invalid_properties.push('invalid value for "failed", failed cannot be nil.')
256
+ end
257
+
258
+ if @status.nil?
259
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
260
+ end
261
+
262
+ invalid_properties
263
+ end
264
+
265
+ # Check to see if the all the properties in the model are valid
266
+ # @return true if the model is valid
267
+ def valid?
268
+ warn '[DEPRECATED] the `valid?` method is obsolete'
269
+ return false if @total.nil?
270
+ return false if @sent.nil?
271
+ return false if @delivered.nil?
272
+ return false if @opened.nil?
273
+ return false if @clicked.nil?
274
+ return false if @bounced.nil?
275
+ return false if @complained.nil?
276
+ return false if @unsubscribed.nil?
277
+ return false if @skipped.nil?
278
+ return false if @failed.nil?
279
+ return false if @status.nil?
280
+ status_validator = EnumAttributeValidator.new('String', ["draft", "scheduled", "sending", "sent", "paused", "canceled"])
281
+ return false unless status_validator.valid?(@status)
282
+ paused_reason_validator = EnumAttributeValidator.new('String', ["PAUSED_BY_USER", "REPUTATION_GUARD", "PLAN_EXCEEDED", "PENDING_VERIFICATION", "AUDIENCE_LIMITS_EXCEEDED", "UNVERIFIED_DOMAIN", "SPAM_CONTENT"])
283
+ return false unless paused_reason_validator.valid?(@paused_reason)
284
+ true
285
+ end
286
+
287
+ # Custom attribute writer method with validation
288
+ # @param [Object] total Value to be assigned
289
+ def total=(total)
290
+ if total.nil?
291
+ fail ArgumentError, 'total cannot be nil'
292
+ end
293
+
294
+ @total = total
295
+ end
296
+
297
+ # Custom attribute writer method with validation
298
+ # @param [Object] sent Value to be assigned
299
+ def sent=(sent)
300
+ if sent.nil?
301
+ fail ArgumentError, 'sent cannot be nil'
302
+ end
303
+
304
+ @sent = sent
305
+ end
306
+
307
+ # Custom attribute writer method with validation
308
+ # @param [Object] delivered Value to be assigned
309
+ def delivered=(delivered)
310
+ if delivered.nil?
311
+ fail ArgumentError, 'delivered cannot be nil'
312
+ end
313
+
314
+ @delivered = delivered
315
+ end
316
+
317
+ # Custom attribute writer method with validation
318
+ # @param [Object] opened Value to be assigned
319
+ def opened=(opened)
320
+ if opened.nil?
321
+ fail ArgumentError, 'opened cannot be nil'
322
+ end
323
+
324
+ @opened = opened
325
+ end
326
+
327
+ # Custom attribute writer method with validation
328
+ # @param [Object] clicked Value to be assigned
329
+ def clicked=(clicked)
330
+ if clicked.nil?
331
+ fail ArgumentError, 'clicked cannot be nil'
332
+ end
333
+
334
+ @clicked = clicked
335
+ end
336
+
337
+ # Custom attribute writer method with validation
338
+ # @param [Object] bounced Value to be assigned
339
+ def bounced=(bounced)
340
+ if bounced.nil?
341
+ fail ArgumentError, 'bounced cannot be nil'
342
+ end
343
+
344
+ @bounced = bounced
345
+ end
346
+
347
+ # Custom attribute writer method with validation
348
+ # @param [Object] complained Value to be assigned
349
+ def complained=(complained)
350
+ if complained.nil?
351
+ fail ArgumentError, 'complained cannot be nil'
352
+ end
353
+
354
+ @complained = complained
355
+ end
356
+
357
+ # Custom attribute writer method with validation
358
+ # @param [Object] unsubscribed Value to be assigned
359
+ def unsubscribed=(unsubscribed)
360
+ if unsubscribed.nil?
361
+ fail ArgumentError, 'unsubscribed cannot be nil'
362
+ end
363
+
364
+ @unsubscribed = unsubscribed
365
+ end
366
+
367
+ # Custom attribute writer method with validation
368
+ # @param [Object] skipped Value to be assigned
369
+ def skipped=(skipped)
370
+ if skipped.nil?
371
+ fail ArgumentError, 'skipped cannot be nil'
372
+ end
373
+
374
+ @skipped = skipped
375
+ end
376
+
377
+ # Custom attribute writer method with validation
378
+ # @param [Object] failed Value to be assigned
379
+ def failed=(failed)
380
+ if failed.nil?
381
+ fail ArgumentError, 'failed cannot be nil'
382
+ end
383
+
384
+ @failed = failed
385
+ end
386
+
387
+ # Custom attribute writer method checking allowed values (enum).
388
+ # @param [Object] status Object to be assigned
389
+ def status=(status)
390
+ validator = EnumAttributeValidator.new('String', ["draft", "scheduled", "sending", "sent", "paused", "canceled"])
391
+ unless validator.valid?(status)
392
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
393
+ end
394
+ @status = status
395
+ end
396
+
397
+ # Custom attribute writer method checking allowed values (enum).
398
+ # @param [Object] paused_reason Object to be assigned
399
+ def paused_reason=(paused_reason)
400
+ validator = EnumAttributeValidator.new('String', ["PAUSED_BY_USER", "REPUTATION_GUARD", "PLAN_EXCEEDED", "PENDING_VERIFICATION", "AUDIENCE_LIMITS_EXCEEDED", "UNVERIFIED_DOMAIN", "SPAM_CONTENT"])
401
+ unless validator.valid?(paused_reason)
402
+ fail ArgumentError, "invalid value for \"paused_reason\", must be one of #{validator.allowable_values}."
403
+ end
404
+ @paused_reason = paused_reason
405
+ end
406
+
407
+ # Checks equality by comparing each attribute.
408
+ # @param [Object] Object to be compared
409
+ def ==(o)
410
+ return true if self.equal?(o)
411
+ self.class == o.class &&
412
+ total == o.total &&
413
+ sent == o.sent &&
414
+ delivered == o.delivered &&
415
+ opened == o.opened &&
416
+ clicked == o.clicked &&
417
+ bounced == o.bounced &&
418
+ complained == o.complained &&
419
+ unsubscribed == o.unsubscribed &&
420
+ skipped == o.skipped &&
421
+ failed == o.failed &&
422
+ status == o.status &&
423
+ paused_reason == o.paused_reason &&
424
+ schedule_at == o.schedule_at
425
+ end
426
+
427
+ # @see the `==` method
428
+ # @param [Object] Object to be compared
429
+ def eql?(o)
430
+ self == o
431
+ end
432
+
433
+ # Calculates hash code according to all attributes.
434
+ # @return [Integer] Hash code
435
+ def hash
436
+ [total, sent, delivered, opened, clicked, bounced, complained, unsubscribed, skipped, failed, status, paused_reason, schedule_at].hash
437
+ end
438
+
439
+ # Builds the object from hash
440
+ # @param [Hash] attributes Model attributes in the form of hash
441
+ # @return [Object] Returns the model itself
442
+ def self.build_from_hash(attributes)
443
+ return nil unless attributes.is_a?(Hash)
444
+ attributes = attributes.transform_keys(&:to_sym)
445
+ transformed_hash = {}
446
+ openapi_types.each_pair do |key, type|
447
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
448
+ transformed_hash["#{key}"] = nil
449
+ elsif type =~ /\AArray<(.*)>/i
450
+ # check to ensure the input is an array given that the attribute
451
+ # is documented as an array but the input is not
452
+ if attributes[attribute_map[key]].is_a?(Array)
453
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
454
+ end
455
+ elsif !attributes[attribute_map[key]].nil?
456
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
457
+ end
458
+ end
459
+ new(transformed_hash)
460
+ end
461
+
462
+ # Returns the object in the form of hash
463
+ # @return [Hash] Returns the object in the form of hash
464
+ def to_hash
465
+ hash = {}
466
+ self.class.attribute_map.each_pair do |attr, param|
467
+ value = self.send(attr)
468
+ if value.nil?
469
+ is_nullable = self.class.openapi_nullable.include?(attr)
470
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
471
+ end
472
+
473
+ hash[param] = _to_hash(value)
474
+ end
475
+ hash
476
+ end
477
+
478
+ end
479
+
480
+ end