cybrid_api_bank_ruby 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/README.md +13 -5
  4. data/cybrid_api_bank_ruby.gemspec +1 -1
  5. data/docs/FeeBankModel.md +22 -0
  6. data/docs/PostFeeBankModel.md +22 -0
  7. data/docs/PostTradingConfigurationBankModel.md +20 -0
  8. data/docs/TradingConfigurationBankModel.md +26 -0
  9. data/docs/TradingConfigurationListBankModel.md +24 -0
  10. data/docs/TradingConfigurationsBankApi.md +230 -0
  11. data/lib/cybrid_api_bank_ruby/api/accounts_bank_api.rb +1 -1
  12. data/lib/cybrid_api_bank_ruby/api/assets_bank_api.rb +1 -1
  13. data/lib/cybrid_api_bank_ruby/api/banks_bank_api.rb +1 -1
  14. data/lib/cybrid_api_bank_ruby/api/customers_bank_api.rb +1 -1
  15. data/lib/cybrid_api_bank_ruby/api/identity_records_bank_api.rb +1 -1
  16. data/lib/cybrid_api_bank_ruby/api/prices_bank_api.rb +1 -1
  17. data/lib/cybrid_api_bank_ruby/api/quotes_bank_api.rb +1 -1
  18. data/lib/cybrid_api_bank_ruby/api/symbols_bank_api.rb +1 -1
  19. data/lib/cybrid_api_bank_ruby/api/trades_bank_api.rb +1 -1
  20. data/lib/cybrid_api_bank_ruby/api/trading_configurations_bank_api.rb +228 -0
  21. data/lib/cybrid_api_bank_ruby/api/verification_keys_bank_api.rb +1 -1
  22. data/lib/cybrid_api_bank_ruby/api_client.rb +1 -1
  23. data/lib/cybrid_api_bank_ruby/api_error.rb +1 -1
  24. data/lib/cybrid_api_bank_ruby/configuration.rb +1 -1
  25. data/lib/cybrid_api_bank_ruby/models/account_bank_model.rb +1 -1
  26. data/lib/cybrid_api_bank_ruby/models/account_list_bank_model.rb +1 -1
  27. data/lib/cybrid_api_bank_ruby/models/asset_bank_model.rb +1 -1
  28. data/lib/cybrid_api_bank_ruby/models/asset_list_bank_model.rb +1 -1
  29. data/lib/cybrid_api_bank_ruby/models/attestation_details_bank_model.rb +1 -1
  30. data/lib/cybrid_api_bank_ruby/models/bank_bank_model.rb +1 -1
  31. data/lib/cybrid_api_bank_ruby/models/bank_list_bank_model.rb +1 -1
  32. data/lib/cybrid_api_bank_ruby/models/customer_bank_model.rb +1 -1
  33. data/lib/cybrid_api_bank_ruby/models/customer_list_bank_model.rb +1 -1
  34. data/lib/cybrid_api_bank_ruby/models/exchange_account_bank_model.rb +1 -1
  35. data/lib/cybrid_api_bank_ruby/models/exchange_bank_model.rb +1 -1
  36. data/lib/cybrid_api_bank_ruby/models/fee_bank_model.rb +273 -0
  37. data/lib/cybrid_api_bank_ruby/models/identity_record_bank_model.rb +1 -1
  38. data/lib/cybrid_api_bank_ruby/models/post_account_bank_model.rb +1 -1
  39. data/lib/cybrid_api_bank_ruby/models/post_bank_bank_model.rb +1 -1
  40. data/lib/cybrid_api_bank_ruby/models/post_customer_bank_model.rb +1 -1
  41. data/lib/cybrid_api_bank_ruby/models/post_fee_bank_model.rb +278 -0
  42. data/lib/cybrid_api_bank_ruby/models/post_identity_record_attestation_details_bank_model.rb +1 -1
  43. data/lib/cybrid_api_bank_ruby/models/post_identity_record_bank_model.rb +1 -1
  44. data/lib/cybrid_api_bank_ruby/models/post_quote_bank_model.rb +1 -1
  45. data/lib/cybrid_api_bank_ruby/models/post_trade_bank_model.rb +1 -1
  46. data/lib/cybrid_api_bank_ruby/models/post_trading_configuration_bank_model.rb +269 -0
  47. data/lib/cybrid_api_bank_ruby/models/post_verification_key_bank_model.rb +1 -1
  48. data/lib/cybrid_api_bank_ruby/models/quote_bank_model.rb +1 -1
  49. data/lib/cybrid_api_bank_ruby/models/quote_list_bank_model.rb +1 -1
  50. data/lib/cybrid_api_bank_ruby/models/symbol_price_bank_model.rb +1 -1
  51. data/lib/cybrid_api_bank_ruby/models/system_account_bank_model.rb +1 -1
  52. data/lib/cybrid_api_bank_ruby/models/trade_bank_model.rb +1 -1
  53. data/lib/cybrid_api_bank_ruby/models/trade_list_bank_model.rb +1 -1
  54. data/lib/cybrid_api_bank_ruby/models/trading_configuration_bank_model.rb +334 -0
  55. data/lib/cybrid_api_bank_ruby/models/trading_configuration_list_bank_model.rb +295 -0
  56. data/lib/cybrid_api_bank_ruby/models/verification_key_bank_model.rb +1 -1
  57. data/lib/cybrid_api_bank_ruby/models/verification_key_list_bank_model.rb +1 -1
  58. data/lib/cybrid_api_bank_ruby/version.rb +2 -2
  59. data/lib/cybrid_api_bank_ruby.rb +7 -1
  60. data/spec/api/accounts_bank_api_spec.rb +1 -1
  61. data/spec/api/assets_bank_api_spec.rb +1 -1
  62. data/spec/api/banks_bank_api_spec.rb +1 -1
  63. data/spec/api/customers_bank_api_spec.rb +1 -1
  64. data/spec/api/identity_records_bank_api_spec.rb +1 -1
  65. data/spec/api/prices_bank_api_spec.rb +1 -1
  66. data/spec/api/quotes_bank_api_spec.rb +1 -1
  67. data/spec/api/symbols_bank_api_spec.rb +1 -1
  68. data/spec/api/trades_bank_api_spec.rb +1 -1
  69. data/spec/api/trading_configurations_bank_api_spec.rb +72 -0
  70. data/spec/api/verification_keys_bank_api_spec.rb +1 -1
  71. data/spec/api_client_spec.rb +1 -1
  72. data/spec/configuration_spec.rb +1 -1
  73. data/spec/models/account_bank_model_spec.rb +1 -1
  74. data/spec/models/account_list_bank_model_spec.rb +1 -1
  75. data/spec/models/asset_bank_model_spec.rb +1 -1
  76. data/spec/models/asset_list_bank_model_spec.rb +1 -1
  77. data/spec/models/attestation_details_bank_model_spec.rb +1 -1
  78. data/spec/models/bank_bank_model_spec.rb +1 -1
  79. data/spec/models/bank_list_bank_model_spec.rb +1 -1
  80. data/spec/models/customer_bank_model_spec.rb +1 -1
  81. data/spec/models/customer_list_bank_model_spec.rb +1 -1
  82. data/spec/models/exchange_account_bank_model_spec.rb +1 -1
  83. data/spec/models/exchange_bank_model_spec.rb +1 -1
  84. data/spec/models/fee_bank_model_spec.rb +50 -0
  85. data/spec/models/identity_record_bank_model_spec.rb +1 -1
  86. data/spec/models/post_account_bank_model_spec.rb +1 -1
  87. data/spec/models/post_bank_bank_model_spec.rb +1 -1
  88. data/spec/models/post_customer_bank_model_spec.rb +1 -1
  89. data/spec/models/post_fee_bank_model_spec.rb +50 -0
  90. data/spec/models/post_identity_record_attestation_details_bank_model_spec.rb +1 -1
  91. data/spec/models/post_identity_record_bank_model_spec.rb +1 -1
  92. data/spec/models/post_quote_bank_model_spec.rb +1 -1
  93. data/spec/models/post_trade_bank_model_spec.rb +1 -1
  94. data/spec/models/post_trading_configuration_bank_model_spec.rb +40 -0
  95. data/spec/models/post_verification_key_bank_model_spec.rb +1 -1
  96. data/spec/models/quote_bank_model_spec.rb +1 -1
  97. data/spec/models/quote_list_bank_model_spec.rb +1 -1
  98. data/spec/models/symbol_price_bank_model_spec.rb +1 -1
  99. data/spec/models/system_account_bank_model_spec.rb +1 -1
  100. data/spec/models/trade_bank_model_spec.rb +1 -1
  101. data/spec/models/trade_list_bank_model_spec.rb +1 -1
  102. data/spec/models/trading_configuration_bank_model_spec.rb +58 -0
  103. data/spec/models/trading_configuration_list_bank_model_spec.rb +52 -0
  104. data/spec/models/verification_key_bank_model_spec.rb +1 -1
  105. data/spec/models/verification_key_list_bank_model_spec.rb +1 -1
  106. data/spec/spec_helper.rb +1 -1
  107. data/vendor/bundle/ruby/3.1.0/extensions/x86_64-linux/3.1.0-static/byebug-11.1.3/gem_make.out +2 -2
  108. data/vendor/bundle/ruby/3.1.0/extensions/x86_64-linux/3.1.0-static/ffi-1.15.5/gem_make.out +2 -2
  109. data/vendor/bundle/ruby/3.1.0/extensions/x86_64-linux/3.1.0-static/jaro_winkler-1.5.4/gem_make.out +2 -2
  110. data/vendor/bundle/ruby/3.1.0/gems/byebug-11.1.3/ext/byebug/Makefile +2 -2
  111. data/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/ext/ffi_c/Makefile +2 -2
  112. data/vendor/bundle/ruby/3.1.0/gems/jaro_winkler-1.5.4/ext/jaro_winkler/Makefile +2 -2
  113. metadata +26 -2
