zyphr 0.1.31 → 0.1.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 (35) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +12 -0
  3. data/docs/DeleteDomainResponse.md +20 -0
  4. data/docs/DeleteDomainResponseData.md +20 -0
  5. data/docs/DomainResponse.md +5 -1
  6. data/docs/DomainsApi.md +288 -0
  7. data/docs/GetDomain200Response.md +20 -0
  8. data/docs/GetDomain200ResponseMeta.md +18 -0
  9. data/docs/VerificationStatusResponse.md +20 -0
  10. data/docs/VerificationStatusResponseData.md +32 -0
  11. data/docs/VerifyDomainResponse.md +20 -0
  12. data/docs/VerifyDomainResponseData.md +24 -0
  13. data/lib/zyphr/api/domains_api.rb +252 -0
  14. data/lib/zyphr/models/delete_domain_response.rb +263 -0
  15. data/lib/zyphr/models/delete_domain_response_data.rb +263 -0
  16. data/lib/zyphr/models/domain_response.rb +46 -2
  17. data/lib/zyphr/models/get_domain200_response.rb +229 -0
  18. data/lib/zyphr/models/get_domain200_response_meta.rb +220 -0
  19. data/lib/zyphr/models/verification_status_response.rb +263 -0
  20. data/lib/zyphr/models/verification_status_response_data.rb +415 -0
  21. data/lib/zyphr/models/verify_domain_response.rb +263 -0
  22. data/lib/zyphr/models/verify_domain_response_data.rb +339 -0
  23. data/lib/zyphr.rb +8 -0
  24. data/spec/api/domains_api_spec.rb +48 -0
  25. data/spec/models/delete_domain_response_data_spec.rb +42 -0
  26. data/spec/models/delete_domain_response_spec.rb +42 -0
  27. data/spec/models/domain_response_spec.rb +20 -0
  28. data/spec/models/get_domain200_response_meta_spec.rb +36 -0
  29. data/spec/models/get_domain200_response_spec.rb +42 -0
  30. data/spec/models/verification_status_response_data_spec.rb +82 -0
  31. data/spec/models/verification_status_response_spec.rb +42 -0
  32. data/spec/models/verify_domain_response_data_spec.rb +58 -0
  33. data/spec/models/verify_domain_response_spec.rb +42 -0
  34. data/zyphr.gemspec +1 -1
  35. metadata +33 -1
@@ -87,6 +87,195 @@ module Zyphr
87
87
  return data, status_code, headers
88
88
  end
89
89
 
