vgs_api_client 0.0.1.alpha202205210037 → 0.0.1.alpha202205210249

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,306 +0,0 @@
1
- =begin
2
- #Vault HTTP API
3
-
4
- #The VGS Vault HTTP API is used for storing, retrieving, and managing sensitive data (aka Tokenization) within a VGS Vault. The VGS API is organized around REST. Our API is built with a predictable resource-oriented structure, uses JSON-encoded requests and responses, follows standard HTTP verbs/responses, and uses industry standard authentication. ## What is VGS Storing sensitive data on your company’s infrastructure often comes with a heavy compliance burden. For instance, storing payments data yourself greatly increases the amount of work needed to become PCI compliant. It also increases your security risk in general. To combat this, companies will minimize the amount of sensitive information they have to handle or store. VGS provides multiple methods for minimizing the sensitive information that needs to be stored which allows customers to secure any type of data for any use-case. **Tokenization** is a method that focuses on securing the storage of data. This is the quickest way to get started and is free. [Get started with Tokenization](https://www.verygoodsecurity.com/docs/tokenization/getting-started). **Zero Data** is a unique method invented by VGS in 2016 that securely stores data like Tokenization, however it also removes the customer’s environment from PCI scope completely providing maximum security, and minimum compliance scope. [Get started with Zero Data](https://www.verygoodsecurity.com/docs/getting-started/before-you-start). Additionally, for scenarios where neither technology is a complete solution, for instance with legacy systems, VGS provides a compliance product which guarantees customers are able to meet their compliance needs no matter what may happen. [Get started with Control](https://www.verygoodsecurity.com/docs/control). ## Learn about Tokenization - [Create an Account for Free Tokenization](https://dashboard.verygoodsecurity.com/tokenization) - [Try a Tokenization Demo](https://www.verygoodsecurity.com/docs/tokenization/getting-started) - [Install a Tokenization SDK](https://www.verygoodsecurity.com/docs/tokenization/client-libraries) ### Authentication This API uses `Basic` authentication. Credentials to access the API can be generated on the [dashboard](https://dashboard.verygoodsecurity.com) by going to the Settings section of the vault of your choosing. [Docs » Guides » Access credentials](https://www.verygoodsecurity.com/docs/settings/access-credentials) ## Resource Limits ### Data Limits This API allows storing data up to 32MB in size. ### Rate Limiting The API allows up to 3,000 requests per minute. Requests are associated with the vault, regardless of the access credentials used to authenticate the request. Your current rate limit is included as HTTP headers in every API response: | Header Name | Description | |-------------------------|----------------------------------------------------------| | `x-ratelimit-remaining` | The number of requests remaining in the 1-minute window. | If you exceed the rate limit, the API will reject the request with HTTP [429 Too Many Requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429). ### Errors The API uses standard HTTP status codes to indicate whether the request succeeded or not. In case of failure, the response body will be JSON in a predefined format. For example, trying to create too many aliases at once results in the following response: ```json { \"errors\": [ { \"status\": 400, \"title\": \"Bad request\", \"detail\": \"Too many values (limit: 20)\", \"href\": \"https://api.sandbox.verygoodvault.com/aliases\" } ] } ```
5
-
6
- The version of the OpenAPI document: 1.0.0
7
- Contact: support@verygoodsecurity.com
8
- Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.4.0
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'time'
15
-
16
- module VgsApiClient
17
- class CreateFunctionRequestPayload
18
- # Language to write your function in.
19
- attr_accessor :lang
20
-
21
- # Prefix to name your function
22
- attr_accessor :name
23
-
24
- # Definition of function body
25
- attr_accessor :src
26
-
27
- class EnumAttributeValidator
28
- attr_reader :datatype
29
- attr_reader :allowable_values
30
-
31
- def initialize(datatype, allowable_values)
32
- @allowable_values = allowable_values.map do |value|
33
- case datatype.to_s
34
- when /Integer/i
35
- value.to_i
36
- when /Float/i
37
- value.to_f
38
- else
39
- value
40
- end
41
- end
42
- end
43
-
44
- def valid?(value)
45
- !value || allowable_values.include?(value)
46
- end
47
- end
48
-
49
- # Attribute mapping from ruby-style variable name to JSON key.
50
- def self.attribute_map
51
- {
52
- :'lang' => :'lang',
53
- :'name' => :'name',
54
- :'src' => :'src'
55
- }
56
- end
57
-
58
- # Returns all the JSON keys this model knows about
59
- def self.acceptable_attributes
60
- attribute_map.values
61
- end
62
-
63
- # Attribute type mapping.
64
- def self.openapi_types
65
- {
66
- :'lang' => :'String',
67
- :'name' => :'String',
68
- :'src' => :'String'
69
- }
70
- end
71
-
72
- # List of attributes with nullable: true
73
- def self.openapi_nullable
74
- Set.new([
75
- ])
76
- end
77
-
78
- # Initializes the object
79
- # @param [Hash] attributes Model attributes in the form of hash
80
- def initialize(attributes = {})
81
- if (!attributes.is_a?(Hash))
82
- fail ArgumentError, "The input argument (attributes) must be a hash in `VgsApiClient::CreateFunctionRequestPayload` initialize method"
83
- end
84
-
85
- # check to see if the attribute exists and convert string to symbol for hash key
86
- attributes = attributes.each_with_object({}) { |(k, v), h|
87
- if (!self.class.attribute_map.key?(k.to_sym))
88
- fail ArgumentError, "`#{k}` is not a valid attribute in `VgsApiClient::CreateFunctionRequestPayload`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
89
- end
90
- h[k.to_sym] = v
91
- }
92
-
93
- if attributes.key?(:'lang')
94
- self.lang = attributes[:'lang']
95
- else
96
- self.lang = 'larky'
97
- end
98
-
99
- if attributes.key?(:'name')
100
- self.name = attributes[:'name']
101
- end
102
-
103
- if attributes.key?(:'src')
104
- self.src = attributes[:'src']
105
- end
106
- end
107
-
108
- # Show invalid properties with the reasons. Usually used together with valid?
109
- # @return Array for valid properties with the reasons
110
- def list_invalid_properties
111
- invalid_properties = Array.new
112
- if @name.nil?
113
- invalid_properties.push('invalid value for "name", name cannot be nil.')
114
- end
115
-
116
- pattern = Regexp.new(/[a-zA-Z]+([A-Za-z0-9\-_]){5,28}[a-zA-Z0-9]/)
117
- if @name !~ pattern
118
- invalid_properties.push("invalid value for \"name\", must conform to the pattern #{pattern}.")
119
- end
120
-
121
- if @src.nil?
122
- invalid_properties.push('invalid value for "src", src cannot be nil.')
123
- end
124
-
125
- invalid_properties
126
- end
127
-
128
- # Check to see if the all the properties in the model are valid
129
- # @return true if the model is valid
130
- def valid?
131
- lang_validator = EnumAttributeValidator.new('String', ["larky"])
132
- return false unless lang_validator.valid?(@lang)
133
- return false if @name.nil?
134
- return false if @name !~ Regexp.new(/[a-zA-Z]+([A-Za-z0-9\-_]){5,28}[a-zA-Z0-9]/)
135
- return false if @src.nil?
136
- true
137
- end
138
-
139
- # Custom attribute writer method checking allowed values (enum).
140
- # @param [Object] lang Object to be assigned
141
- def lang=(lang)
142
- validator = EnumAttributeValidator.new('String', ["larky"])
143
- unless validator.valid?(lang)
144
- fail ArgumentError, "invalid value for \"lang\", must be one of #{validator.allowable_values}."
145
- end
146
- @lang = lang
147
- end
148
-
149
- # Custom attribute writer method with validation
150
- # @param [Object] name Value to be assigned
151
- def name=(name)
152
- if name.nil?
153
- fail ArgumentError, 'name cannot be nil'
154
- end
155
-
156
- pattern = Regexp.new(/[a-zA-Z]+([A-Za-z0-9\-_]){5,28}[a-zA-Z0-9]/)
157
- if name !~ pattern
158
- fail ArgumentError, "invalid value for \"name\", must conform to the pattern #{pattern}."
159
- end
160
-
161
- @name = name
162
- end
163
-
164
- # Checks equality by comparing each attribute.
165
- # @param [Object] Object to be compared
166
- def ==(o)
167
- return true if self.equal?(o)
168
- self.class == o.class &&
169
- lang == o.lang &&
170
- name == o.name &&
171
- src == o.src
172
- end
173
-
174
- # @see the `==` method
175
- # @param [Object] Object to be compared
176
- def eql?(o)
177
- self == o
178
- end
179
-
180
- # Calculates hash code according to all attributes.
181
- # @return [Integer] Hash code
182
- def hash
183
- [lang, name, src].hash
184
- end
185
-
186
- # Builds the object from hash
187
- # @param [Hash] attributes Model attributes in the form of hash
188
- # @return [Object] Returns the model itself
189
- def self.build_from_hash(attributes)
190
- new.build_from_hash(attributes)
191
- end
192
-
193
- # Builds the object from hash
194
- # @param [Hash] attributes Model attributes in the form of hash
195
- # @return [Object] Returns the model itself
196
- def build_from_hash(attributes)
197
- return nil unless attributes.is_a?(Hash)
198
- self.class.openapi_types.each_pair do |key, type|
199
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
200
- self.send("#{key}=", nil)
201
- elsif type =~ /\AArray<(.*)>/i
202
- # check to ensure the input is an array given that the attribute
203
- # is documented as an array but the input is not
204
- if attributes[self.class.attribute_map[key]].is_a?(Array)
205
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
206
- end
207
- elsif !attributes[self.class.attribute_map[key]].nil?
208
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
209
- end
210
- end
211
-
212
- self
213
- end
214
-
215
- # Deserializes the data based on type
216
- # @param string type Data type
217
- # @param string value Value to be deserialized
218
- # @return [Object] Deserialized data
219
- def _deserialize(type, value)
220
- case type.to_sym
221
- when :Time
222
- Time.parse(value)
223
- when :Date
224
- Date.parse(value)
225
- when :String
226
- value.to_s
227
- when :Integer
228
- value.to_i
229
- when :Float
230
- value.to_f
231
- when :Boolean
232
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
233
- true
234
- else
235
- false
236
- end
237
- when :Object
238
- # generic object (usually a Hash), return directly
239
- value
240
- when /\AArray<(?<inner_type>.+)>\z/
241
- inner_type = Regexp.last_match[:inner_type]
242
- value.map { |v| _deserialize(inner_type, v) }
243
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
244
- k_type = Regexp.last_match[:k_type]
245
- v_type = Regexp.last_match[:v_type]
246
- {}.tap do |hash|
247
- value.each do |k, v|
248
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
249
- end
250
- end
251
- else # model
252
- # models (e.g. Pet) or oneOf
253
- klass = VgsApiClient.const_get(type)
254
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
255
- end
256
- end
257
-
258
- # Returns the string representation of the object
259
- # @return [String] String presentation of the object
260
- def to_s
261
- to_hash.to_s
262
- end
263
-
264
- # to_body is an alias to to_hash (backward compatibility)
265
- # @return [Hash] Returns the object in the form of hash
266
- def to_body
267
- to_hash
268
- end
269
-
270
- # Returns the object in the form of hash
271
- # @return [Hash] Returns the object in the form of hash
272
- def to_hash
273
- hash = {}
274
- self.class.attribute_map.each_pair do |attr, param|
275
- value = self.send(attr)
276
- if value.nil?
277
- is_nullable = self.class.openapi_nullable.include?(attr)
278
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
279
- end
280
-
281
- hash[param] = _to_hash(value)
282
- end
283
- hash
284
- end
285
-
286
- # Outputs non-array value in the form of hash
287
- # For object, use to_hash. Otherwise, just return the value
288
- # @param [Object] value Any valid value
289
- # @return [Hash] Returns the value in the form of hash
290
- def _to_hash(value)
291
- if value.is_a?(Array)
292
- value.compact.map { |v| _to_hash(v) }
293
- elsif value.is_a?(Hash)
294
- {}.tap do |hash|
295
- value.each { |k, v| hash[k] = _to_hash(v) }
296
- end
297
- elsif value.respond_to? :to_hash
298
- value.to_hash
299
- else
300
- value
301
- end
302
- end
303
-
304
- end
305
-
306
- end
@@ -1,284 +0,0 @@
1
- =begin
2
- #Vault HTTP API
3
-
4
- #The VGS Vault HTTP API is used for storing, retrieving, and managing sensitive data (aka Tokenization) within a VGS Vault. The VGS API is organized around REST. Our API is built with a predictable resource-oriented structure, uses JSON-encoded requests and responses, follows standard HTTP verbs/responses, and uses industry standard authentication. ## What is VGS Storing sensitive data on your company’s infrastructure often comes with a heavy compliance burden. For instance, storing payments data yourself greatly increases the amount of work needed to become PCI compliant. It also increases your security risk in general. To combat this, companies will minimize the amount of sensitive information they have to handle or store. VGS provides multiple methods for minimizing the sensitive information that needs to be stored which allows customers to secure any type of data for any use-case. **Tokenization** is a method that focuses on securing the storage of data. This is the quickest way to get started and is free. [Get started with Tokenization](https://www.verygoodsecurity.com/docs/tokenization/getting-started). **Zero Data** is a unique method invented by VGS in 2016 that securely stores data like Tokenization, however it also removes the customer’s environment from PCI scope completely providing maximum security, and minimum compliance scope. [Get started with Zero Data](https://www.verygoodsecurity.com/docs/getting-started/before-you-start). Additionally, for scenarios where neither technology is a complete solution, for instance with legacy systems, VGS provides a compliance product which guarantees customers are able to meet their compliance needs no matter what may happen. [Get started with Control](https://www.verygoodsecurity.com/docs/control). ## Learn about Tokenization - [Create an Account for Free Tokenization](https://dashboard.verygoodsecurity.com/tokenization) - [Try a Tokenization Demo](https://www.verygoodsecurity.com/docs/tokenization/getting-started) - [Install a Tokenization SDK](https://www.verygoodsecurity.com/docs/tokenization/client-libraries) ### Authentication This API uses `Basic` authentication. Credentials to access the API can be generated on the [dashboard](https://dashboard.verygoodsecurity.com) by going to the Settings section of the vault of your choosing. [Docs » Guides » Access credentials](https://www.verygoodsecurity.com/docs/settings/access-credentials) ## Resource Limits ### Data Limits This API allows storing data up to 32MB in size. ### Rate Limiting The API allows up to 3,000 requests per minute. Requests are associated with the vault, regardless of the access credentials used to authenticate the request. Your current rate limit is included as HTTP headers in every API response: | Header Name | Description | |-------------------------|----------------------------------------------------------| | `x-ratelimit-remaining` | The number of requests remaining in the 1-minute window. | If you exceed the rate limit, the API will reject the request with HTTP [429 Too Many Requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429). ### Errors The API uses standard HTTP status codes to indicate whether the request succeeded or not. In case of failure, the response body will be JSON in a predefined format. For example, trying to create too many aliases at once results in the following response: ```json { \"errors\": [ { \"status\": 400, \"title\": \"Bad request\", \"detail\": \"Too many values (limit: 20)\", \"href\": \"https://api.sandbox.verygoodvault.com/aliases\" } ] } ```
5
-
6
- The version of the OpenAPI document: 1.0.0
7
- Contact: support@verygoodsecurity.com
8
- Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.4.0
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'time'
15
-
16
- module VgsApiClient
17
- class Function
18
- # SHA256 representation of the function definition
19
- attr_accessor :hash
20
-
21
- # Language to write your function in.
22
- attr_accessor :lang
23
-
24
- attr_accessor :name
25
-
26
- # Definition of function body
27
- attr_accessor :src
28
-
29
- class EnumAttributeValidator
30
- attr_reader :datatype
31
- attr_reader :allowable_values
32
-
33
- def initialize(datatype, allowable_values)
34
- @allowable_values = allowable_values.map do |value|
35
- case datatype.to_s
36
- when /Integer/i
37
- value.to_i
38
- when /Float/i
39
- value.to_f
40
- else
41
- value
42
- end
43
- end
44
- end
45
-
46
- def valid?(value)
47
- !value || allowable_values.include?(value)
48
- end
49
- end
50
-
51
- # Attribute mapping from ruby-style variable name to JSON key.
52
- def self.attribute_map
53
- {
54
- :'hash' => :'hash',
55
- :'lang' => :'lang',
56
- :'name' => :'name',
57
- :'src' => :'src'
58
- }
59
- end
60
-
61
- # Returns all the JSON keys this model knows about
62
- def self.acceptable_attributes
63
- attribute_map.values
64
- end
65
-
66
- # Attribute type mapping.
67
- def self.openapi_types
68
- {
69
- :'hash' => :'String',
70
- :'lang' => :'String',
71
- :'name' => :'String',
72
- :'src' => :'String'
73
- }
74
- end
75
-
76
- # List of attributes with nullable: true
77
- def self.openapi_nullable
78
- Set.new([
79
- ])
80
- end
81
-
82
- # Initializes the object
83
- # @param [Hash] attributes Model attributes in the form of hash
84
- def initialize(attributes = {})
85
- if (!attributes.is_a?(Hash))
86
- fail ArgumentError, "The input argument (attributes) must be a hash in `VgsApiClient::Function` initialize method"
87
- end
88
-
89
- # check to see if the attribute exists and convert string to symbol for hash key
90
- attributes = attributes.each_with_object({}) { |(k, v), h|
91
- if (!self.class.attribute_map.key?(k.to_sym))
92
- fail ArgumentError, "`#{k}` is not a valid attribute in `VgsApiClient::Function`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
93
- end
94
- h[k.to_sym] = v
95
- }
96
-
97
- if attributes.key?(:'hash')
98
- self.hash = attributes[:'hash']
99
- end
100
-
101
- if attributes.key?(:'lang')
102
- self.lang = attributes[:'lang']
103
- else
104
- self.lang = 'larky'
105
- end
106
-
107
- if attributes.key?(:'name')
108
- self.name = attributes[:'name']
109
- end
110
-
111
- if attributes.key?(:'src')
112
- self.src = attributes[:'src']
113
- end
114
- end
115
-
116
- # Show invalid properties with the reasons. Usually used together with valid?
117
- # @return Array for valid properties with the reasons
118
- def list_invalid_properties
119
- invalid_properties = Array.new
120
- invalid_properties
121
- end
122
-
123
- # Check to see if the all the properties in the model are valid
124
- # @return true if the model is valid
125
- def valid?
126
- lang_validator = EnumAttributeValidator.new('String', ["larky"])
127
- return false unless lang_validator.valid?(@lang)
128
- true
129
- end
130
-
131
- # Custom attribute writer method checking allowed values (enum).
132
- # @param [Object] lang Object to be assigned
133
- def lang=(lang)
134
- validator = EnumAttributeValidator.new('String', ["larky"])
135
- unless validator.valid?(lang)
136
- fail ArgumentError, "invalid value for \"lang\", must be one of #{validator.allowable_values}."
137
- end
138
- @lang = lang
139
- end
140
-
141
- # Checks equality by comparing each attribute.
142
- # @param [Object] Object to be compared
143
- def ==(o)
144
- return true if self.equal?(o)
145
- self.class == o.class &&
146
- hash == o.hash &&
147
- lang == o.lang &&
148
- name == o.name &&
149
- src == o.src
150
- end
151
-
152
- # @see the `==` method
153
- # @param [Object] Object to be compared
154
- def eql?(o)
155
- self == o
156
- end
157
-
158
- # Calculates hash code according to all attributes.
159
- # @return [Integer] Hash code
160
- def hash
161
- [hash, lang, name, src].hash
162
- end
163
-
164
- # Builds the object from hash
165
- # @param [Hash] attributes Model attributes in the form of hash
166
- # @return [Object] Returns the model itself
167
- def self.build_from_hash(attributes)
168
- new.build_from_hash(attributes)
169
- end
170
-
171
- # Builds the object from hash
172
- # @param [Hash] attributes Model attributes in the form of hash
173
- # @return [Object] Returns the model itself
174
- def build_from_hash(attributes)
175
- return nil unless attributes.is_a?(Hash)
176
- self.class.openapi_types.each_pair do |key, type|
177
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
178
- self.send("#{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[self.class.attribute_map[key]].is_a?(Array)
183
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
184
- end
185
- elsif !attributes[self.class.attribute_map[key]].nil?
186
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
187
- end
188
- end
189
-
190
- self
191
- end
192
-
193
- # Deserializes the data based on type
194
- # @param string type Data type
195
- # @param string value Value to be deserialized
196
- # @return [Object] Deserialized data
197
- def _deserialize(type, value)
198
- case type.to_sym
199
- when :Time
200
- Time.parse(value)
201
- when :Date
202
- Date.parse(value)
203
- when :String
204
- value.to_s
205
- when :Integer
206
- value.to_i
207
- when :Float
208
- value.to_f
209
- when :Boolean
210
- if value.to_s =~ /\A(true|t|yes|y|1)\z/i
211
- true
212
- else
213
- false
214
- end
215
- when :Object
216
- # generic object (usually a Hash), return directly
217
- value
218
- when /\AArray<(?<inner_type>.+)>\z/
219
- inner_type = Regexp.last_match[:inner_type]
220
- value.map { |v| _deserialize(inner_type, v) }
221
- when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
222
- k_type = Regexp.last_match[:k_type]
223
- v_type = Regexp.last_match[:v_type]
224
- {}.tap do |hash|
225
- value.each do |k, v|
226
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
227
- end
228
- end
229
- else # model
230
- # models (e.g. Pet) or oneOf
231
- klass = VgsApiClient.const_get(type)
232
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
233
- end
234
- end
235
-
236
- # Returns the string representation of the object
237
- # @return [String] String presentation of the object
238
- def to_s
239
- to_hash.to_s
240
- end
241
-
242
- # to_body is an alias to to_hash (backward compatibility)
243
- # @return [Hash] Returns the object in the form of hash
244
- def to_body
245
- to_hash
246
- end
247
-
248
- # Returns the object in the form of hash
249
- # @return [Hash] Returns the object in the form of hash
250
- def to_hash
251
- hash = {}
252
- self.class.attribute_map.each_pair do |attr, param|
253
- value = self.send(attr)
254
- if value.nil?
255
- is_nullable = self.class.openapi_nullable.include?(attr)
256
- next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
257
- end
258
-
259
- hash[param] = _to_hash(value)
260
- end
261
- hash
262
- end
263
-
264
- # Outputs non-array value in the form of hash
265
- # For object, use to_hash. Otherwise, just return the value
266
- # @param [Object] value Any valid value
267
- # @return [Hash] Returns the value in the form of hash
268
- def _to_hash(value)
269
- if value.is_a?(Array)
270
- value.compact.map { |v| _to_hash(v) }
271
- elsif value.is_a?(Hash)
272
- {}.tap do |hash|
273
- value.each { |k, v| hash[k] = _to_hash(v) }
274
- end
275
- elsif value.respond_to? :to_hash
276
- value.to_hash
277
- else
278
- value
279
- end
280
- end
281
-
282
- end
283
-
284
- end