@@ -0,0 +1,334 @@
1
+ =begin
2
+ #Cybrid Bank API
3
+
4
+ ## Welcome Welcome to the Cybrid platform; enabling turnkey crypto banking services! In these documents, you will find information on the operations provided by our platform, as well as details on how our REST API operates more generally. Our complete set of APIs allows you to manage all your resources: your Organization, your banks and your identities. The complete set of APIs can be found on the following pages: | API | Description | |----------------------------------------------------------------|------------------------------| | [Organization API](https://organization.demo.cybrid.app/api/schema/swagger-ui) | APIs to manage organizations | | [Bank API](https://bank.demo.cybrid.app/api/schema/swagger-ui) | APIs to manage banks | | [Identities API](https://id.demo.cybrid.app/api/schema/swagger-ui) | APIs to manage identities | When you're ready, [request access](https://www.cybrid.xyz/access) to your Dashboard to view and administer your Organization. Once you've logged in, you can begin creating Banks, either for sandbox or production usage, and start enabling your customers to leverage DeFi and web3 with confidence. If you have any questions, please contact [Support](mailto:support@cybrid.app) at any time so that we can help. ## Authentication The Cybrid Platform uses OAuth 2.0 Bearer Tokens to authenticate requests to the platform. Credentials to create Organization and Bank tokens can be generated via your Dashboard ([request access](https://www.cybrid.xyz/access)). An Organization Token applies broadly to the whole Organization and all of its Banks, whereas, a Bank Token is specific to an individual Bank. Both Organization and Bank tokens can be created using the OAuth Client Credential Grant flow. Each Organization and Bank has its own unique Client ID and Secret that allows for machine-to-machine authentication. **Never share your Client ID or Secret publicly or in your source code repository** Your Client ID and Secret can be exchanged for a time-limited Bearer Token by interacting with the Cybrid Identity Provider or through interacting with the **Authorize** button in this document: ``` curl -X POST https://id.demo.cybrid.app/oauth/token -d '{ \"grant_type\": \"client_credentials\", \"client_id\": \"<Your Client ID>\", \"client_secret\": \"<Your Secret>\", \"scope\": \"<Your requested scopes -- space separated>\" }' -H \"Content-Type: application/json\" ``` ## Scopes The Cybrid platform supports the use of scopes to control the level of access a token is limited to. Scopes do not grant access to resources; instead, they provide limits, in support of the least privilege principal. The following scopes are available on the platform and can be requested when generating either an Organization or a Bank token. Generally speaking, the _Read_ scope is required to read and list resources, the _Write_ scope is required to update a resource and the _Execute_ scope is required to create a resource. | Resource | Read scope | Write scope | Execute scope | Token Type | |---------------|--------------------|----------------------|-------------------|--------------------| | Organizations | organizations:read | organizations:write | | Organization/ Bank | | Banks | banks:read | banks:write | banks:execute | Organization/ Bank | | Customers | customers:read | customers:write | customers:execute | Bank | | Assets | prices:read | | | Bank | | Accounts | accounts:read | | accounts:execute | Bank | | Prices | prices:read | | | Bank | | Symbols | prices:read | | | Bank | | Quotes | quotes:read | | quotes:execute | Bank | | Trades | trades:read | | trades:execute | Bank | ## Organizations An Organization is meant to model the organization partnering with Cybrid to use our platform. An Organization does not directly interact with customers. Instead, an Organization has one or more banks, which encompass the financial service offerings of the platform. ## Banks A Bank is owned by an Organization and can be thought of as an environment or container for Customers and product offerings. An example of a Bank would be your customer facing banking website, or an internal staging environment for testing and integration. An Organization can have multiple banks, in sandbox or production environments. A sandbox Bank will be backed by stubbed data and process flows. For instance, identity record and funding source processes will be simulated rather than performed. ## Customers Customers represent your banking users on the platform. At present, we offer support for Individuals as Customers. Customers must be verified in our system before they can play any part on the platform. See the Identity Records section for more details on how a customer can be verified. Customers must also have an account to be able to transact. See the Accounts APIs for more details on setting up accounts for the customer.
5
+
6
+ The version of the OpenAPI document: v0.6.0
7
+ Contact: support@cybrid.app
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 CybridApiBank
17
+ class TradingConfigurationBankModel
18
+ # Auto-generated unique identifier for the exchange.
19
+ attr_accessor :guid
20
+
21
+ # The bank identifier.
22
+ attr_accessor :bank_guid
23
+
24
+ # The asset code.
25
+ attr_accessor :asset
26
+
27
+ # ISO8601 datetime the bank was created at.
28
+ attr_accessor :created_at
29
+
30
+ # The fees associated with the configuration
31
+ attr_accessor :fees
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'guid' => :'guid',
37
+ :'bank_guid' => :'bank_guid',
38
+ :'asset' => :'asset',
39
+ :'created_at' => :'created_at',
40
+ :'fees' => :'fees'
41
+ }
42
+ end
43
+
44
+ # Returns all the JSON keys this model knows about
45
+ def self.acceptable_attributes
46
+ attribute_map.values
47
+ end
48
+
49
+ # Attribute type mapping.
50
+ def self.openapi_types
51
+ {
52
+ :'guid' => :'String',
53
+ :'bank_guid' => :'String',
54
+ :'asset' => :'String',
55
+ :'created_at' => :'Time',
56
+ :'fees' => :'Array<FeeBankModel>'
57
+ }
58
+ end
59
+
60
+ # List of attributes with nullable: true
61
+ def self.openapi_nullable
62
+ Set.new([
63
+ :'bank_guid',
64
+ ])
65
+ end
66
+
67
+ # Initializes the object
68
+ # @param [Hash] attributes Model attributes in the form of hash
69
+ def initialize(attributes = {})
70
+ if (!attributes.is_a?(Hash))
71
+ fail ArgumentError, "The input argument (attributes) must be a hash in `CybridApiBank::TradingConfigurationBankModel` initialize method"
72
+ end
73
+
74
+ # check to see if the attribute exists and convert string to symbol for hash key
75
+ attributes = attributes.each_with_object({}) { |(k, v), h|
76
+ if (!self.class.attribute_map.key?(k.to_sym))
77
+ fail ArgumentError, "`#{k}` is not a valid attribute in `CybridApiBank::TradingConfigurationBankModel`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
78
+ end
79
+ h[k.to_sym] = v
80
+ }
81
+
82
+ if attributes.key?(:'guid')
83
+ self.guid = attributes[:'guid']
84
+ end
85
+
86
+ if attributes.key?(:'bank_guid')
87
+ self.bank_guid = attributes[:'bank_guid']
88
+ end
89
+
90
+ if attributes.key?(:'asset')
91
+ self.asset = attributes[:'asset']
92
+ end
93
+
94
+ if attributes.key?(:'created_at')
95
+ self.created_at = attributes[:'created_at']
96
+ end
97
+
98
+ if attributes.key?(:'fees')
99
+ if (value = attributes[:'fees']).is_a?(Array)
100
+ self.fees = value
101
+ end
102
+ end
103
+ end
104
+
105
+ # Show invalid properties with the reasons. Usually used together with valid?
106
+ # @return Array for valid properties with the reasons
107
+ def list_invalid_properties
108
+ invalid_properties = Array.new
109
+ if !@guid.nil? && @guid.to_s.length > 32
110
+ invalid_properties.push('invalid value for "guid", the character length must be smaller than or equal to 32.')
111
+ end
112
+
113
+ if !@guid.nil? && @guid.to_s.length < 32
114
+ invalid_properties.push('invalid value for "guid", the character length must be great than or equal to 32.')
115
+ end
116
+
117
+ if !@bank_guid.nil? && @bank_guid.to_s.length > 32
118
+ invalid_properties.push('invalid value for "bank_guid", the character length must be smaller than or equal to 32.')
119
+ end
120
+
121
+ if !@bank_guid.nil? && @bank_guid.to_s.length < 32
122
+ invalid_properties.push('invalid value for "bank_guid", the character length must be great than or equal to 32.')
123
+ end
124
+
125
+ if !@asset.nil? && @asset.to_s.length > 8
126
+ invalid_properties.push('invalid value for "asset", the character length must be smaller than or equal to 8.')
127
+ end
128
+
129
+ if !@asset.nil? && @asset.to_s.length < 1
130
+ invalid_properties.push('invalid value for "asset", the character length must be great than or equal to 1.')
131
+ end
132
+
133
+ invalid_properties
134
+ end
135
+
136
+ # Check to see if the all the properties in the model are valid
137
+ # @return true if the model is valid
138
+ def valid?
139
+ return false if !@guid.nil? && @guid.to_s.length > 32
140
+ return false if !@guid.nil? && @guid.to_s.length < 32
141
+ return false if !@bank_guid.nil? && @bank_guid.to_s.length > 32
142
+ return false if !@bank_guid.nil? && @bank_guid.to_s.length < 32
143
+ return false if !@asset.nil? && @asset.to_s.length > 8
144
+ return false if !@asset.nil? && @asset.to_s.length < 1
145
+ true
146
+ end
147
+
148
+ # Custom attribute writer method with validation
149
+ # @param [Object] guid Value to be assigned
150
+ def guid=(guid)
151
+ if !guid.nil? && guid.to_s.length > 32
152
+ fail ArgumentError, 'invalid value for "guid", the character length must be smaller than or equal to 32.'
153
+ end
154
+
155
+ if !guid.nil? && guid.to_s.length < 32
156
+ fail ArgumentError, 'invalid value for "guid", the character length must be great than or equal to 32.'
157
+ end
158
+
159
+ @guid = guid
160
+ end
161
+
162
+ # Custom attribute writer method with validation
163
+ # @param [Object] bank_guid Value to be assigned
164
+ def bank_guid=(bank_guid)
165
+ if !bank_guid.nil? && bank_guid.to_s.length > 32
166
+ fail ArgumentError, 'invalid value for "bank_guid", the character length must be smaller than or equal to 32.'
167
+ end
168
+
169
+ if !bank_guid.nil? && bank_guid.to_s.length < 32
170
+ fail ArgumentError, 'invalid value for "bank_guid", the character length must be great than or equal to 32.'
171
+ end
172
+
173
+ @bank_guid = bank_guid
174
+ end
175
+
176
+ # Custom attribute writer method with validation
177
+ # @param [Object] asset Value to be assigned
178
+ def asset=(asset)
179
+ if !asset.nil? && asset.to_s.length > 8
180
+ fail ArgumentError, 'invalid value for "asset", the character length must be smaller than or equal to 8.'
181
+ end
182
+
183
+ if !asset.nil? && asset.to_s.length < 1
184
+ fail ArgumentError, 'invalid value for "asset", the character length must be great than or equal to 1.'
185
+ end
186
+
187
+ @asset = asset
188
+ end
189
+
190
+ # Checks equality by comparing each attribute.
191
+ # @param [Object] Object to be compared
192
+ def ==(o)
193
+ return true if self.equal?(o)
194
+ self.class == o.class &&
195
+ guid == o.guid &&
196
+ bank_guid == o.bank_guid &&
197
+ asset == o.asset &&
198
+ created_at == o.created_at &&
199
+ fees == o.fees
200
+ end
201
+
202
+ # @see the `==` method
203
+ # @param [Object] Object to be compared
204
+ def eql?(o)
205
+ self == o
206
+ end
207
+
208
+ # Calculates hash code according to all attributes.
209
+ # @return [Integer] Hash code
210
+ def hash
211
+ [guid, bank_guid, asset, created_at, fees].hash
212
+ end
213
+
214
+ # Builds the object from hash
215
+ # @param [Hash] attributes Model attributes in the form of hash
216
+ # @return [Object] Returns the model itself
217
+ def self.build_from_hash(attributes)
218
+ new.build_from_hash(attributes)
219
+ end
220
+
221
+ # Builds the object from hash
222
+ # @param [Hash] attributes Model attributes in the form of hash
223
+ # @return [Object] Returns the model itself
224
+ def build_from_hash(attributes)
225
+ return nil unless attributes.is_a?(Hash)
226
+ self.class.openapi_types.each_pair do |key, type|
227
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
228
+ self.send("#{key}=", nil)
229
+ elsif type =~ /\AArray<(.*)>/i
230
+ # check to ensure the input is an array given that the attribute
231
+ # is documented as an array but the input is not
232
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
233
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
234
+ end
235
+ elsif !attributes[self.class.attribute_map[key]].nil?
236
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
237
+ end
238
+ end
239
+
240
+ self
241
+ end
242
+
243
+ # Deserializes the data based on type
244
+ # @param string type Data type
245
+ # @param string value Value to be deserialized
246
+ # @return [Object] Deserialized data
247
+ def _deserialize(type, value)
248
+ case type.to_sym
249
+ when :Time
250
+ Time.parse(value)
251
+ when :Date
252
+ Date.parse(value)
253
+ when :String
254
+ value.to_s
255
+ when :Integer
256
+ value.to_i
257
+ when :Float
258
+ value.to_f
259
+ when :Boolean
260
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
261
+ true
262
+ else
263
+ false
264
+ end
265
+ when :Object
266
+ # generic object (usually a Hash), return directly
267
+ value
268
+ when /\AArray<(?<inner_type>.+)>\z/
269
+ inner_type = Regexp.last_match[:inner_type]
270
+ value.map { |v| _deserialize(inner_type, v) }
271
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
272
+ k_type = Regexp.last_match[:k_type]
273
+ v_type = Regexp.last_match[:v_type]
274
+ {}.tap do |hash|
275
+ value.each do |k, v|
276
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
277
+ end
278
+ end
279
+ else # model
280
+ # models (e.g. Pet) or oneOf
281
+ klass = CybridApiBank.const_get(type)
282
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
283
+ end
284
+ end
285
+
286
+ # Returns the string representation of the object
287
+ # @return [String] String presentation of the object
288
+ def to_s
289
+ to_hash.to_s
290
+ end
291
+
292
+ # to_body is an alias to to_hash (backward compatibility)
293
+ # @return [Hash] Returns the object in the form of hash
294
+ def to_body
295
+ to_hash
296
+ end
297
+
298
+ # Returns the object in the form of hash
299
+ # @return [Hash] Returns the object in the form of hash
300
+ def to_hash
301
+ hash = {}
302
+ self.class.attribute_map.each_pair do |attr, param|
303
+ value = self.send(attr)
304
+ if value.nil?
305
+ is_nullable = self.class.openapi_nullable.include?(attr)
306
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
307
+ end
308
+
309
+ hash[param] = _to_hash(value)
310
+ end
311
+ hash
312
+ end
313
+
314
+ # Outputs non-array value in the form of hash
315
+ # For object, use to_hash. Otherwise, just return the value
316
+ # @param [Object] value Any valid value
317
+ # @return [Hash] Returns the value in the form of hash
318
+ def _to_hash(value)
319
+ if value.is_a?(Array)
320
+ value.compact.map { |v| _to_hash(v) }
321
+ elsif value.is_a?(Hash)
322
+ {}.tap do |hash|
323
+ value.each { |k, v| hash[k] = _to_hash(v) }
324
+ end
325
+ elsif value.respond_to? :to_hash
326
+ value.to_hash
327
+ else
328
+ value
329
+ end
330
+ end
331
+
332
+ end
333
+
334
+ end
@@ -0,0 +1,295 @@
1
+ =begin
2
+ #Cybrid Bank API
3
+
4
+ ## Welcome Welcome to the Cybrid platform; enabling turnkey crypto banking services! In these documents, you will find information on the operations provided by our platform, as well as details on how our REST API operates more generally. Our complete set of APIs allows you to manage all your resources: your Organization, your banks and your identities. The complete set of APIs can be found on the following pages: | API | Description | |----------------------------------------------------------------|------------------------------| | [Organization API](https://organization.demo.cybrid.app/api/schema/swagger-ui) | APIs to manage organizations | | [Bank API](https://bank.demo.cybrid.app/api/schema/swagger-ui) | APIs to manage banks | | [Identities API](https://id.demo.cybrid.app/api/schema/swagger-ui) | APIs to manage identities | When you're ready, [request access](https://www.cybrid.xyz/access) to your Dashboard to view and administer your Organization. Once you've logged in, you can begin creating Banks, either for sandbox or production usage, and start enabling your customers to leverage DeFi and web3 with confidence. If you have any questions, please contact [Support](mailto:support@cybrid.app) at any time so that we can help. ## Authentication The Cybrid Platform uses OAuth 2.0 Bearer Tokens to authenticate requests to the platform. Credentials to create Organization and Bank tokens can be generated via your Dashboard ([request access](https://www.cybrid.xyz/access)). An Organization Token applies broadly to the whole Organization and all of its Banks, whereas, a Bank Token is specific to an individual Bank. Both Organization and Bank tokens can be created using the OAuth Client Credential Grant flow. Each Organization and Bank has its own unique Client ID and Secret that allows for machine-to-machine authentication. **Never share your Client ID or Secret publicly or in your source code repository** Your Client ID and Secret can be exchanged for a time-limited Bearer Token by interacting with the Cybrid Identity Provider or through interacting with the **Authorize** button in this document: ``` curl -X POST https://id.demo.cybrid.app/oauth/token -d '{ \"grant_type\": \"client_credentials\", \"client_id\": \"<Your Client ID>\", \"client_secret\": \"<Your Secret>\", \"scope\": \"<Your requested scopes -- space separated>\" }' -H \"Content-Type: application/json\" ``` ## Scopes The Cybrid platform supports the use of scopes to control the level of access a token is limited to. Scopes do not grant access to resources; instead, they provide limits, in support of the least privilege principal. The following scopes are available on the platform and can be requested when generating either an Organization or a Bank token. Generally speaking, the _Read_ scope is required to read and list resources, the _Write_ scope is required to update a resource and the _Execute_ scope is required to create a resource. | Resource | Read scope | Write scope | Execute scope | Token Type | |---------------|--------------------|----------------------|-------------------|--------------------| | Organizations | organizations:read | organizations:write | | Organization/ Bank | | Banks | banks:read | banks:write | banks:execute | Organization/ Bank | | Customers | customers:read | customers:write | customers:execute | Bank | | Assets | prices:read | | | Bank | | Accounts | accounts:read | | accounts:execute | Bank | | Prices | prices:read | | | Bank | | Symbols | prices:read | | | Bank | | Quotes | quotes:read | | quotes:execute | Bank | | Trades | trades:read | | trades:execute | Bank | ## Organizations An Organization is meant to model the organization partnering with Cybrid to use our platform. An Organization does not directly interact with customers. Instead, an Organization has one or more banks, which encompass the financial service offerings of the platform. ## Banks A Bank is owned by an Organization and can be thought of as an environment or container for Customers and product offerings. An example of a Bank would be your customer facing banking website, or an internal staging environment for testing and integration. An Organization can have multiple banks, in sandbox or production environments. A sandbox Bank will be backed by stubbed data and process flows. For instance, identity record and funding source processes will be simulated rather than performed. ## Customers Customers represent your banking users on the platform. At present, we offer support for Individuals as Customers. Customers must be verified in our system before they can play any part on the platform. See the Identity Records section for more details on how a customer can be verified. Customers must also have an account to be able to transact. See the Accounts APIs for more details on setting up accounts for the customer.
5
+
6
+ The version of the OpenAPI document: v0.6.0
7
+ Contact: support@cybrid.app
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 CybridApiBank
17
+ class TradingConfigurationListBankModel
18
+ # The total number of records available.
19
+ attr_accessor :total
20
+
21
+ # The page index to retrieve.
22
+ attr_accessor :page
23
+
24
+ # The number of entities per page to return.
25
+ attr_accessor :per_page
26
+
27
+ attr_accessor :objects
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'total' => :'total',
33
+ :'page' => :'page',
34
+ :'per_page' => :'per_page',
35
+ :'objects' => :'objects'
36
+ }
37
+ end
38
+
39
+ # Returns all the JSON keys this model knows about
40
+ def self.acceptable_attributes
41
+ attribute_map.values
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.openapi_types
46
+ {
47
+ :'total' => :'Integer',
48
+ :'page' => :'Integer',
49
+ :'per_page' => :'Integer',
50
+ :'objects' => :'Array<TradingConfigurationBankModel>'
51
+ }
52
+ end
53
+
54
+ # List of attributes with nullable: true
55
+ def self.openapi_nullable
56
+ Set.new([
57
+ ])
58
+ end
59
+
60
+ # Initializes the object
61
+ # @param [Hash] attributes Model attributes in the form of hash
62
+ def initialize(attributes = {})
63
+ if (!attributes.is_a?(Hash))
64
+ fail ArgumentError, "The input argument (attributes) must be a hash in `CybridApiBank::TradingConfigurationListBankModel` initialize method"
65
+ end
66
+
67
+ # check to see if the attribute exists and convert string to symbol for hash key
68
+ attributes = attributes.each_with_object({}) { |(k, v), h|
69
+ if (!self.class.attribute_map.key?(k.to_sym))
70
+ fail ArgumentError, "`#{k}` is not a valid attribute in `CybridApiBank::TradingConfigurationListBankModel`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
71
+ end
72
+ h[k.to_sym] = v
73
+ }
74
+
75
+ if attributes.key?(:'total')
76
+ self.total = attributes[:'total']
77
+ end
78
+
79
+ if attributes.key?(:'page')
80
+ self.page = attributes[:'page']
81
+ end
82
+
83
+ if attributes.key?(:'per_page')
84
+ self.per_page = attributes[:'per_page']
85
+ end
86
+
87
+ if attributes.key?(:'objects')
88
+ if (value = attributes[:'objects']).is_a?(Array)
89
+ self.objects = value
90
+ end
91
+ end
92
+ end
93
+
94
+ # Show invalid properties with the reasons. Usually used together with valid?
95
+ # @return Array for valid properties with the reasons
96
+ def list_invalid_properties
97
+ invalid_properties = Array.new
98
+ if !@total.nil? && @total < 0
99
+ invalid_properties.push('invalid value for "total", must be greater than or equal to 0.')
100
+ end
101
+
102
+ if !@page.nil? && @page < 0
103
+ invalid_properties.push('invalid value for "page", must be greater than or equal to 0.')
104
+ end
105
+
106
+ if !@per_page.nil? && @per_page < 0
107
+ invalid_properties.push('invalid value for "per_page", must be greater than or equal to 0.')
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
+ return false if !@total.nil? && @total < 0
117
+ return false if !@page.nil? && @page < 0
118
+ return false if !@per_page.nil? && @per_page < 0
119
+ true
120
+ end
121
+
122
+ # Custom attribute writer method with validation
123
+ # @param [Object] total Value to be assigned
124
+ def total=(total)
125
+ if !total.nil? && total < 0
126
+ fail ArgumentError, 'invalid value for "total", must be greater than or equal to 0.'
127
+ end
128
+
129
+ @total = total
130
+ end
131
+
132
+ # Custom attribute writer method with validation
133
+ # @param [Object] page Value to be assigned
134
+ def page=(page)
135
+ if !page.nil? && page < 0
136
+ fail ArgumentError, 'invalid value for "page", must be greater than or equal to 0.'
137
+ end
138
+
139
+ @page = page
140
+ end
141
+
142
+ # Custom attribute writer method with validation
143
+ # @param [Object] per_page Value to be assigned
144
+ def per_page=(per_page)
145
+ if !per_page.nil? && per_page < 0
146
+ fail ArgumentError, 'invalid value for "per_page", must be greater than or equal to 0.'
147
+ end
148
+
149
+ @per_page = per_page
150
+ end
151
+
152
+ # Checks equality by comparing each attribute.
153
+ # @param [Object] Object to be compared
154
+ def ==(o)
155
+ return true if self.equal?(o)
156
+ self.class == o.class &&
157
+ total == o.total &&
158
+ page == o.page &&
159
+ per_page == o.per_page &&
160
+ objects == o.objects
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
+ [total, page, per_page, objects].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
+ new.build_from_hash(attributes)
180
+ end
181
+
182
+ # Builds the object from hash
183
+ # @param [Hash] attributes Model attributes in the form of hash
184
+ # @return [Object] Returns the model itself
185
+ def build_from_hash(attributes)
186
+ return nil unless attributes.is_a?(Hash)
187
+ self.class.openapi_types.each_pair do |key, type|
188
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
189
+ self.send("#{key}=", nil)
190
+ elsif type =~ /\AArray<(.*)>/i
191
+ # check to ensure the input is an array given that the attribute
192
+ # is documented as an array but the input is not
193
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
194
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
195
+ end
196
+ elsif !attributes[self.class.attribute_map[key]].nil?
197
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
198
+ end
199
+ end
200
+
201
+ self
202
+ end
203
+
204
+ # Deserializes the data based on type
205
+ # @param string type Data type
206
+ # @param string value Value to be deserialized
207
+ # @return [Object] Deserialized data
208
+ def _deserialize(type, value)
209
+ case type.to_sym
210
+ when :Time
211
+ Time.parse(value)
212
+ when :Date
213
+ Date.parse(value)
214
+ when :String
215
+ value.to_s
216
+ when :Integer
217
+ value.to_i
218
+ when :Float
219
+ value.to_f
220
+ when :Boolean
221
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
222
+ true
223
+ else
224
+ false
225
+ end
226
+ when :Object
227
+ # generic object (usually a Hash), return directly
228
+ value
229
+ when /\AArray<(?<inner_type>.+)>\z/
230
+ inner_type = Regexp.last_match[:inner_type]
231
+ value.map { |v| _deserialize(inner_type, v) }
232
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
233
+ k_type = Regexp.last_match[:k_type]
234
+ v_type = Regexp.last_match[:v_type]
235
+ {}.tap do |hash|
236
+ value.each do |k, v|
237
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
238
+ end
239
+ end
240
+ else # model
241
+ # models (e.g. Pet) or oneOf
242
+ klass = CybridApiBank.const_get(type)
243
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
244
+ end
245
+ end
246
+
247
+ # Returns the string representation of the object
248
+ # @return [String] String presentation of the object
249
+ def to_s
250
+ to_hash.to_s
251
+ end
252
+
253
+ # to_body is an alias to to_hash (backward compatibility)
254
+ # @return [Hash] Returns the object in the form of hash
255
+ def to_body
256
+ to_hash
257
+ end
258
+
259
+ # Returns the object in the form of hash
260
+ # @return [Hash] Returns the object in the form of hash
261
+ def to_hash
262
+ hash = {}
263
+ self.class.attribute_map.each_pair do |attr, param|
264
+ value = self.send(attr)
265
+ if value.nil?
266
+ is_nullable = self.class.openapi_nullable.include?(attr)
267
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
268
+ end
269
+
270
+ hash[param] = _to_hash(value)
271
+ end
272
+ hash
273
+ end
274
+
275
+ # Outputs non-array value in the form of hash
276
+ # For object, use to_hash. Otherwise, just return the value
277
+ # @param [Object] value Any valid value
278
+ # @return [Hash] Returns the value in the form of hash
279
+ def _to_hash(value)
280
+ if value.is_a?(Array)
281
+ value.compact.map { |v| _to_hash(v) }
282
+ elsif value.is_a?(Hash)
283
+ {}.tap do |hash|
284
+ value.each { |k, v| hash[k] = _to_hash(v) }
285
+ end
286
+ elsif value.respond_to? :to_hash
287
+ value.to_hash
288
+ else
289
+ value
290
+ end
291
+ end
292
+
293
+ end
294
+
295
+ end
@@ -3,7 +3,7 @@
3
3
 
