sendmux-sending 1.0.0

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 (30) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +12 -0
  3. data/README.md +3 -0
  4. data/lib/sendmux/sending/client.rb +34 -0
  5. data/lib/sendmux/sending/version.rb +7 -0
  6. data/lib/sendmux/sending.rb +12 -0
  7. data/lib/sendmux_sending_generated/api/emails_api.rb +190 -0
  8. data/lib/sendmux_sending_generated/api_client.rb +441 -0
  9. data/lib/sendmux_sending_generated/api_error.rb +58 -0
  10. data/lib/sendmux_sending_generated/api_model_base.rb +88 -0
  11. data/lib/sendmux_sending_generated/configuration.rb +392 -0
  12. data/lib/sendmux_sending_generated/models/address.rb +215 -0
  13. data/lib/sendmux_sending_generated/models/attachment.rb +274 -0
  14. data/lib/sendmux_sending_generated/models/batch_result_item.rb +256 -0
  15. data/lib/sendmux_sending_generated/models/batch_send_request.rb +185 -0
  16. data/lib/sendmux_sending_generated/models/batch_send_success_data.rb +192 -0
  17. data/lib/sendmux_sending_generated/models/batch_send_success_response.rb +223 -0
  18. data/lib/sendmux_sending_generated/models/batch_summary.rb +219 -0
  19. data/lib/sendmux_sending_generated/models/email_send_request.rb +465 -0
  20. data/lib/sendmux_sending_generated/models/error_detail.rb +251 -0
  21. data/lib/sendmux_sending_generated/models/error_issue.rb +219 -0
  22. data/lib/sendmux_sending_generated/models/error_response.rb +216 -0
  23. data/lib/sendmux_sending_generated/models/meta.rb +165 -0
  24. data/lib/sendmux_sending_generated/models/recipient.rb +214 -0
  25. data/lib/sendmux_sending_generated/models/send_success_data.rb +227 -0
  26. data/lib/sendmux_sending_generated/models/send_success_response.rb +223 -0
  27. data/lib/sendmux_sending_generated/models/success_envelope.rb +190 -0
  28. data/lib/sendmux_sending_generated/version.rb +15 -0
  29. data/lib/sendmux_sending_generated.rb +57 -0
  30. metadata +146 -0
