snaptrade 3.0.55 → 3.0.57

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.
@@ -57,28 +57,6 @@ module SnapTrade
57
57
  # List of legs that make up the order.
58
58
  attr_accessor :legs
59
59
 
60
- class EnumAttributeValidator
61
- attr_reader :datatype
62
- attr_reader :allowable_values
63
-
64
- def initialize(datatype, allowable_values)
65
- @allowable_values = allowable_values.map do |value|
66
- case datatype.to_s
67
- when /Integer/i
68
- value.to_i
69
- when /Float/i
70
- value.to_f
71
- else
72
- value
73
- end
74
- end
75
- end
76
-
77
- def valid?(value)
78
- !value || allowable_values.include?(value)
79
- end
80
- end
81
-
82
60
  # Attribute mapping from ruby-style variable name to JSON key.
83
61
  def self.attribute_map
84
62
  {
@@ -117,7 +95,7 @@ module SnapTrade
117
95
  :'time_placed' => :'Time',
118
96
  :'time_executed' => :'Time',
119
97
  :'price_currency' => :'String',
120
- :'price_effect' => :'String',
98
+ :'price_effect' => :'PriceEffect',
121
99
  :'execution_price' => :'Float',
122
100
  :'limit_price' => :'Float',
123
101
  :'stop_price' => :'Float',
@@ -233,21 +211,9 @@ module SnapTrade
233
211
  # @return true if the model is valid
234
212
  def valid?
235
213
  return false if @price_effect.nil?
236
- price_effect_validator = EnumAttributeValidator.new('String', ["CREDIT", "DEBIT", "EVEN", "UNKNOWN"])
237
- return false unless price_effect_validator.valid?(@price_effect)
238
214
  true
239
215
  end
240
216
 
241
- # Custom attribute writer method checking allowed values (enum).
242
- # @param [Object] price_effect Object to be assigned
243
- def price_effect=(price_effect)
244
- validator = EnumAttributeValidator.new('String', ["CREDIT", "DEBIT", "EVEN", "UNKNOWN"])
245
- unless validator.valid?(price_effect)
246
- fail ArgumentError, "invalid value for \"price_effect\", must be one of #{validator.allowable_values}."
247
- end
248
- @price_effect = price_effect
249
- end
250
-
251
217
  # Checks equality by comparing each attribute.
252
218
  # @param [Object] Object to be compared
253
219
  def ==(o)
@@ -11,7 +11,7 @@ require 'date'
11
11
  require 'time'
12
12
 
13
13
  module SnapTrade
14
- # An annuity contract account under a connection. Akoya accounts returned in the `annuityAccount` category use this kind; investment accounts holding annuity products remain `investment` accounts. `net_value` is the contract's surrender/cash value (`netPresentValue` from Akoya), not available cash. It is real-time or cached depending on the caller's plan, and always cached on `AccountInformation_listAllUserAccounts`.
14
+ # An annuity contract account under a connection. Investment accounts holding annuity products remain `investment` accounts. `net_value` is the contract's surrender/cash value, not available cash. It is real-time or cached depending on the caller's plan, and always cached on `AccountInformation_listAllUserAccounts`.
15
15
  class AnnuityAccount
16
16
  # Discriminator for the account kind.
17
17
  attr_accessor :kind
@@ -11,7 +11,7 @@ require 'date'
11
11
  require 'time'
12
12
 
13
13
  module SnapTrade
14
- # Contains sync status for an annuity contract's value. Akoya annuity accounts do not expose transactions, orders, or positions, so those fields are omitted. `balances` is derived from the last successful holdings sync and is null if never synced. It tracks the contract value, not available cash.
14
+ # Contains sync status for an annuity contract's value. Transactions, orders, and positions are omitted. `balances` is derived from the last successful holdings sync and is null if never synced. It tracks the contract value, not available cash.
15
15
  class AnnuityAccountSyncStatus
16
16
  # The last time the annuity contract value was successfully synced by SnapTrade.
17
17
  attr_accessor :balances
@@ -11,7 +11,7 @@ require 'date'
11
11
  require 'time'
12
12
 
13
13
  module SnapTrade
14
- # A single account under a connection, from the `kind`-discriminated union used by `Connections_listConnectionAccounts` and `AccountInformation_listAllUserAccounts`. Use `kind` to determine which schema is present. `investment`, `deposit`, `line_of_credit`, and `annuity` are implemented today.
14
+ # A single account under a connection, from the `kind`-discriminated union used by `Connections_listConnectionAccounts` and `AccountInformation_listAllUserAccounts`. Use `kind` to determine which schema is present. `investment`, `deposit`, `line_of_credit`, `annuity`, and `mortgage` are implemented today.
15
15
  module ConnectionAccount
16
16
  class << self
17
17
  # List of class defined in oneOf (OpenAPI v3)
@@ -20,7 +20,8 @@ module SnapTrade
20
20
  :'AnnuityAccount',
21
21
  :'DepositAccount',
22
22
  :'InvestmentAccount',
23
- :'LineOfCreditAccount'
23
+ :'LineOfCreditAccount',
24
+ :'MortgageAccount'
24
25
  ]