90
+ # Remove a sending domain
91
+ # Remove a sending domain from the project. The domain is also detached from any SES identity that was provisioned for it. Returns 409 if the domain is still referenced by other resources (templates, scheduled sends, etc.) — those must be removed first.
92
+ # @param id [String]
93
+ # @param [Hash] opts the optional parameters
94
+ # @return [DeleteDomainResponse]
95
+ def delete_domain(id, opts = {})
96
+ data, _status_code, _headers = delete_domain_with_http_info(id, opts)
97
+ data
98
+ end
99
+
100
+ # Remove a sending domain
101
+ # Remove a sending domain from the project. The domain is also detached from any SES identity that was provisioned for it. Returns 409 if the domain is still referenced by other resources (templates, scheduled sends, etc.) — those must be removed first.
102
+ # @param id [String]
103
+ # @param [Hash] opts the optional parameters
104
+ # @return [Array<(DeleteDomainResponse, Integer, Hash)>] DeleteDomainResponse data, response status code and response headers
105
+ def delete_domain_with_http_info(id, opts = {})
106
+ if @api_client.config.debugging
107
+ @api_client.config.logger.debug 'Calling API: DomainsApi.delete_domain ...'
108
+ end
109
+ # verify the required parameter 'id' is set
110
+ if @api_client.config.client_side_validation && id.nil?
111
+ fail ArgumentError, "Missing the required parameter 'id' when calling DomainsApi.delete_domain"
112
+ end
113
+ # resource path
114
+ local_var_path = '/domains/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
115
+
116
+ # query parameters
117
+ query_params = opts[:query_params] || {}
118
+
119
+ # header parameters
120
+ header_params = opts[:header_params] || {}
121
+ # HTTP header 'Accept' (if needed)
122
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
123
+
124
+ # form parameters
125
+ form_params = opts[:form_params] || {}
126
+
127
+ # http body (model)
128
+ post_body = opts[:debug_body]
129
+
130
+ # return_type
131
+ return_type = opts[:debug_return_type] || 'DeleteDomainResponse'
132
+
133
+ # auth_names
134
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
135
+
136
+ new_options = opts.merge(
137
+ :operation => :"DomainsApi.delete_domain",
138
+ :header_params => header_params,
139
+ :query_params => query_params,
140
+ :form_params => form_params,
141
+ :body => post_body,
142
+ :auth_names => auth_names,
143
+ :return_type => return_type
144
+ )
145
+
146
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
147
+ if @api_client.config.debugging
148
+ @api_client.config.logger.debug "API called: DomainsApi#delete_domain\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
149
+ end
150
+ return data, status_code, headers
151
+ end
152
+
153
+ # Get a sending domain
154
+ # Retrieve a single sending domain by ID, including DNS records and verification counters.
155
+ # @param id [String]
156
+ # @param [Hash] opts the optional parameters
157
+ # @return [GetDomain200Response]
158
+ def get_domain(id, opts = {})
159
+ data, _status_code, _headers = get_domain_with_http_info(id, opts)
160
+ data
161
+ end
162
+
163
+ # Get a sending domain
164
+ # Retrieve a single sending domain by ID, including DNS records and verification counters.
165
+ # @param id [String]
166
+ # @param [Hash] opts the optional parameters
167
+ # @return [Array<(GetDomain200Response, Integer, Hash)>] GetDomain200Response data, response status code and response headers
168
+ def get_domain_with_http_info(id, opts = {})
169
+ if @api_client.config.debugging
170
+ @api_client.config.logger.debug 'Calling API: DomainsApi.get_domain ...'
171
+ end
172
+ # verify the required parameter 'id' is set
173
+ if @api_client.config.client_side_validation && id.nil?
174
+ fail ArgumentError, "Missing the required parameter 'id' when calling DomainsApi.get_domain"
175
+ end
176
+ # resource path
177
+ local_var_path = '/domains/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
178
+
179
+ # query parameters
180
+ query_params = opts[:query_params] || {}
181
+
182
+ # header parameters
183
+ header_params = opts[:header_params] || {}
184
+ # HTTP header 'Accept' (if needed)
185
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
186
+
187
+ # form parameters
188
+ form_params = opts[:form_params] || {}
189
+
190
+ # http body (model)
191
+ post_body = opts[:debug_body]
192
+
193
+ # return_type
194
+ return_type = opts[:debug_return_type] || 'GetDomain200Response'
195
+
196
+ # auth_names
197
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
198
+
199
+ new_options = opts.merge(
200
+ :operation => :"DomainsApi.get_domain",
201
+ :header_params => header_params,
202
+ :query_params => query_params,
203
+ :form_params => form_params,
204
+ :body => post_body,
205
+ :auth_names => auth_names,
206
+ :return_type => return_type
207
+ )
208
+
209
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
210
+ if @api_client.config.debugging
211
+ @api_client.config.logger.debug "API called: DomainsApi#get_domain\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
212
+ end
213
+ return data, status_code, headers
214
+ end
215
+
216
+ # Get domain verification status
217
+ # Returns the current verification status with per-record `verified` flags and aggregate counters. Useful when polling for terminal status from an AI agent (the recommended pattern is to subscribe to the `domain.verified` webhook event instead — see sc-5444).
218
+ # @param id [String] Domain ID
219
+ # @param [Hash] opts the optional parameters
220
+ # @return [VerificationStatusResponse]
221
+ def get_domain_verification_status(id, opts = {})
222
+ data, _status_code, _headers = get_domain_verification_status_with_http_info(id, opts)
223
+ data
224
+ end
225
+
226
+ # Get domain verification status
227
+ # Returns the current verification status with per-record &#x60;verified&#x60; flags and aggregate counters. Useful when polling for terminal status from an AI agent (the recommended pattern is to subscribe to the &#x60;domain.verified&#x60; webhook event instead — see sc-5444).
228
+ # @param id [String] Domain ID
229
+ # @param [Hash] opts the optional parameters
230
+ # @return [Array<(VerificationStatusResponse, Integer, Hash)>] VerificationStatusResponse data, response status code and response headers
231
+ def get_domain_verification_status_with_http_info(id, opts = {})
232
+ if @api_client.config.debugging
233
+ @api_client.config.logger.debug 'Calling API: DomainsApi.get_domain_verification_status ...'
234
+ end
235
+ # verify the required parameter 'id' is set
236
+ if @api_client.config.client_side_validation && id.nil?
237
+ fail ArgumentError, "Missing the required parameter 'id' when calling DomainsApi.get_domain_verification_status"
238
+ end
239
+ # resource path
240
+ local_var_path = '/domains/{id}/verification-status'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
241
+
242
+ # query parameters
243
+ query_params = opts[:query_params] || {}
244
+
245
+ # header parameters
246
+ header_params = opts[:header_params] || {}
247
+ # HTTP header 'Accept' (if needed)
248
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
249
+
250
+ # form parameters
251
+ form_params = opts[:form_params] || {}
252
+
253
+ # http body (model)
254
+ post_body = opts[:debug_body]
255
+
256
+ # return_type
257
+ return_type = opts[:debug_return_type] || 'VerificationStatusResponse'
258
+
259
+ # auth_names
260
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
261
+
262
+ new_options = opts.merge(
263
+ :operation => :"DomainsApi.get_domain_verification_status",
264
+ :header_params => header_params,
265
+ :query_params => query_params,
266
+ :form_params => form_params,
267
+ :body => post_body,
268
+ :auth_names => auth_names,
269
+ :return_type => return_type
270
+ )
271
+
272
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
273
+ if @api_client.config.debugging
274
+ @api_client.config.logger.debug "API called: DomainsApi#get_domain_verification_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
275
+ end
276
+ return data, status_code, headers
277
+ end
278
+
90
279
  # List sending domains
