mimepost 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +7 -0
  3. data/README.md +144 -0
  4. data/Rakefile +8 -0
  5. data/docs/AccountProfile.md +23 -0
  6. data/docs/AccountProfileResponse.md +10 -0
  7. data/docs/AccountSettings.md +9 -0
  8. data/docs/AccountsApi.md +216 -0
  9. data/docs/ApiResponse.md +10 -0
  10. data/docs/ApiResponseAllWebhooks.md +10 -0
  11. data/docs/ApiResponseAllWebhooksData.md +13 -0
  12. data/docs/ApiResponseDomainsList.md +10 -0
  13. data/docs/ApiResponseDomainsListData.md +20 -0
  14. data/docs/ApiResponseEmaillogs.md +10 -0
  15. data/docs/ApiResponseEmaillogsData.md +12 -0
  16. data/docs/ApiResponseSingleWebhooks.md +10 -0
  17. data/docs/ApiResponseStats.md +10 -0
  18. data/docs/ApiResponseStatsData.md +10 -0
  19. data/docs/ApiResponseStatsDataDatewiseSummary.md +8 -0
  20. data/docs/ApiResponseStatsDataGraphSummary.md +9 -0
  21. data/docs/ApiResponseStatsDataTotalSummary.md +8 -0
  22. data/docs/ApiResponseStatsDataTotalSummaryStatus.md +9 -0
  23. data/docs/ApiResponseWebhooks.md +10 -0
  24. data/docs/ApiResponseWebhooksData.md +8 -0
  25. data/docs/Domain.md +8 -0
  26. data/docs/DomainsApi.md +427 -0
  27. data/docs/Email.md +17 -0
  28. data/docs/EmailAttachments.md +10 -0
  29. data/docs/EmailGlobalMergeVars.md +9 -0
  30. data/docs/EmailMergeVars.md +9 -0
  31. data/docs/EmailTo.md +9 -0
  32. data/docs/EmailsApi.md +63 -0
  33. data/docs/StatsApi.md +130 -0
  34. data/docs/Webhook.md +11 -0
  35. data/docs/Webhook1.md +11 -0
  36. data/docs/WebhooksApi.md +272 -0
  37. data/example.accounts.rb +22 -0
  38. data/git_push.sh +55 -0
  39. data/lib/mimepost.rb +71 -0
  40. data/lib/mimepost/api/accounts_api.rb +227 -0
  41. data/lib/mimepost/api/domains_api.rb +429 -0
  42. data/lib/mimepost/api/emails_api.rb +77 -0
  43. data/lib/mimepost/api/stats_api.rb +158 -0
  44. data/lib/mimepost/api/webhooks_api.rb +275 -0
  45. data/lib/mimepost/api_client.rb +391 -0
  46. data/lib/mimepost/api_error.rb +38 -0
  47. data/lib/mimepost/configuration.rb +209 -0
  48. data/lib/mimepost/models/account_profile.rb +325 -0
  49. data/lib/mimepost/models/account_profile_response.rb +203 -0
  50. data/lib/mimepost/models/account_settings.rb +194 -0
  51. data/lib/mimepost/models/api_response.rb +203 -0
  52. data/lib/mimepost/models/api_response_all_webhooks.rb +205 -0
  53. data/lib/mimepost/models/api_response_all_webhooks_data.rb +231 -0
  54. data/lib/mimepost/models/api_response_domains_list.rb +205 -0
  55. data/lib/mimepost/models/api_response_domains_list_data.rb +326 -0
  56. data/lib/mimepost/models/api_response_emaillogs.rb +205 -0
  57. data/lib/mimepost/models/api_response_emaillogs_data.rb +220 -0
  58. data/lib/mimepost/models/api_response_single_webhooks.rb +203 -0
  59. data/lib/mimepost/models/api_response_stats.rb +203 -0
  60. data/lib/mimepost/models/api_response_stats_data.rb +202 -0
  61. data/lib/mimepost/models/api_response_stats_data_datewise_summary.rb +184 -0
  62. data/lib/mimepost/models/api_response_stats_data_graph_summary.rb +197 -0
  63. data/lib/mimepost/models/api_response_stats_data_total_summary.rb +184 -0
  64. data/lib/mimepost/models/api_response_stats_data_total_summary_status.rb +193 -0
  65. data/lib/mimepost/models/api_response_webhooks.rb +203 -0
  66. data/lib/mimepost/models/api_response_webhooks_data.rb +184 -0
  67. data/lib/mimepost/models/domain.rb +189 -0
  68. data/lib/mimepost/models/email.rb +297 -0
  69. data/lib/mimepost/models/email_attachments.rb +202 -0
  70. data/lib/mimepost/models/email_global_merge_vars.rb +193 -0
  71. data/lib/mimepost/models/email_merge_vars.rb +193 -0
  72. data/lib/mimepost/models/email_to.rb +195 -0
  73. data/lib/mimepost/models/webhook.rb +223 -0
  74. data/lib/mimepost/models/webhook_1.rb +223 -0
  75. data/lib/mimepost/version.rb +15 -0
  76. data/mimepost.gemspec +46 -0
  77. data/spec/api/accounts_api_spec.rb +81 -0
  78. data/spec/api/domains_api_spec.rb +122 -0
  79. data/spec/api/emails_api_spec.rb +47 -0
  80. data/spec/api/stats_api_spec.rb +63 -0
  81. data/spec/api/webhooks_api_spec.rb +90 -0
  82. data/spec/api_client_spec.rb +243 -0
  83. data/spec/configuration_spec.rb +42 -0
  84. data/spec/models/account_profile_response_spec.rb +53 -0
  85. data/spec/models/account_profile_spec.rb +131 -0
  86. data/spec/models/account_settings_spec.rb +47 -0
  87. data/spec/models/api_response_all_webhooks_data_spec.rb +71 -0
  88. data/spec/models/api_response_all_webhooks_spec.rb +53 -0
  89. data/spec/models/api_response_domains_list_data_spec.rb +117 -0
  90. data/spec/models/api_response_domains_list_spec.rb +53 -0
  91. data/spec/models/api_response_emaillogs_data_spec.rb +65 -0
  92. data/spec/models/api_response_emaillogs_spec.rb +53 -0
  93. data/spec/models/api_response_single_webhooks_spec.rb +53 -0
  94. data/spec/models/api_response_spec.rb +53 -0
  95. data/spec/models/api_response_stats_data_datewise_summary_spec.rb +41 -0
  96. data/spec/models/api_response_stats_data_graph_summary_spec.rb +47 -0
  97. data/spec/models/api_response_stats_data_spec.rb +53 -0
  98. data/spec/models/api_response_stats_data_total_summary_spec.rb +41 -0
  99. data/spec/models/api_response_stats_data_total_summary_status_spec.rb +47 -0
  100. data/spec/models/api_response_stats_spec.rb +53 -0
  101. data/spec/models/api_response_webhooks_data_spec.rb +41 -0
  102. data/spec/models/api_response_webhooks_spec.rb +53 -0
  103. data/spec/models/domain_spec.rb +41 -0
  104. data/spec/models/email_attachments_spec.rb +53 -0
  105. data/spec/models/email_global_merge_vars_spec.rb +47 -0
  106. data/spec/models/email_merge_vars_spec.rb +47 -0
  107. data/spec/models/email_spec.rb +95 -0
  108. data/spec/models/email_to_spec.rb +47 -0
  109. data/spec/models/webhook_1_spec.rb +59 -0
  110. data/spec/models/webhook_spec.rb +59 -0
  111. data/spec/spec_helper.rb +111 -0
  112. metadata +390 -0