@@ -0,0 +1,219 @@
1
+ =begin
2
+ #SendMux Sending API
3
+
4
+ #Send emails programmatically via the SendMux email infrastructure. Every response carries an `X-Request-Id` header; errors include a `retryable` flag. 429 and 503 responses include `Retry-After`. Mutating endpoints accept an `Idempotency-Key` header for safe retries.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Sendmux::Sending::Generated
17
+ class ErrorIssue < ApiModelBase
18
+ # Issue code from the validator
19
+ attr_accessor :code
20
+
21
+ # Dot-path to the failing field
22
+ attr_accessor :field
23
+
24
+ # Human-readable issue message
25
+ attr_accessor :message
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'code' => :'code',
31
+ :'field' => :'field',
32
+ :'message' => :'message'
33
+ }
34
+ end
35
+
36
+ # Returns attribute mapping this model knows about
37
+ def self.acceptable_attribute_map
38
+ attribute_map
39
+ end
40
+
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ acceptable_attribute_map.values
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'code' => :'String',
50
+ :'field' => :'String',
51
+ :'message' => :'String'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ ])
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Sendmux::Sending::Generated::ErrorIssue` initialize method"
66
+ end
67
+
68
+ # check to see if the attribute exists and convert string to symbol for hash key
69
+ acceptable_attribute_map = self.class.acceptable_attribute_map
70
+ attributes = attributes.each_with_object({}) { |(k, v), h|
71
+ if (!acceptable_attribute_map.key?(k.to_sym))
72
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Sendmux::Sending::Generated::ErrorIssue`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
73
+ end
74
+ h[k.to_sym] = v
75
+ }
76
+
77
+ if attributes.key?(:'code')
78
+ self.code = attributes[:'code']
79
+ else
80
+ self.code = nil
81
+ end
82
+
83
+ if attributes.key?(:'field')
84
+ self.field = attributes[:'field']
85
+ else
86
+ self.field = nil
87
+ end
88
+
89
+ if attributes.key?(:'message')
90
+ self.message = attributes[:'message']
91
+ else
92
+ self.message = nil
93
+ end
94
+ end
95
+
96
+ # Show invalid properties with the reasons. Usually used together with valid?
97
+ # @return Array for valid properties with the reasons
98
+ def list_invalid_properties
99
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
100
+ invalid_properties = Array.new
101
+ if @code.nil?
102
+ invalid_properties.push('invalid value for "code", code cannot be nil.')
103
+ end
104
+
105
+ if @field.nil?
106
+ invalid_properties.push('invalid value for "field", field cannot be nil.')
107
+ end
108
+
109
+ if @message.nil?
110
+ invalid_properties.push('invalid value for "message", message cannot be nil.')
111
+ end
112
+
113
+ invalid_properties
114
+ end
115
+
116
+ # Check to see if the all the properties in the model are valid
117
+ # @return true if the model is valid
118
+ def valid?
119
+ warn '[DEPRECATED] the `valid?` method is obsolete'
120
+ return false if @code.nil?
121
+ return false if @field.nil?
122
+ return false if @message.nil?
123
+ true
124
+ end
125
+
126
+ # Custom attribute writer method with validation
127
+ # @param [Object] code Value to be assigned
128
+ def code=(code)
129
+ if code.nil?
130
+ fail ArgumentError, 'code cannot be nil'
131
+ end
132
+
133
+ @code = code
134
+ end
135
+
136
+ # Custom attribute writer method with validation
137
+ # @param [Object] field Value to be assigned
138
+ def field=(field)
139
+ if field.nil?
140
+ fail ArgumentError, 'field cannot be nil'
141
+ end
142
+
143
+ @field = field
144
+ end
145
+
146
+ # Custom attribute writer method with validation
147
+ # @param [Object] message Value to be assigned
148
+ def message=(message)
149
+ if message.nil?
150
+ fail ArgumentError, 'message cannot be nil'
151
+ end
152
+
153
+ @message = message
154
+ end
155
+
156
+ # Checks equality by comparing each attribute.
157
+ # @param [Object] Object to be compared
158
+ def ==(o)
159
+ return true if self.equal?(o)
160
+ self.class == o.class &&
161
+ code == o.code &&
162
+ field == o.field &&
163
+ message == o.message
164
+ end
165
+
166
+ # @see the `==` method
167
+ # @param [Object] Object to be compared
168
+ def eql?(o)
169
+ self == o
170
+ end
171
+
172
+ # Calculates hash code according to all attributes.
173
+ # @return [Integer] Hash code
174
+ def hash
175
+ [code, field, message].hash
176
+ end
177
+
178
+ # Builds the object from hash
179
+ # @param [Hash] attributes Model attributes in the form of hash
180
+ # @return [Object] Returns the model itself
181
+ def self.build_from_hash(attributes)
182
+ return nil unless attributes.is_a?(Hash)
183
+ attributes = attributes.transform_keys(&:to_sym)
184
+ transformed_hash = {}
185
+ openapi_types.each_pair do |key, type|
186
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
187
+ transformed_hash["#{key}"] = nil
188
+ elsif type =~ /\AArray<(.*)>/i
189
+ # check to ensure the input is an array given that the attribute
190
+ # is documented as an array but the input is not
191
+ if attributes[attribute_map[key]].is_a?(Array)
192
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
193
+ end
194
+ elsif !attributes[attribute_map[key]].nil?
195
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
196
+ end
197
+ end
198
+ new(transformed_hash)
199
+ end
200
+
201
+ # Returns the object in the form of hash
202
+ # @return [Hash] Returns the object in the form of hash
203
+ def to_hash
204
+ hash = {}
205
+ self.class.attribute_map.each_pair do |attr, param|
206
+ value = self.send(attr)
207
+ if value.nil?
208
+ is_nullable = self.class.openapi_nullable.include?(attr)
209
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
210
+ end
211
+
212
+ hash[param] = _to_hash(value)
213
+ end
214
+ hash
215
+ end
216
+
217
+ end
218
+
219
+ end
@@ -0,0 +1,216 @@
1
+ =begin
2
+ #SendMux Sending API
3
+
4
+ #Send emails programmatically via the SendMux email infrastructure. Every response carries an `X-Request-Id` header; errors include a `retryable` flag. 429 and 503 responses include `Retry-After`. Mutating endpoints accept an `Idempotency-Key` header for safe retries.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Sendmux::Sending::Generated
17
+ class ErrorResponse < ApiModelBase
18
+ attr_accessor :error
19
+
20
+ attr_accessor :meta
21
+
22
+ attr_accessor :ok
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'error' => :'error',
28
+ :'meta' => :'meta',
29
+ :'ok' => :'ok'
30
+ }
31
+ end
32
+
33
+ # Returns attribute mapping this model knows about
34
+ def self.acceptable_attribute_map
35
+ attribute_map
36
+ end
37
+
38
+ # Returns all the JSON keys this model knows about
39
+ def self.acceptable_attributes
40
+ acceptable_attribute_map.values
41
+ end
42
+
43
+ # Attribute type mapping.
44
+ def self.openapi_types
45
+ {
46
+ :'error' => :'ErrorDetail',
47
+ :'meta' => :'Meta',
48
+ :'ok' => :'Boolean'
49
+ }
50
+ end
51
+
52
+ # List of attributes with nullable: true
53
+ def self.openapi_nullable
54
+ Set.new([
55
+ ])
56
+ end
57
+
58
+ # Initializes the object
59
+ # @param [Hash] attributes Model attributes in the form of hash
60
+ def initialize(attributes = {})
61
+ if (!attributes.is_a?(Hash))
62
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Sendmux::Sending::Generated::ErrorResponse` initialize method"
63
+ end
64
+
65
+ # check to see if the attribute exists and convert string to symbol for hash key
66
+ acceptable_attribute_map = self.class.acceptable_attribute_map
67
+ attributes = attributes.each_with_object({}) { |(k, v), h|
68
+ if (!acceptable_attribute_map.key?(k.to_sym))
69
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Sendmux::Sending::Generated::ErrorResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
70
+ end
71
+ h[k.to_sym] = v
72
+ }
73
+
74
+ if attributes.key?(:'error')
75
+ self.error = attributes[:'error']
76
+ else
77
+ self.error = nil
78
+ end
79
+
80
+ if attributes.key?(:'meta')
81
+ self.meta = attributes[:'meta']
82
+ else
83
+ self.meta = nil
84
+ end
85
+
86
+ if attributes.key?(:'ok')
87
+ self.ok = attributes[:'ok']
88
+ else
89
+ self.ok = nil
90
+ end
91
+ end
92
+
93
+ # Show invalid properties with the reasons. Usually used together with valid?
94
+ # @return Array for valid properties with the reasons
95
+ def list_invalid_properties
96
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
97
+ invalid_properties = Array.new
98
+ if @error.nil?
99
+ invalid_properties.push('invalid value for "error", error cannot be nil.')
100
+ end
101
+
102
+ if @meta.nil?
103
+ invalid_properties.push('invalid value for "meta", meta cannot be nil.')
104
+ end
105
+
106
+ if @ok.nil?
107
+ invalid_properties.push('invalid value for "ok", ok cannot be nil.')
108
+ end
109
+
110
+ invalid_properties
111
+ end
112
+
113
+ # Check to see if the all the properties in the model are valid
114
+ # @return true if the model is valid
115
+ def valid?
116
+ warn '[DEPRECATED] the `valid?` method is obsolete'
117
+ return false if @error.nil?
118
+ return false if @meta.nil?
119
+ return false if @ok.nil?
120
+ true
121
+ end
122
+
123
+ # Custom attribute writer method with validation
124
+ # @param [Object] error Value to be assigned
125
+ def error=(error)
126
+ if error.nil?
127
+ fail ArgumentError, 'error cannot be nil'
128
+ end
129
+
130
+ @error = error
131
+ end
132
+
133
+ # Custom attribute writer method with validation
134
+ # @param [Object] meta Value to be assigned
135
+ def meta=(meta)
136
+ if meta.nil?
137
+ fail ArgumentError, 'meta cannot be nil'
138
+ end
139
+
140
+ @meta = meta
141
+ end
142
+
143
+ # Custom attribute writer method with validation
144
+ # @param [Object] ok Value to be assigned
145
+ def ok=(ok)
146
+ if ok.nil?
147
+ fail ArgumentError, 'ok cannot be nil'
148
+ end
149
+
150
+ @ok = ok
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
+ error == o.error &&
159
+ meta == o.meta &&
160
+ ok == o.ok
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
+ [error, meta, ok].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,165 @@
1
+ =begin
2
+ #SendMux Sending API
3
+
4
+ #Send emails programmatically via the SendMux email infrastructure. Every response carries an `X-Request-Id` header; errors include a `retryable` flag. 429 and 503 responses include `Retry-After`. Mutating endpoints accept an `Idempotency-Key` header for safe retries.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.22.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Sendmux::Sending::Generated
17
+ class Meta < ApiModelBase
18
+ # Unique request identifier
19
+ attr_accessor :request_id
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'request_id' => :'request_id'
25
+ }
26
+ end
27
+
28
+ # Returns attribute mapping this model knows about
29
+ def self.acceptable_attribute_map
30
+ attribute_map
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ acceptable_attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'request_id' => :'String'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Sendmux::Sending::Generated::Meta` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ acceptable_attribute_map = self.class.acceptable_attribute_map
60
+ attributes = attributes.each_with_object({}) { |(k, v), h|
61
+ if (!acceptable_attribute_map.key?(k.to_sym))
62
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Sendmux::Sending::Generated::Meta`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
63
+ end
64
+ h[k.to_sym] = v
65
+ }
66
+
67
+ if attributes.key?(:'request_id')
68
+ self.request_id = attributes[:'request_id']
69
+ else
70
+ self.request_id = nil
71
+ end
72
+ end
73
+
74
+ # Show invalid properties with the reasons. Usually used together with valid?
75
+ # @return Array for valid properties with the reasons
76
+ def list_invalid_properties
77
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
78
+ invalid_properties = Array.new
79
+ if @request_id.nil?
80
+ invalid_properties.push('invalid value for "request_id", request_id cannot be nil.')
81
+ end
82
+
83
+ invalid_properties
84
+ end
85
+
86
+ # Check to see if the all the properties in the model are valid
87
+ # @return true if the model is valid
88
+ def valid?
89
+ warn '[DEPRECATED] the `valid?` method is obsolete'
90
+ return false if @request_id.nil?
91
+ true
92
+ end
93
+
94
+ # Custom attribute writer method with validation
95
+ # @param [Object] request_id Value to be assigned
96
+ def request_id=(request_id)
97
+ if request_id.nil?
98
+ fail ArgumentError, 'request_id cannot be nil'
99
+ end
100
+
101
+ @request_id = request_id
102
+ end
103
+
104
+ # Checks equality by comparing each attribute.
105
+ # @param [Object] Object to be compared
106
+ def ==(o)
107
+ return true if self.equal?(o)
108
+ self.class == o.class &&
109
+ request_id == o.request_id
110
+ end
111
+
112
+ # @see the `==` method
113
+ # @param [Object] Object to be compared
114
+ def eql?(o)
115
+ self == o
116
+ end
117
+
118
+ # Calculates hash code according to all attributes.
119
+ # @return [Integer] Hash code
120
+ def hash
121
+ [request_id].hash
122
+ end
123
+
124
+ # Builds the object from hash
125
+ # @param [Hash] attributes Model attributes in the form of hash
126
+ # @return [Object] Returns the model itself
127
+ def self.build_from_hash(attributes)
128
+ return nil unless attributes.is_a?(Hash)
129
+ attributes = attributes.transform_keys(&:to_sym)
130
+ transformed_hash = {}
131
+ openapi_types.each_pair do |key, type|
132
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
133
+ transformed_hash["#{key}"] = nil
134
+ elsif type =~ /\AArray<(.*)>/i
135
+ # check to ensure the input is an array given that the attribute
136
+ # is documented as an array but the input is not
137
+ if attributes[attribute_map[key]].is_a?(Array)
138
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
139
+ end
140
+ elsif !attributes[attribute_map[key]].nil?
141
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
142
+ end
143
+ end
144
+ new(transformed_hash)
145
+ end
146
+
147
+ # Returns the object in the form of hash
148
+ # @return [Hash] Returns the object in the form of hash
149
+ def to_hash
150
+ hash = {}
151
+ self.class.attribute_map.each_pair do |attr, param|
152
+ value = self.send(attr)
153
+ if value.nil?
154
+ is_nullable = self.class.openapi_nullable.include?(attr)
155
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
156
+ end
157
+
158
+ hash[param] = _to_hash(value)
159
+ end
160
+ hash
161
+ end
162
+
163
+ end
164
+
165
+ end