4
4
  ## Welcome Welcome to the Cybrid platform; enabling turnkey crypto banking services! In these documents, you will find information on the operations provided by our platform, as well as details on how our REST API operates more generally. Our complete set of APIs allows you to manage all your resources: your Organization, your banks and your identities. The complete set of APIs can be found on the following pages: | API | Description | |----------------------------------------------------------------|------------------------------| | [Organization API](https://organization.demo.cybrid.app/api/schema/swagger-ui) | APIs to manage organizations | | [Bank API](https://bank.demo.cybrid.app/api/schema/swagger-ui) | APIs to manage banks | | [Identities API](https://id.demo.cybrid.app/api/schema/swagger-ui) | APIs to manage identities | When you're ready, [request access](https://www.cybrid.xyz/access) to your Dashboard to view and administer your Organization. Once you've logged in, you can begin creating Banks, either for sandbox or production usage, and start enabling your customers to leverage DeFi and web3 with confidence. If you have any questions, please contact [Support](mailto:support@cybrid.app) at any time so that we can help. ## Authentication The Cybrid Platform uses OAuth 2.0 Bearer Tokens to authenticate requests to the platform. Credentials to create Organization and Bank tokens can be generated via your Dashboard ([request access](https://www.cybrid.xyz/access)). An Organization Token applies broadly to the whole Organization and all of its Banks, whereas, a Bank Token is specific to an individual Bank. Both Organization and Bank tokens can be created using the OAuth Client Credential Grant flow. Each Organization and Bank has its own unique Client ID and Secret that allows for machine-to-machine authentication. **Never share your Client ID or Secret publicly or in your source code repository** Your Client ID and Secret can be exchanged for a time-limited Bearer Token by interacting with the Cybrid Identity Provider or through interacting with the **Authorize** button in this document: ``` curl -X POST https://id.demo.cybrid.app/oauth/token -d '{ \"grant_type\": \"client_credentials\", \"client_id\": \"<Your Client ID>\", \"client_secret\": \"<Your Secret>\", \"scope\": \"<Your requested scopes -- space separated>\" }' -H \"Content-Type: application/json\" ``` ## Scopes The Cybrid platform supports the use of scopes to control the level of access a token is limited to. Scopes do not grant access to resources; instead, they provide limits, in support of the least privilege principal. The following scopes are available on the platform and can be requested when generating either an Organization or a Bank token. Generally speaking, the _Read_ scope is required to read and list resources, the _Write_ scope is required to update a resource and the _Execute_ scope is required to create a resource. | Resource | Read scope | Write scope | Execute scope | Token Type | |---------------|--------------------|----------------------|-------------------|--------------------| | Organizations | organizations:read | organizations:write | | Organization/ Bank | | Banks | banks:read | banks:write | banks:execute | Organization/ Bank | | Customers | customers:read | customers:write | customers:execute | Bank | | Assets | prices:read | | | Bank | | Accounts | accounts:read | | accounts:execute | Bank | | Prices | prices:read | | | Bank | | Symbols | prices:read | | | Bank | | Quotes | quotes:read | | quotes:execute | Bank | | Trades | trades:read | | trades:execute | Bank | ## Organizations An Organization is meant to model the organization partnering with Cybrid to use our platform. An Organization does not directly interact with customers. Instead, an Organization has one or more banks, which encompass the financial service offerings of the platform. ## Banks A Bank is owned by an Organization and can be thought of as an environment or container for Customers and product offerings. An example of a Bank would be your customer facing banking website, or an internal staging environment for testing and integration. An Organization can have multiple banks, in sandbox or production environments. A sandbox Bank will be backed by stubbed data and process flows. For instance, identity record and funding source processes will be simulated rather than performed. ## Customers Customers represent your banking users on the platform. At present, we offer support for Individuals as Customers. Customers must be verified in our system before they can play any part on the platform. See the Identity Records section for more details on how a customer can be verified. Customers must also have an account to be able to transact. See the Accounts APIs for more details on setting up accounts for the customer.