@@ -0,0 +1,223 @@
1
+ =begin
2
+ #mimepost
3
+
4
+ #MimePost API for sending email. You can find out more about MimePost at [https://mimepost.com](http://mimepost.com). For this sample, you can use the api key `special-key` to test the authorization filters.
5
+
6
+ OpenAPI spec version: 0.1.0
7
+ Contact: support@mimepost.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.18
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module Mimepost
16
+ class Webhook
17
+ attr_accessor :desc
18
+
19
+ attr_accessor :url
20
+
21
+ attr_accessor :events
22
+
23
+ attr_accessor :active
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'desc' => :'desc',
29
+ :'url' => :'url',
30
+ :'events' => :'events',
31
+ :'active' => :'active'
32
+ }
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ def self.swagger_types
37
+ {
38
+ :'desc' => :'String',
39
+ :'url' => :'String',
40
+ :'events' => :'Array<String>',
41
+ :'active' => :'Integer'
42
+ }
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param [Hash] attributes Model attributes in the form of hash
47
+ def initialize(attributes = {})
48
+ return unless attributes.is_a?(Hash)
49
+
50
+ # convert string to symbol for hash key
51
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
52
+
53
+ if attributes.has_key?(:'desc')
54
+ self.desc = attributes[:'desc']
55
+ end
56
+
57
+ if attributes.has_key?(:'url')
58
+ self.url = attributes[:'url']
59
+ end
60
+
61
+ if attributes.has_key?(:'events')
62
+ if (value = attributes[:'events']).is_a?(Array)
63
+ self.events = value
64
+ end
65
+ end
66
+
67
+ if attributes.has_key?(:'active')
68
+ self.active = attributes[:'active']
69
+ end
70
+ end
71
+
72
+ # Show invalid properties with the reasons. Usually used together with valid?
73
+ # @return Array for valid properties with the reasons
74
+ def list_invalid_properties
75
+ invalid_properties = Array.new
76
+ if @desc.nil?
77
+ invalid_properties.push('invalid value for "desc", desc cannot be nil.')
78
+ end
79
+
80
+ if @url.nil?
81
+ invalid_properties.push('invalid value for "url", url cannot be nil.')
82
+ end
83
+
84
+ invalid_properties
85
+ end
86
+
87
+ # Check to see if the all the properties in the model are valid
88
+ # @return true if the model is valid
89
+ def valid?
90
+ return false if @desc.nil?
91
+ return false if @url.nil?
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
+ desc == o.desc &&
101
+ url == o.url &&
102
+ events == o.events &&
103
+ active == o.active
104
+ end
105
+
106
+ # @see the `==` method
107
+ # @param [Object] Object to be compared
108
+ def eql?(o)
109
+ self == o
110
+ end
111
+
112
+ # Calculates hash code according to all attributes.
113
+ # @return [Fixnum] Hash code
114
+ def hash
115
+ [desc, url, events, active].hash
116
+ end
117
+
118
+ # Builds the object from hash
119
+ # @param [Hash] attributes Model attributes in the form of hash
120
+ # @return [Object] Returns the model itself
121
+ def build_from_hash(attributes)
122
+ return nil unless attributes.is_a?(Hash)
123
+ self.class.swagger_types.each_pair do |key, type|
124
+ if type =~ /\AArray<(.*)>/i
125
+ # check to ensure the input is an array given that the attribute
126
+ # is documented as an array but the input is not
127
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
128
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
129
+ end
130
+ elsif !attributes[self.class.attribute_map[key]].nil?
131
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
132
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
133
+ end
134
+
135
+ self
136
+ end
137
+
138
+ # Deserializes the data based on type
139
+ # @param string type Data type
140
+ # @param string value Value to be deserialized
141
+ # @return [Object] Deserialized data
142
+ def _deserialize(type, value)
143
+ case type.to_sym
144
+ when :DateTime
145
+ DateTime.parse(value)
146
+ when :Date
147
+ Date.parse(value)
148
+ when :String
149
+ value.to_s
150
+ when :Integer
151
+ value.to_i
152
+ when :Float
153
+ value.to_f
154
+ when :BOOLEAN
155
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
156
+ true
157
+ else
158
+ false
159
+ end
160
+ when :Object
161
+ # generic object (usually a Hash), return directly
162
+ value
163
+ when /\AArray<(?<inner_type>.+)>\z/
164
+ inner_type = Regexp.last_match[:inner_type]
165
+ value.map { |v| _deserialize(inner_type, v) }
166
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
167
+ k_type = Regexp.last_match[:k_type]
168
+ v_type = Regexp.last_match[:v_type]
169
+ {}.tap do |hash|
170
+ value.each do |k, v|
171
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
172
+ end
173
+ end
174
+ else # model
175
+ temp_model = Mimepost.const_get(type).new
176
+ temp_model.build_from_hash(value)
177
+ end
178
+ end
179
+
180
+ # Returns the string representation of the object
181
+ # @return [String] String presentation of the object
182
+ def to_s
183
+ to_hash.to_s
184
+ end
185
+
186
+ # to_body is an alias to to_hash (backward compatibility)
187
+ # @return [Hash] Returns the object in the form of hash
188
+ def to_body
189
+ to_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
+ next if value.nil?
199
+ hash[param] = _to_hash(value)
200
+ end
201
+ hash
202
+ end
203
+
204
+ # Outputs non-array value in the form of hash
205
+ # For object, use to_hash. Otherwise, just return the value
206
+ # @param [Object] value Any valid value
207
+ # @return [Hash] Returns the value in the form of hash
208
+ def _to_hash(value)
209
+ if value.is_a?(Array)
210
+ value.compact.map { |v| _to_hash(v) }
211
+ elsif value.is_a?(Hash)
212
+ {}.tap do |hash|
213
+ value.each { |k, v| hash[k] = _to_hash(v) }
214
+ end
215
+ elsif value.respond_to? :to_hash
216
+ value.to_hash
217
+ else
218
+ value
219
+ end
220
+ end
221
+
222
+ end
223
+ end
@@ -0,0 +1,223 @@
1
+ =begin
2
+ #mimepost
3
+
4
+ #MimePost API for sending email. You can find out more about MimePost at [https://mimepost.com](http://mimepost.com). For this sample, you can use the api key `special-key` to test the authorization filters.
5
+
6
+ OpenAPI spec version: 0.1.0
7
+ Contact: support@mimepost.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.18
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module Mimepost
16
+ class Webhook1
17
+ attr_accessor :desc
18
+
19
+ attr_accessor :url
20
+
21
+ attr_accessor :events
22
+
23
+ attr_accessor :active
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'desc' => :'desc',
29
+ :'url' => :'url',
30
+ :'events' => :'events',
31
+ :'active' => :'active'
32
+ }
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ def self.swagger_types
37
+ {
38
+ :'desc' => :'String',
39
+ :'url' => :'String',
40
+ :'events' => :'Array<String>',
41
+ :'active' => :'Integer'
42
+ }
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param [Hash] attributes Model attributes in the form of hash
47
+ def initialize(attributes = {})
48
+ return unless attributes.is_a?(Hash)
49
+
50
+ # convert string to symbol for hash key
51
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
52
+
53
+ if attributes.has_key?(:'desc')
54
+ self.desc = attributes[:'desc']
55
+ end
56
+
57
+ if attributes.has_key?(:'url')
58
+ self.url = attributes[:'url']
59
+ end
60
+
61
+ if attributes.has_key?(:'events')
62
+ if (value = attributes[:'events']).is_a?(Array)
63
+ self.events = value
64
+ end
65
+ end
66
+
67
+ if attributes.has_key?(:'active')
68
+ self.active = attributes[:'active']
69
+ end
70
+ end
71
+
72
+ # Show invalid properties with the reasons. Usually used together with valid?
73
+ # @return Array for valid properties with the reasons
74
+ def list_invalid_properties
75
+ invalid_properties = Array.new
76
+ if @desc.nil?
77
+ invalid_properties.push('invalid value for "desc", desc cannot be nil.')
78
+ end
79
+
80
+ if @url.nil?
81
+ invalid_properties.push('invalid value for "url", url cannot be nil.')
82
+ end
83
+
84
+ invalid_properties
85
+ end
86
+
87
+ # Check to see if the all the properties in the model are valid
88
+ # @return true if the model is valid
89
+ def valid?
90
+ return false if @desc.nil?
91
+ return false if @url.nil?
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
+ desc == o.desc &&
101
+ url == o.url &&
102
+ events == o.events &&
103
+ active == o.active
104
+ end
105
+
106
+ # @see the `==` method
107
+ # @param [Object] Object to be compared
108
+ def eql?(o)
109
+ self == o
110
+ end
111
+
112
+ # Calculates hash code according to all attributes.
113
+ # @return [Fixnum] Hash code
114
+ def hash
115
+ [desc, url, events, active].hash
116
+ end
117
+
118
+ # Builds the object from hash
119
+ # @param [Hash] attributes Model attributes in the form of hash
120
+ # @return [Object] Returns the model itself
121
+ def build_from_hash(attributes)
122
+ return nil unless attributes.is_a?(Hash)
123
+ self.class.swagger_types.each_pair do |key, type|
124
+ if type =~ /\AArray<(.*)>/i
125
+ # check to ensure the input is an array given that the attribute
126
+ # is documented as an array but the input is not
127
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
128
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
129
+ end
130
+ elsif !attributes[self.class.attribute_map[key]].nil?
131
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
132
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
133
+ end
134
+
135
+ self
136
+ end
137
+
138
+ # Deserializes the data based on type
139
+ # @param string type Data type
140
+ # @param string value Value to be deserialized
141
+ # @return [Object] Deserialized data
142
+ def _deserialize(type, value)
143
+ case type.to_sym
144
+ when :DateTime
145
+ DateTime.parse(value)
146
+ when :Date
147
+ Date.parse(value)
148
+ when :String
149
+ value.to_s
150
+ when :Integer
151
+ value.to_i
152
+ when :Float
153
+ value.to_f
154
+ when :BOOLEAN
155
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
156
+ true
157
+ else
158
+ false
159
+ end
160
+ when :Object
161
+ # generic object (usually a Hash), return directly
162
+ value
163
+ when /\AArray<(?<inner_type>.+)>\z/
164
+ inner_type = Regexp.last_match[:inner_type]
165
+ value.map { |v| _deserialize(inner_type, v) }
166
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
167
+ k_type = Regexp.last_match[:k_type]
168
+ v_type = Regexp.last_match[:v_type]
169
+ {}.tap do |hash|
170
+ value.each do |k, v|
171
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
172
+ end
173
+ end
174
+ else # model
175
+ temp_model = Mimepost.const_get(type).new
176
+ temp_model.build_from_hash(value)
177
+ end
178
+ end
179
+
180
+ # Returns the string representation of the object
181
+ # @return [String] String presentation of the object
182
+ def to_s
183
+ to_hash.to_s
184
+ end
185
+
186
+ # to_body is an alias to to_hash (backward compatibility)
187
+ # @return [Hash] Returns the object in the form of hash
188
+ def to_body
189
+ to_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
+ next if value.nil?
199
+ hash[param] = _to_hash(value)
200
+ end
201
+ hash
202
+ end
203
+
204
+ # Outputs non-array value in the form of hash
205
+ # For object, use to_hash. Otherwise, just return the value
206
+ # @param [Object] value Any valid value
207
+ # @return [Hash] Returns the value in the form of hash
208
+ def _to_hash(value)
209
+ if value.is_a?(Array)
210
+ value.compact.map { |v| _to_hash(v) }
211
+ elsif value.is_a?(Hash)
212
+ {}.tap do |hash|
213
+ value.each { |k, v| hash[k] = _to_hash(v) }
214
+ end
215
+ elsif value.respond_to? :to_hash
216
+ value.to_hash
217
+ else
218
+ value
219
+ end
220
+ end
221
+
222
+ end
223
+ end
@@ -0,0 +1,15 @@
1
+ =begin
2
+ #mimepost
3
+
4
+ #MimePost API for sending email. You can find out more about MimePost at [https://mimepost.com](http://mimepost.com). For this sample, you can use the api key `special-key` to test the authorization filters.
5
+
6
+ OpenAPI spec version: 0.1.0
7
+ Contact: support@mimepost.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.18
10
+
11
+ =end
12
+
13
+ module Mimepost
14
+ VERSION = '1.0.0'
15
+ end