25
26
  end
26
27
 
@@ -35,7 +36,8 @@ module SnapTrade
35
36
  :'annuity' => :'AnnuityAccount',
36
37
  :'deposit' => :'DepositAccount',
37
38
  :'investment' => :'InvestmentAccount',
38
- :'line_of_credit' => :'LineOfCreditAccount'
39
+ :'line_of_credit' => :'LineOfCreditAccount',
40
+ :'mortgage' => :'MortgageAccount'
39
41
  }
40
42
  end
41
43
 
@@ -0,0 +1,356 @@
1
+ =begin
2
+ #SnapTrade
3
+
4
+ #Connect brokerage accounts to your app for live positions and trading. ## Rate limiting Two limits apply to requests signed with your `clientId`. The stricter one wins, and exceeding either returns `429 Too Many Requests`. - **Customer-level** — 250 requests/minute by default, scoped to your `clientId` and applied across all endpoints. Reported in `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`. - **Account-level** — 10 requests/minute per account, scoped to (`clientId`, `accountId`). All covered operations for one account draw on the same bucket — reading balances and reading positions share it — and enforcement does not depend on the HTTP method, so updating an account consumes the same bucket as reading it. Only enforced for Personal users, and only for integrations it has been rolled out to — it is not yet in force for every Personal integration. It also does not apply on every operation that documents a 429 below. Where it applies it is reported in `X-RateLimit-Account-Limit`, `X-RateLimit-Account-Remaining` and `X-RateLimit-Account-Reset`. Do not read the absence of those headers as proof the limit is off — some configurations omit the rate limit headers while still enforcing the limit, so header absence tells you nothing about your allowance. On a 429, `X-RateLimit-Remaining: 0` means you hit the customer-level limit and `X-RateLimit-Account-Remaining: 0` means the account-level one. Wait for the corresponding `*-Reset` value (seconds) before retrying, or fall back to exponential backoff with jitter. Not every 429 is explained by those headers. A separate per-authenticated-user limit, reported in no `X-RateLimit-*` header, covers OAuth-authenticated requests and signed requests in configurations where the customer-level limit is not in effect — on the operations that use the default throttles. A few operations override those and are governed by the customer-level limit alone. The two do not stack: a signed request governed by the customer-level limit above is not additionally subject to the per-user one. If a 429 arrives with no header at zero — or with no `X-RateLimit-*` headers at all — honour `Retry-After` and back off. Treat the remaining counts as a hint, not a guarantee that the next request will succeed. Because the customer-level limit applies everywhere, any signed request can return 429. **OAuth-authenticated requests are an exception.** They are not subject to the customer-level limit and do not receive `X-RateLimit-Limit`, `X-RateLimit-Remaining` or `X-RateLimit-Reset` — do not wait on those headers or design around a customer-level allowance on this path. The account-level limit still applies to them on the account-data endpoints above, reported in the `X-RateLimit-Account-*` headers. On operations using the default throttles the per-user limit above applies to them as well, so an OAuth request can be rejected while the account headers still show capacity; on the few operations that override those throttles, OAuth callers have no per-user ceiling at all. Drive retries from `Retry-After` and exponential backoff with jitter rather than from the headers. See https://docs.snaptrade.com/docs/ratelimiting.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: api@snaptrade.com
8
+ =end
9
+
10
+ require 'date'
11
+ require 'time'
12
+
13
+ module SnapTrade
14
+ # A mortgage account under a connection. `net_value` is negative principal owed, excluding escrow. It is real-time or cached depending on the caller's plan, and always cached on `AccountInformation_listAllUserAccounts`.
15
+ class MortgageAccount
16
+ # Discriminator for the account kind.
17
+ attr_accessor :kind
18
+
19
+ # Unique identifier for the connected institution account. This is the UUID used to reference the account in SnapTrade.
20
+ attr_accessor :id
21
+
22
+ # Unique identifier for the connection (brokerage_authorization_id). This is the UUID used to reference the connection in SnapTrade.
23
+ attr_accessor :connection_id
24
+
25
+ # The current status of the account. Omitted when the status is unknown or not provided by the institution. - `open`: The account is open. - `closed`: The account is closed. - `archived`: The account is archived. - `unavailable`: The account is no longer available through the institution's API. Accounts with this status are excluded from account list responses.
26
+ attr_accessor :status
27
+
28
+ # A display name for the account. Either assigned by the user or by the institution itself.
29
+ attr_accessor :display_name
30
+
31
+ # The account number assigned by the institution, masked to the last 4 characters (e.g. `****4821`).
32
+ attr_accessor :masked_account_number
33
+
34
+ # A stable and unique account identifier provided by the institution. Will be set to null if not provided. When present, can be used to check if a user has connected the same institution account across multiple connections.
35
+ attr_accessor :institution_account_id
36
+
37
+ # Unique identifier for the institution that holds the account.
38
+ attr_accessor :institution_id
39
+
40
+ # Timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format indicating when the account was opened at the institution. Only populated for institutions that expose this data; `null` for all other institutions.
41
+ attr_accessor :opening_date
42
+
43
+ attr_accessor :sync_status
44
+
45
+ # The account type as provided by the institution.
46
+ attr_accessor :raw_type
47
+
48
+ attr_accessor :net_value
49
+
50
+ # Attribute mapping from ruby-style variable name to JSON key.
51
+ def self.attribute_map
52
+ {
53
+ :'kind' => :'kind',
54
+ :'id' => :'id',
55
+ :'connection_id' => :'connection_id',
56
+ :'status' => :'status',
57
+ :'display_name' => :'display_name',
58
+ :'masked_account_number' => :'masked_account_number',
59
+ :'institution_account_id' => :'institution_account_id',
60
+ :'institution_id' => :'institution_id',
61
+ :'opening_date' => :'opening_date',
62
+ :'sync_status' => :'sync_status',
63
+ :'raw_type' => :'raw_type',
64
+ :'net_value' => :'net_value'
65
+ }
66
+ end
67
+
68
+ # Returns all the JSON keys this model knows about
69
+ def self.acceptable_attributes
70
+ attribute_map.values
71
+ end
72
+
73
+ # Attribute type mapping.
74
+ def self.openapi_types
75
+ {
76
+ :'kind' => :'MortgageAccountKind',
77
+ :'id' => :'String',
78
+ :'connection_id' => :'String',
79
+ :'status' => :'ConnectionAccountStatus',
80
+ :'display_name' => :'String',
81
+ :'masked_account_number' => :'String',
82
+ :'institution_account_id' => :'String',
83
+ :'institution_id' => :'String',
84
+ :'opening_date' => :'Time',
85
+ :'sync_status' => :'MortgageAccountSyncStatus',
86
+ :'raw_type' => :'String',
87
+ :'net_value' => :'MortgageAccountNetValue'
88
+ }
89
+ end
90
+
91
+ # List of attributes with nullable: true
92
+ def self.openapi_nullable
93
+ Set.new([
94
+ :'display_name',
95
+ :'institution_account_id',
96
+ :'opening_date',
97
+ :'raw_type',
98
+ :'net_value'
99
+ ])
100
+ end
101
+
102
+ # Initializes the object
103
+ # @param [Hash] attributes Model attributes in the form of hash
104
+ def initialize(attributes = {})
105
+ if (!attributes.is_a?(Hash))
106
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SnapTrade::MortgageAccount` initialize method"
107
+ end
108
+
109
+ # check to see if the attribute exists and convert string to symbol for hash key
110
+ attributes = attributes.each_with_object({}) { |(k, v), h|
111
+ if (!self.class.attribute_map.key?(k.to_sym))
112
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SnapTrade::MortgageAccount`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
113
+ end
114
+ h[k.to_sym] = v
115
+ }
116
+
117
+ if attributes.key?(:'kind')
118
+ self.kind = attributes[:'kind']
119
+ end
120
+
121
+ if attributes.key?(:'id')
122
+ self.id = attributes[:'id']
123
+ end
124
+
125
+ if attributes.key?(:'connection_id')
126
+ self.connection_id = attributes[:'connection_id']
127
+ end
128
+
129
+ if attributes.key?(:'status')
130
+ self.status = attributes[:'status']
131
+ end
132
+
133
+ if attributes.key?(:'display_name')
134
+ self.display_name = attributes[:'display_name']
135
+ end
136
+
137
+ if attributes.key?(:'masked_account_number')
138
+ self.masked_account_number = attributes[:'masked_account_number']
139
+ end
140
+
141
+ if attributes.key?(:'institution_account_id')
142
+ self.institution_account_id = attributes[:'institution_account_id']
143
+ end
144
+
145
+ if attributes.key?(:'institution_id')
146
+ self.institution_id = attributes[:'institution_id']
147
+ end
148
+
149
+ if attributes.key?(:'opening_date')
150
+ self.opening_date = attributes[:'opening_date']
151
+ end
152
+
153
+ if attributes.key?(:'sync_status')
154
+ self.sync_status = attributes[:'sync_status']
155
+ end
156
+
157
+ if attributes.key?(:'raw_type')
158
+ self.raw_type = attributes[:'raw_type']
159
+ end
160
+
161
+ if attributes.key?(:'net_value')
162
+ self.net_value = attributes[:'net_value']
163
+ end
164
+ end
165
+
166
+ # Show invalid properties with the reasons. Usually used together with valid?
167
+ # @return Array for valid properties with the reasons
168
+ def list_invalid_properties
169
+ invalid_properties = Array.new
170
+ if @kind.nil?
171
+ invalid_properties.push('invalid value for "kind", kind cannot be nil.')
172
+ end
173
+
174
+ if @id.nil?
175
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
176
+ end
177
+
178
+ if @connection_id.nil?
179
+ invalid_properties.push('invalid value for "connection_id", connection_id cannot be nil.')
180
+ end
181
+
182
+ if @masked_account_number.nil?
183
+ invalid_properties.push('invalid value for "masked_account_number", masked_account_number cannot be nil.')
184
+ end
185
+
186
+ if @sync_status.nil?
187
+ invalid_properties.push('invalid value for "sync_status", sync_status cannot be nil.')
188
+ end
189
+
190
+ invalid_properties
191
+ end
192
+
193
+ # Check to see if the all the properties in the model are valid
194
+ # @return true if the model is valid
195
+ def valid?
196
+ return false if @kind.nil?
197
+ return false if @id.nil?
198
+ return false if @connection_id.nil?
199
+ return false if @masked_account_number.nil?
200
+ return false if @sync_status.nil?
201
+ true
202
+ end
203
+
204
+ # Checks equality by comparing each attribute.
205
+ # @param [Object] Object to be compared
206
+ def ==(o)
207
+ return true if self.equal?(o)
208
+ self.class == o.class &&
209
+ kind == o.kind &&
210
+ id == o.id &&
211
+ connection_id == o.connection_id &&
212
+ status == o.status &&
213
+ display_name == o.display_name &&
214
+ masked_account_number == o.masked_account_number &&
215
+ institution_account_id == o.institution_account_id &&
216
+ institution_id == o.institution_id &&
217
+ opening_date == o.opening_date &&
218
+ sync_status == o.sync_status &&
219
+ raw_type == o.raw_type &&
220
+ net_value == o.net_value
221
+ end
222
+
223
+ # @see the `==` method
224
+ # @param [Object] Object to be compared
225
+ def eql?(o)
226
+ self == o
227
+ end
228
+
229
+ # Calculates hash code according to all attributes.
230
+ # @return [Integer] Hash code
231
+ def hash
232
+ [kind, id, connection_id, status, display_name, masked_account_number, institution_account_id, institution_id, opening_date, sync_status, raw_type, net_value].hash
233
+ end
234
+
235
+ # Builds the object from hash
236
+ # @param [Hash] attributes Model attributes in the form of hash
237
+ # @return [Object] Returns the model itself
238
+ def self.build_from_hash(attributes)
239
+ new.build_from_hash(attributes)
240
+ end
241
+
242
+ # Builds the object from hash
243
+ # @param [Hash] attributes Model attributes in the form of hash
244
+ # @return [Object] Returns the model itself
245
+ def build_from_hash(attributes)
246
+ return nil unless attributes.is_a?(Hash)
247
+ attributes = attributes.transform_keys(&:to_sym)
248
+ self.class.openapi_types.each_pair do |key, type|
249
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
250
+ self.send("#{key}=", nil)
251
+ elsif type =~ /\AArray<(.*)>/i
252
+ # check to ensure the input is an array given that the attribute
253
+ # is documented as an array but the input is not
254
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
255
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
256
+ end
257
+ elsif !attributes[self.class.attribute_map[key]].nil?
258
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
259
+ end
260
+ end
261
+
262
+ self
263
+ end
264
+
265
+ # Deserializes the data based on type
266
+ # @param string type Data type
267
+ # @param string value Value to be deserialized
268
+ # @return [Object] Deserialized data
269
+ def _deserialize(type, value)
270
+ case type.to_sym
271
+ when :Time
272
+ Time.parse(value)
273
+ when :Date
274
+ Date.parse(value)
275
+ when :String
276
+ value.to_s
277
+ when :Integer
278
+ value.to_i
279
+ when :Float
280
+ value.to_f
281
+ when :Boolean
282
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
283
+ true
284
+ else
285
+ false
286
+ end
287
+ when :Object
288
+ # generic object (usually a Hash), return directly
289
+ value
290
+ when /\AArray<(?<inner_type>.+)>\z/
291
+ inner_type = Regexp.last_match[:inner_type]
292
+ value.map { |v| _deserialize(inner_type, v) }
293
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
294
+ k_type = Regexp.last_match[:k_type]
295
+ v_type = Regexp.last_match[:v_type]
296
+ {}.tap do |hash|
297
+ value.each do |k, v|
298
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
299
+ end
300
+ end
301
+ else # model
302
+ # models (e.g. Pet) or oneOf
303
+ klass = SnapTrade.const_get(type)
304
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
305
+ end
306
+ end
307
+
308
+ # Returns the string representation of the object
309
+ # @return [String] String presentation of the object
310
+ def to_s
311
+ to_hash.to_s
312
+ end
313
+
314
+ # to_body is an alias to to_hash (backward compatibility)
315
+ # @return [Hash] Returns the object in the form of hash
316
+ def to_body
317
+ to_hash
318
+ end
319
+
320
+ # Returns the object in the form of hash
321
+ # @return [Hash] Returns the object in the form of hash
322
+ def to_hash
323
+ hash = {}
324
+ self.class.attribute_map.each_pair do |attr, param|
325
+ value = self.send(attr)
326
+ if value.nil?
327
+ is_nullable = self.class.openapi_nullable.include?(attr)
328
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
329
+ end
330
+
331
+ hash[param] = _to_hash(value)
332
+ end
333
+ hash
334
+ end
335
+
336
+ # Outputs non-array value in the form of hash
337
+ # For object, use to_hash. Otherwise, just return the value
338
+ # @param [Object] value Any valid value
339
+ # @return [Hash] Returns the value in the form of hash
340
+ def _to_hash(value)
341
+ if value.is_a?(Array)
342
+ value.compact.map { |v| _to_hash(v) }
343
+ elsif value.is_a?(Hash)
344
+ {}.tap do |hash|
345
+ value.each { |k, v| hash[k] = _to_hash(v) }
346
+ end
347
+ elsif value.respond_to? :to_hash
348
+ value.to_hash
349
+ else
350
+ value
351
+ end
352
+ end
353
+
354
+ end
355
+
356
+ end
@@ -0,0 +1,36 @@
1
+ =begin
2
+ #SnapTrade
3
+
4
+ #Connect brokerage accounts to your app for live positions and trading. ## Rate limiting Two limits apply to requests signed with your `clientId`. The stricter one wins, and exceeding either returns `429 Too Many Requests`. - **Customer-level** — 250 requests/minute by default, scoped to your `clientId` and applied across all endpoints. Reported in `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`. - **Account-level** — 10 requests/minute per account, scoped to (`clientId`, `accountId`). All covered operations for one account draw on the same bucket — reading balances and reading positions share it — and enforcement does not depend on the HTTP method, so updating an account consumes the same bucket as reading it. Only enforced for Personal users, and only for integrations it has been rolled out to — it is not yet in force for every Personal integration. It also does not apply on every operation that documents a 429 below. Where it applies it is reported in `X-RateLimit-Account-Limit`, `X-RateLimit-Account-Remaining` and `X-RateLimit-Account-Reset`. Do not read the absence of those headers as proof the limit is off — some configurations omit the rate limit headers while still enforcing the limit, so header absence tells you nothing about your allowance. On a 429, `X-RateLimit-Remaining: 0` means you hit the customer-level limit and `X-RateLimit-Account-Remaining: 0` means the account-level one. Wait for the corresponding `*-Reset` value (seconds) before retrying, or fall back to exponential backoff with jitter. Not every 429 is explained by those headers. A separate per-authenticated-user limit, reported in no `X-RateLimit-*` header, covers OAuth-authenticated requests and signed requests in configurations where the customer-level limit is not in effect — on the operations that use the default throttles. A few operations override those and are governed by the customer-level limit alone. The two do not stack: a signed request governed by the customer-level limit above is not additionally subject to the per-user one. If a 429 arrives with no header at zero — or with no `X-RateLimit-*` headers at all — honour `Retry-After` and back off. Treat the remaining counts as a hint, not a guarantee that the next request will succeed. Because the customer-level limit applies everywhere, any signed request can return 429. **OAuth-authenticated requests are an exception.** They are not subject to the customer-level limit and do not receive `X-RateLimit-Limit`, `X-RateLimit-Remaining` or `X-RateLimit-Reset` — do not wait on those headers or design around a customer-level allowance on this path. The account-level limit still applies to them on the account-data endpoints above, reported in the `X-RateLimit-Account-*` headers. On operations using the default throttles the per-user limit above applies to them as well, so an OAuth request can be rejected while the account headers still show capacity; on the few operations that override those throttles, OAuth callers have no per-user ceiling at all. Drive retries from `Retry-After` and exponential backoff with jitter rather than from the headers. See https://docs.snaptrade.com/docs/ratelimiting.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: api@snaptrade.com
8
+ =end
9
+
10
+ require 'date'
11
+ require 'time'
12
+
13
+ module SnapTrade
14
+ class MortgageAccountKind
15
+ MORTGAGE = "mortgage".freeze
16
+
17
+ def self.all_vars
18
+ @all_vars ||= [MORTGAGE].freeze
19
+ end
20
+
21
+ # Builds the enum from string
22
+ # @param [String] The enum value in the form of the string
23
+ # @return [String] The enum value
24
+ def self.build_from_hash(value)
25
+ new.build_from_hash(value)
26
+ end
27
+
28
+ # Builds the enum from string
29
+ # @param [String] The enum value in the form of the string
30
+ # @return [String] The enum value
31
+ def build_from_hash(value)
32
+ return value if MortgageAccountKind.all_vars.include?(value)
33
+ raise "Invalid ENUM value #{value} for class #MortgageAccountKind"
34
+ end
35
+ end
36
+ end