5
5
 
6
- The version of the OpenAPI document: v0.5.0
6
+ The version of the OpenAPI document: v0.6.0
7
7
  Contact: support@cybrid.app
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.4.0
@@ -3,7 +3,7 @@
3
3
 
4
4
  ## Welcome Welcome to the Cybrid platform; enabling turnkey crypto banking services! In these documents, you will find information on the operations provided by our platform, as well as details on how our REST API operates more generally. Our complete set of APIs allows you to manage all your resources: your Organization, your banks and your identities. The complete set of APIs can be found on the following pages: | API | Description | |----------------------------------------------------------------|------------------------------| | [Organization API](https://organization.demo.cybrid.app/api/schema/swagger-ui) | APIs to manage organizations | | [Bank API](https://bank.demo.cybrid.app/api/schema/swagger-ui) | APIs to manage banks | | [Identities API](https://id.demo.cybrid.app/api/schema/swagger-ui) | APIs to manage identities | When you're ready, [request access](https://www.cybrid.xyz/access) to your Dashboard to view and administer your Organization. Once you've logged in, you can begin creating Banks, either for sandbox or production usage, and start enabling your customers to leverage DeFi and web3 with confidence. If you have any questions, please contact [Support](mailto:support@cybrid.app) at any time so that we can help. ## Authentication The Cybrid Platform uses OAuth 2.0 Bearer Tokens to authenticate requests to the platform. Credentials to create Organization and Bank tokens can be generated via your Dashboard ([request access](https://www.cybrid.xyz/access)). An Organization Token applies broadly to the whole Organization and all of its Banks, whereas, a Bank Token is specific to an individual Bank. Both Organization and Bank tokens can be created using the OAuth Client Credential Grant flow. Each Organization and Bank has its own unique Client ID and Secret that allows for machine-to-machine authentication. **Never share your Client ID or Secret publicly or in your source code repository** Your Client ID and Secret can be exchanged for a time-limited Bearer Token by interacting with the Cybrid Identity Provider or through interacting with the **Authorize** button in this document: ``` curl -X POST https://id.demo.cybrid.app/oauth/token -d '{ \"grant_type\": \"client_credentials\", \"client_id\": \"<Your Client ID>\", \"client_secret\": \"<Your Secret>\", \"scope\": \"<Your requested scopes -- space separated>\" }' -H \"Content-Type: application/json\" ``` ## Scopes The Cybrid platform supports the use of scopes to control the level of access a token is limited to. Scopes do not grant access to resources; instead, they provide limits, in support of the least privilege principal. The following scopes are available on the platform and can be requested when generating either an Organization or a Bank token. Generally speaking, the _Read_ scope is required to read and list resources, the _Write_ scope is required to update a resource and the _Execute_ scope is required to create a resource. | Resource | Read scope | Write scope | Execute scope | Token Type | |---------------|--------------------|----------------------|-------------------|--------------------| | Organizations | organizations:read | organizations:write | | Organization/ Bank | | Banks | banks:read | banks:write | banks:execute | Organization/ Bank | | Customers | customers:read | customers:write | customers:execute | Bank | | Assets | prices:read | | | Bank | | Accounts | accounts:read | | accounts:execute | Bank | | Prices | prices:read | | | Bank | | Symbols | prices:read | | | Bank | | Quotes | quotes:read | | quotes:execute | Bank | | Trades | trades:read | | trades:execute | Bank | ## Organizations An Organization is meant to model the organization partnering with Cybrid to use our platform. An Organization does not directly interact with customers. Instead, an Organization has one or more banks, which encompass the financial service offerings of the platform. ## Banks A Bank is owned by an Organization and can be thought of as an environment or container for Customers and product offerings. An example of a Bank would be your customer facing banking website, or an internal staging environment for testing and integration. An Organization can have multiple banks, in sandbox or production environments. A sandbox Bank will be backed by stubbed data and process flows. For instance, identity record and funding source processes will be simulated rather than performed. ## Customers Customers represent your banking users on the platform. At present, we offer support for Individuals as Customers. Customers must be verified in our system before they can play any part on the platform. See the Identity Records section for more details on how a customer can be verified. Customers must also have an account to be able to transact. See the Accounts APIs for more details on setting up accounts for the customer.
5
5
 
6
- The version of the OpenAPI document: v0.5.0
6
+ The version of the OpenAPI document: v0.6.0
7
7
  Contact: support@cybrid.app
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 5.4.0