91
280
  # List sending domains on the current project, with verification status and DNS records.
92
281
  # @param [Hash] opts the optional parameters
@@ -143,5 +332,68 @@ module Zyphr
143
332
  end
144
333
  return data, status_code, headers
145
334
  end
335
+
336
+ # Trigger domain verification
337
+ # Queue an asynchronous DNS verification check. Returns immediately with a `job_id`. Poll `GET /v1/domains/{id}/verification-status` (or the higher-level `GET /v1/domains/{id}`) for the result, or subscribe to the `domain.verified` webhook event when sc-5444 ships. Returns 409 if a verification is already in progress for this domain (within the last 2 minutes).
338
+ # @param id [String]
339
+ # @param [Hash] opts the optional parameters
340
+ # @return [VerifyDomainResponse]
341
+ def verify_domain(id, opts = {})
342
+ data, _status_code, _headers = verify_domain_with_http_info(id, opts)
343
+ data
344
+ end
345
+
346
+ # Trigger domain verification
347
+ # Queue an asynchronous DNS verification check. Returns immediately with a &#x60;job_id&#x60;. Poll &#x60;GET /v1/domains/{id}/verification-status&#x60; (or the higher-level &#x60;GET /v1/domains/{id}&#x60;) for the result, or subscribe to the &#x60;domain.verified&#x60; webhook event when sc-5444 ships. Returns 409 if a verification is already in progress for this domain (within the last 2 minutes).
348
+ # @param id [String]
349
+ # @param [Hash] opts the optional parameters
350
+ # @return [Array<(VerifyDomainResponse, Integer, Hash)>] VerifyDomainResponse data, response status code and response headers
351
+ def verify_domain_with_http_info(id, opts = {})
352
+ if @api_client.config.debugging
353
+ @api_client.config.logger.debug 'Calling API: DomainsApi.verify_domain ...'
354
+ end
355
+ # verify the required parameter 'id' is set
356
+ if @api_client.config.client_side_validation && id.nil?
357
+ fail ArgumentError, "Missing the required parameter 'id' when calling DomainsApi.verify_domain"
358
+ end
359
+ # resource path
360
+ local_var_path = '/domains/{id}/verify'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
361
+
362
+ # query parameters
363
+ query_params = opts[:query_params] || {}
364
+
365
+ # header parameters
366
+ header_params = opts[:header_params] || {}
367
+ # HTTP header 'Accept' (if needed)
368
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
369
+
370
+ # form parameters
371
+ form_params = opts[:form_params] || {}
372
+
373
+ # http body (model)
374
+ post_body = opts[:debug_body]
375
+
376
+ # return_type
377
+ return_type = opts[:debug_return_type] || 'VerifyDomainResponse'
378
+
379
+ # auth_names
380
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
381
+
382
+ new_options = opts.merge(
383
+ :operation => :"DomainsApi.verify_domain",
384
+ :header_params => header_params,
385
+ :query_params => query_params,
386
+ :form_params => form_params,
387
+ :body => post_body,
388
+ :auth_names => auth_names,
389
+ :return_type => return_type
390
+ )
391
+
392
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
393
+ if @api_client.config.debugging
394
+ @api_client.config.logger.debug "API called: DomainsApi#verify_domain\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
395
+ end
396
+ return data, status_code, headers
397
+ end
146
398
  end
147
399
  end
@@ -0,0 +1,263 @@
1
+ =begin
2
+ #Zyphr API
3
+
4
+ #Zyphr is a multi-channel notification platform that enables developers to send emails, push notifications, SMS, and in-app messages through a unified API. ## Authentication All API requests require authentication using an API key. Include your API key in the `X-API-Key` header: ``` X-API-Key: zy_live_xxxxxxxxxxxx ``` API keys can be created in the Zyphr Dashboard. Use `zy_test_*` keys for testing and `zy_live_*` keys for production. ## Rate Limiting The API implements rate limiting to ensure fair usage. Rate limit information is included in response headers: - `X-RateLimit-Limit`: Maximum requests per window - `X-RateLimit-Remaining`: Remaining requests in current window - `X-RateLimit-Reset`: Unix timestamp when the window resets ## Errors All errors follow a consistent format: ```json { \"error\": { \"code\": \"error_code\", \"message\": \"Human readable message\", \"details\": {} }, \"meta\": { \"request_id\": \"req_xxxx\" } } ```
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: support@zyphr.dev
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.12.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Zyphr
17
+ class DeleteDomainResponse
18
+ attr_accessor :data
19
+
20
+ attr_accessor :meta
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'data' => :'data',
26
+ :'meta' => :'meta'
27
+ }
28
+ end
29
+
30
+ # Returns attribute mapping this model knows about
31
+ def self.acceptable_attribute_map
32
+ attribute_map
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ acceptable_attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'data' => :'DeleteDomainResponseData',
44
+ :'meta' => :'GetDomain200ResponseMeta'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ ])
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zyphr::DeleteDomainResponse` initialize method"
59
+ end
60
+
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ acceptable_attribute_map = self.class.acceptable_attribute_map
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!acceptable_attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zyphr::DeleteDomainResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'data')
71
+ self.data = attributes[:'data']
72
+ else
73
+ self.data = nil
74
+ end
75
+
76
+ if attributes.key?(:'meta')
77
+ self.meta = attributes[:'meta']
78
+ else
79
+ self.meta = nil
80
+ end
81
+ end
82
+
83
+ # Show invalid properties with the reasons. Usually used together with valid?
84
+ # @return Array for valid properties with the reasons
85
+ def list_invalid_properties
86
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
87
+ invalid_properties = Array.new
88
+ if @data.nil?
89
+ invalid_properties.push('invalid value for "data", data cannot be nil.')
90
+ end
91
+
92
+ if @meta.nil?
93
+ invalid_properties.push('invalid value for "meta", meta cannot be nil.')
94
+ end
95
+
96
+ invalid_properties
97
+ end
98
+
99
+ # Check to see if the all the properties in the model are valid
100
+ # @return true if the model is valid
101
+ def valid?
102
+ warn '[DEPRECATED] the `valid?` method is obsolete'
103
+ return false if @data.nil?
104
+ return false if @meta.nil?
105
+ true
106
+ end
107
+
108
+ # Custom attribute writer method with validation
109
+ # @param [Object] data Value to be assigned
110
+ def data=(data)
111
+ if data.nil?
112
+ fail ArgumentError, 'data cannot be nil'
113
+ end
114
+
115
+ @data = data
116
+ end
117
+
118
+ # Custom attribute writer method with validation
119
+ # @param [Object] meta Value to be assigned
120
+ def meta=(meta)
121
+ if meta.nil?
122
+ fail ArgumentError, 'meta cannot be nil'
123
+ end
124
+
125
+ @meta = meta
126
+ end
127
+
128
+ # Checks equality by comparing each attribute.
129
+ # @param [Object] Object to be compared
130
+ def ==(o)
131
+ return true if self.equal?(o)
132
+ self.class == o.class &&
133
+ data == o.data &&
134
+ meta == o.meta
135
+ end
136
+
137
+ # @see the `==` method
138
+ # @param [Object] Object to be compared
139
+ def eql?(o)
140
+ self == o
141
+ end
142
+
143
+ # Calculates hash code according to all attributes.
144
+ # @return [Integer] Hash code
145
+ def hash
146
+ [data, meta].hash
147
+ end
148
+
149
+ # Builds the object from hash
150
+ # @param [Hash] attributes Model attributes in the form of hash
151
+ # @return [Object] Returns the model itself
152
+ def self.build_from_hash(attributes)
153
+ return nil unless attributes.is_a?(Hash)
154
+ attributes = attributes.transform_keys(&:to_sym)
155
+ transformed_hash = {}
156
+ openapi_types.each_pair do |key, type|
157
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
158
+ transformed_hash["#{key}"] = nil
159
+ elsif type =~ /\AArray<(.*)>/i
160
+ # check to ensure the input is an array given that the attribute
161
+ # is documented as an array but the input is not
162
+ if attributes[attribute_map[key]].is_a?(Array)
163
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
164
+ end
165
+ elsif !attributes[attribute_map[key]].nil?
166
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
167
+ end
168
+ end
169
+ new(transformed_hash)
170
+ end
171
+
172
+ # Deserializes the data based on type
173
+ # @param string type Data type
174
+ # @param string value Value to be deserialized
175
+ # @return [Object] Deserialized data
176
+ def self._deserialize(type, value)
177
+ case type.to_sym
178
+ when :Time
179
+ Time.parse(value)
180
+ when :Date
181
+ Date.parse(value)
182
+ when :String
183
+ value.to_s
184
+ when :Integer
185
+ value.to_i
186
+ when :Float
187
+ value.to_f
188
+ when :Boolean
189
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
190
+ true
191
+ else
192
+ false
193
+ end
194
+ when :Object
195
+ # generic object (usually a Hash), return directly
196
+ value
197
+ when /\AArray<(?<inner_type>.+)>\z/
198
+ inner_type = Regexp.last_match[:inner_type]
199
+ value.map { |v| _deserialize(inner_type, v) }
200
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
201
+ k_type = Regexp.last_match[:k_type]
202
+ v_type = Regexp.last_match[:v_type]
203
+ {}.tap do |hash|
204
+ value.each do |k, v|
205
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
206
+ end
207
+ end
208
+ else # model
209
+ # models (e.g. Pet) or oneOf
210
+ klass = Zyphr.const_get(type)
211
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
212
+ end
213
+ end
214
+
215
+ # Returns the string representation of the object
216
+ # @return [String] String presentation of the object
217
+ def to_s
218
+ to_hash.to_s
219
+ end
220
+
221
+ # to_body is an alias to to_hash (backward compatibility)
222
+ # @return [Hash] Returns the object in the form of hash
223
+ def to_body
224
+ to_hash
225
+ end
226
+
227
+ # Returns the object in the form of hash
228
+ # @return [Hash] Returns the object in the form of hash
229
+ def to_hash
230
+ hash = {}
231
+ self.class.attribute_map.each_pair do |attr, param|
232
+ value = self.send(attr)
233
+ if value.nil?
234
+ is_nullable = self.class.openapi_nullable.include?(attr)
235
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
236
+ end
237
+
238
+ hash[param] = _to_hash(value)
239
+ end
240
+ hash
241
+ end
242
+
243
+ # Outputs non-array value in the form of hash
244
+ # For object, use to_hash. Otherwise, just return the value
245
+ # @param [Object] value Any valid value
246
+ # @return [Hash] Returns the value in the form of hash
247
+ def _to_hash(value)
248
+ if value.is_a?(Array)
249
+ value.compact.map { |v| _to_hash(v) }
250
+ elsif value.is_a?(Hash)
251
+ {}.tap do |hash|
252
+ value.each { |k, v| hash[k] = _to_hash(v) }
253
+ end
254
+ elsif value.respond_to? :to_hash
255
+ value.to_hash
256
+ else
257
+ value
258
+ end
259
+ end
260
+
261
+ end
262
+
263
+ end