turnkey_client 0.0.4 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/lib/turnkey_client/api/organizations_api.rb +58 -0
  3. data/lib/turnkey_client/api/policies_api.rb +58 -0
  4. data/lib/turnkey_client/api/private_keys_api.rb +58 -0
  5. data/lib/turnkey_client/api/sessions_api.rb +116 -0
  6. data/lib/turnkey_client/api/signing_api.rb +58 -0
  7. data/lib/turnkey_client/api/users_api.rb +232 -0
  8. data/lib/turnkey_client/api/wallets_api.rb +58 -0
  9. data/lib/turnkey_client/models/activity.rb +13 -4
  10. data/lib/turnkey_client/models/activity_type.rb +13 -0
  11. data/lib/turnkey_client/models/any.rb +200 -0
  12. data/lib/turnkey_client/models/api_key_curve.rb +28 -0
  13. data/lib/turnkey_client/models/api_key_params_v2.rb +250 -0
  14. data/lib/turnkey_client/models/config.rb +216 -0
  15. data/lib/turnkey_client/models/create_api_keys_intent_v2.rb +228 -0
  16. data/lib/turnkey_client/models/create_api_keys_request.rb +2 -2
  17. data/lib/turnkey_client/models/create_oauth_providers_intent.rb +228 -0
  18. data/lib/turnkey_client/models/create_oauth_providers_request.rb +288 -0
  19. data/lib/turnkey_client/models/create_oauth_providers_result.rb +213 -0
  20. data/lib/turnkey_client/models/create_policies_intent.rb +213 -0
  21. data/lib/turnkey_client/models/create_policies_request.rb +288 -0
  22. data/lib/turnkey_client/models/create_policies_result.rb +213 -0
  23. data/lib/turnkey_client/models/create_read_only_session_intent.rb +196 -0
  24. data/lib/turnkey_client/models/create_read_only_session_request.rb +288 -0
  25. data/lib/turnkey_client/models/create_read_only_session_result.rb +286 -0
  26. data/lib/turnkey_client/models/create_read_write_session_intent.rb +246 -0
  27. data/lib/turnkey_client/models/create_read_write_session_request.rb +288 -0
  28. data/lib/turnkey_client/models/create_read_write_session_result.rb +286 -0
  29. data/lib/turnkey_client/models/create_sub_organization_intent_v5.rb +272 -0
  30. data/lib/turnkey_client/models/create_sub_organization_intent_v6.rb +272 -0
  31. data/lib/turnkey_client/models/create_sub_organization_request.rb +2 -2
  32. data/lib/turnkey_client/models/create_sub_organization_result_v5.rb +230 -0
  33. data/lib/turnkey_client/models/create_sub_organization_result_v6.rb +230 -0
  34. data/lib/turnkey_client/models/credential_type.rb +3 -0
  35. data/lib/turnkey_client/models/delete_oauth_providers_intent.rb +228 -0
  36. data/lib/turnkey_client/models/delete_oauth_providers_request.rb +288 -0
  37. data/lib/turnkey_client/models/delete_oauth_providers_result.rb +213 -0
  38. data/lib/turnkey_client/models/delete_private_keys_intent.rb +223 -0
  39. data/lib/turnkey_client/models/delete_private_keys_request.rb +288 -0
  40. data/lib/turnkey_client/models/delete_private_keys_result.rb +213 -0
  41. data/lib/turnkey_client/models/delete_wallets_intent.rb +223 -0
  42. data/lib/turnkey_client/models/delete_wallets_request.rb +288 -0
  43. data/lib/turnkey_client/models/delete_wallets_result.rb +213 -0
  44. data/lib/turnkey_client/models/email_auth_intent.rb +14 -4
  45. data/lib/turnkey_client/models/email_auth_intent_v2.rb +265 -0
  46. data/lib/turnkey_client/models/email_auth_request.rb +2 -2
  47. data/lib/turnkey_client/models/email_customization_params.rb +1 -1
  48. data/lib/turnkey_client/models/external_data_v1_quorum.rb +228 -0
  49. data/lib/turnkey_client/models/get_oauth_providers_request.rb +221 -0
  50. data/lib/turnkey_client/models/get_oauth_providers_response.rb +213 -0
  51. data/lib/turnkey_client/models/get_organization_configs_request.rb +211 -0
  52. data/lib/turnkey_client/models/get_organization_configs_response.rb +210 -0
  53. data/lib/turnkey_client/models/get_sub_org_ids_request.rb +1 -1
  54. data/lib/turnkey_client/models/intent.rb +121 -9
  55. data/lib/turnkey_client/models/oauth_intent.rb +246 -0
  56. data/lib/turnkey_client/models/oauth_provider.rb +299 -0
  57. data/lib/turnkey_client/models/oauth_provider_params.rb +226 -0
  58. data/lib/turnkey_client/models/oauth_request.rb +288 -0
  59. data/lib/turnkey_client/models/oauth_result.rb +241 -0
  60. data/lib/turnkey_client/models/result.rb +103 -4
  61. data/lib/turnkey_client/models/root_user_params_v2.rb +272 -0
  62. data/lib/turnkey_client/models/root_user_params_v3.rb +272 -0
  63. data/lib/turnkey_client/models/sign_raw_payloads_intent.rb +256 -0
  64. data/lib/turnkey_client/models/sign_raw_payloads_request.rb +288 -0
  65. data/lib/turnkey_client/models/sign_raw_payloads_result.rb +207 -0
  66. data/lib/turnkey_client/models/status.rb +225 -0
  67. data/lib/turnkey_client/models/user.rb +18 -1
  68. data/lib/turnkey_client/models/wallet_account.rb +4 -19
  69. data/lib/turnkey_client/version.rb +1 -1
  70. data/lib/turnkey_client.rb +47 -0
  71. data/turnkey_client-0.0.4.gem +0 -0
  72. data/turnkey_client-0.0.7.gem +0 -0
  73. metadata +51 -2
@@ -0,0 +1,210 @@
1
+ =begin
2
+ #API Reference
3
+
4
+ #Review our [API Introduction](../api-introduction) to get started.
5
+
6
+ OpenAPI spec version: 1.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ =end
10
+
11
+ require 'date'
12
+
13
+ module TurnkeyClient
14
+ class GetOrganizationConfigsResponse
15
+ attr_accessor :configs
16
+
17
+ # Attribute mapping from ruby-style variable name to JSON key.
18
+ def self.attribute_map
19
+ {
20
+ :'configs' => :'configs'
21
+ }
22
+ end
23
+
24
+ # Attribute type mapping.
25
+ def self.openapi_types
26
+ {
27
+ :'configs' => :'Object'
28
+ }
29
+ end
30
+
31
+ # List of attributes with nullable: true
32
+ def self.openapi_nullable
33
+ Set.new([
34
+ ])
35
+ end
36
+
37
+ # Initializes the object
38
+ # @param [Hash] attributes Model attributes in the form of hash
39
+ def initialize(attributes = {})
40
+ if (!attributes.is_a?(Hash))
41
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::GetOrganizationConfigsResponse` initialize method"
42
+ end
43
+
44
+ # check to see if the attribute exists and convert string to symbol for hash key
45
+ attributes = attributes.each_with_object({}) { |(k, v), h|
46
+ if (!self.class.attribute_map.key?(k.to_sym))
47
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::GetOrganizationConfigsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
48
+ end
49
+ h[k.to_sym] = v
50
+ }
51
+
52
+ if attributes.key?(:'configs')
53
+ self.configs = attributes[:'configs']
54
+ end
55
+ end
56
+
57
+ # Show invalid properties with the reasons. Usually used together with valid?
58
+ # @return Array for valid properties with the reasons
59
+ def list_invalid_properties
60
+ invalid_properties = Array.new
61
+ if @configs.nil?
62
+ invalid_properties.push('invalid value for "configs", configs cannot be nil.')
63
+ end
64
+
65
+ invalid_properties
66
+ end
67
+
68
+ # Check to see if the all the properties in the model are valid
69
+ # @return true if the model is valid
70
+ def valid?
71
+ return false if @configs.nil?
72
+ true
73
+ end
74
+
75
+ # Checks equality by comparing each attribute.
76
+ # @param [Object] Object to be compared
77
+ def ==(o)
78
+ return true if self.equal?(o)
79
+ self.class == o.class &&
80
+ configs == o.configs
81
+ end
82
+
83
+ # @see the `==` method
84
+ # @param [Object] Object to be compared
85
+ def eql?(o)
86
+ self == o
87
+ end
88
+
89
+ # Calculates hash code according to all attributes.
90
+ # @return [Integer] Hash code
91
+ def hash
92
+ [configs].hash
93
+ end
94
+
95
+ # Builds the object from hash
96
+ # @param [Hash] attributes Model attributes in the form of hash
97
+ # @return [Object] Returns the model itself
98
+ def self.build_from_hash(attributes)
99
+ new.build_from_hash(attributes)
100
+ end
101
+
102
+ # Builds the object from hash
103
+ # @param [Hash] attributes Model attributes in the form of hash
104
+ # @return [Object] Returns the model itself
105
+ def build_from_hash(attributes)
106
+ return nil unless attributes.is_a?(Hash)
107
+ self.class.openapi_types.each_pair do |key, type|
108
+ if type =~ /\AArray<(.*)>/i
109
+ # check to ensure the input is an array given that the attribute
110
+ # is documented as an array but the input is not
111
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
112
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
113
+ end
114
+ elsif !attributes[self.class.attribute_map[key]].nil?
115
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
116
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
117
+ self.send("#{key}=", nil)
118
+ end
119
+ end
120
+
121
+ self
122
+ end
123
+
124
+ # Deserializes the data based on type
125
+ # @param string type Data type
126
+ # @param string value Value to be deserialized
127
+ # @return [Object] Deserialized data
128
+ def _deserialize(type, value)
129
+ case type.to_sym
130
+ when :DateTime
131
+ DateTime.parse(value)
132
+ when :Date
133
+ Date.parse(value)
134
+ when :String
135
+ value.to_s
136
+ when :Integer
137
+ value.to_i
138
+ when :Float
139
+ value.to_f
140
+ when :Boolean
141
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
142
+ true
143
+ else
144
+ false
145
+ end
146
+ when :Object
147
+ # generic object (usually a Hash), return directly
148
+ value
149
+ when /\AArray<(?<inner_type>.+)>\z/
150
+ inner_type = Regexp.last_match[:inner_type]
151
+ value.map { |v| _deserialize(inner_type, v) }
152
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
153
+ k_type = Regexp.last_match[:k_type]
154
+ v_type = Regexp.last_match[:v_type]
155
+ {}.tap do |hash|
156
+ value.each do |k, v|
157
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
158
+ end
159
+ end
160
+ else # model
161
+ TurnkeyClient.const_get(type).build_from_hash(value)
162
+ end
163
+ end
164
+
165
+ # Returns the string representation of the object
166
+ # @return [String] String presentation of the object
167
+ def to_s
168
+ to_hash.to_s
169
+ end
170
+
171
+ # to_body is an alias to to_hash (backward compatibility)
172
+ # @return [Hash] Returns the object in the form of hash
173
+ def to_body
174
+ to_hash
175
+ end
176
+
177
+ # Returns the object in the form of hash
178
+ # @return [Hash] Returns the object in the form of hash
179
+ def to_hash
180
+ hash = {}
181
+ self.class.attribute_map.each_pair do |attr, param|
182
+ value = self.send(attr)
183
+ if value.nil?
184
+ is_nullable = self.class.openapi_nullable.include?(attr)
185
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
186
+ end
187
+
188
+ hash[param] = _to_hash(value)
189
+ end
190
+ hash
191
+ end
192
+
193
+ # Outputs non-array value in the form of hash
194
+ # For object, use to_hash. Otherwise, just return the value
195
+ # @param [Object] value Any valid value
196
+ # @return [Hash] Returns the value in the form of hash
197
+ def _to_hash(value)
198
+ if value.is_a?(Array)
199
+ value.compact.map { |v| _to_hash(v) }
200
+ elsif value.is_a?(Hash)
201
+ {}.tap do |hash|
202
+ value.each { |k, v| hash[k] = _to_hash(v) }
203
+ end
204
+ elsif value.respond_to? :to_hash
205
+ value.to_hash
206
+ else
207
+ value
208
+ end
209
+ end end
210
+ end
@@ -15,7 +15,7 @@ module TurnkeyClient
15
15
  # Unique identifier for the parent Organization. This is used to find sub-organizations within it.
16
16
  attr_accessor :organization_id
17
17
 
18
- # Specifies the type of filter to apply, i.e 'CREDENTIAL_ID', 'NAME', 'USERNAME', 'EMAIL' or 'PUBLIC_KEY'
18
+ # Specifies the type of filter to apply, i.e 'CREDENTIAL_ID', 'NAME', 'USERNAME', 'EMAIL', 'OIDC_TOKEN' or 'PUBLIC_KEY'
19
19
  attr_accessor :filter_type
20
20
 
21
21
  # The value of the filter to apply for the specified type. For example, a specific email or name string.
@@ -134,6 +134,32 @@ module TurnkeyClient
134
134
 
135
135
  attr_accessor :import_private_key_intent
136
136
 
137
+ attr_accessor :create_policies_intent
138
+
139
+ attr_accessor :sign_raw_payloads_intent
140
+
141
+ attr_accessor :create_read_only_session_intent
142
+
143
+ attr_accessor :create_oauth_providers_intent
144
+
145
+ attr_accessor :delete_oauth_providers_intent
146
+
147
+ attr_accessor :create_sub_organization_intent_v5
148
+
149
+ attr_accessor :oauth_intent
150
+
151
+ attr_accessor :create_api_keys_intent_v2
152
+
153
+ attr_accessor :create_read_write_session_intent
154
+
155
+ attr_accessor :email_auth_intent_v2
156
+
157
+ attr_accessor :create_sub_organization_intent_v6
158
+
159
+ attr_accessor :delete_private_keys_intent
160
+
161
+ attr_accessor :delete_wallets_intent
162
+
137
163
  # Attribute mapping from ruby-style variable name to JSON key.
138
164
  def self.attribute_map
139
165
  {
@@ -197,7 +223,20 @@ module TurnkeyClient
197
223
  :'init_import_wallet_intent' => :'initImportWalletIntent',
198
224
  :'import_wallet_intent' => :'importWalletIntent',
199
225
  :'init_import_private_key_intent' => :'initImportPrivateKeyIntent',
200
- :'import_private_key_intent' => :'importPrivateKeyIntent'
226
+ :'import_private_key_intent' => :'importPrivateKeyIntent',
227
+ :'create_policies_intent' => :'createPoliciesIntent',
228
+ :'sign_raw_payloads_intent' => :'signRawPayloadsIntent',
229
+ :'create_read_only_session_intent' => :'createReadOnlySessionIntent',
230
+ :'create_oauth_providers_intent' => :'createOauthProvidersIntent',
231
+ :'delete_oauth_providers_intent' => :'deleteOauthProvidersIntent',
232
+ :'create_sub_organization_intent_v5' => :'createSubOrganizationIntentV5',
233
+ :'oauth_intent' => :'oauthIntent',
234
+ :'create_api_keys_intent_v2' => :'createApiKeysIntentV2',
235
+ :'create_read_write_session_intent' => :'createReadWriteSessionIntent',
236
+ :'email_auth_intent_v2' => :'emailAuthIntentV2',
237
+ :'create_sub_organization_intent_v6' => :'createSubOrganizationIntentV6',
238
+ :'delete_private_keys_intent' => :'deletePrivateKeysIntent',
239
+ :'delete_wallets_intent' => :'deleteWalletsIntent'
201
240
  }
202
241
  end
203
242
 
@@ -264,7 +303,20 @@ module TurnkeyClient
264
303
  :'init_import_wallet_intent' => :'Object',
265
304
  :'import_wallet_intent' => :'Object',
266
305
  :'init_import_private_key_intent' => :'Object',
267
- :'import_private_key_intent' => :'Object'
306
+ :'import_private_key_intent' => :'Object',
307
+ :'create_policies_intent' => :'Object',
308
+ :'sign_raw_payloads_intent' => :'Object',
309
+ :'create_read_only_session_intent' => :'Object',
310
+ :'create_oauth_providers_intent' => :'Object',
311
+ :'delete_oauth_providers_intent' => :'Object',
312
+ :'create_sub_organization_intent_v5' => :'Object',
313
+ :'oauth_intent' => :'Object',
314
+ :'create_api_keys_intent_v2' => :'Object',
315
+ :'create_read_write_session_intent' => :'Object',
316
+ :'email_auth_intent_v2' => :'Object',
317
+ :'create_sub_organization_intent_v6' => :'Object',
318
+ :'delete_private_keys_intent' => :'Object',
319
+ :'delete_wallets_intent' => :'Object'
268
320
  }
269
321
  end
270
322
 
@@ -532,23 +584,70 @@ module TurnkeyClient
532
584
  if attributes.key?(:'import_private_key_intent')
533
585
  self.import_private_key_intent = attributes[:'import_private_key_intent']
534
586
  end
587
+
588
+ if attributes.key?(:'create_policies_intent')
589
+ self.create_policies_intent = attributes[:'create_policies_intent']
590
+ end
591
+
592
+ if attributes.key?(:'sign_raw_payloads_intent')
593
+ self.sign_raw_payloads_intent = attributes[:'sign_raw_payloads_intent']
594
+ end
595
+
596
+ if attributes.key?(:'create_read_only_session_intent')
597
+ self.create_read_only_session_intent = attributes[:'create_read_only_session_intent']
598
+ end
599
+
600
+ if attributes.key?(:'create_oauth_providers_intent')
601
+ self.create_oauth_providers_intent = attributes[:'create_oauth_providers_intent']
602
+ end
603
+
604
+ if attributes.key?(:'delete_oauth_providers_intent')
605
+ self.delete_oauth_providers_intent = attributes[:'delete_oauth_providers_intent']
606
+ end
607
+
608
+ if attributes.key?(:'create_sub_organization_intent_v5')
609
+ self.create_sub_organization_intent_v5 = attributes[:'create_sub_organization_intent_v5']
610
+ end
611
+
612
+ if attributes.key?(:'oauth_intent')
613
+ self.oauth_intent = attributes[:'oauth_intent']
614
+ end
615
+
616
+ if attributes.key?(:'create_api_keys_intent_v2')
617
+ self.create_api_keys_intent_v2 = attributes[:'create_api_keys_intent_v2']
618
+ end
619
+
620
+ if attributes.key?(:'create_read_write_session_intent')
621
+ self.create_read_write_session_intent = attributes[:'create_read_write_session_intent']
622
+ end
623
+
624
+ if attributes.key?(:'email_auth_intent_v2')
625
+ self.email_auth_intent_v2 = attributes[:'email_auth_intent_v2']
626
+ end
627
+
628
+ if attributes.key?(:'create_sub_organization_intent_v6')
629
+ self.create_sub_organization_intent_v6 = attributes[:'create_sub_organization_intent_v6']
630
+ end
631
+
632
+ if attributes.key?(:'delete_private_keys_intent')
633
+ self.delete_private_keys_intent = attributes[:'delete_private_keys_intent']
634
+ end
635
+
636
+ if attributes.key?(:'delete_wallets_intent')
637
+ self.delete_wallets_intent = attributes[:'delete_wallets_intent']
638
+ end
535
639
  end
536
640
 
537
641
  # Show invalid properties with the reasons. Usually used together with valid?
538
642
  # @return Array for valid properties with the reasons
539
643
  def list_invalid_properties
540
644
  invalid_properties = Array.new
541
- if @create_organization_intent.nil?
542
- invalid_properties.push('invalid value for "create_organization_intent", create_organization_intent cannot be nil.')
543
- end
544
-
545
645
  invalid_properties
546
646
  end
547
647
 
548
648
  # Check to see if the all the properties in the model are valid
549
649
  # @return true if the model is valid
550
650
  def valid?
551
- return false if @create_organization_intent.nil?
552
651
  true
553
652
  end
554
653
 
@@ -617,7 +716,20 @@ module TurnkeyClient
617
716
  init_import_wallet_intent == o.init_import_wallet_intent &&
618
717
  import_wallet_intent == o.import_wallet_intent &&
619
718
  init_import_private_key_intent == o.init_import_private_key_intent &&
620
- import_private_key_intent == o.import_private_key_intent
719
+ import_private_key_intent == o.import_private_key_intent &&
720
+ create_policies_intent == o.create_policies_intent &&
721
+ sign_raw_payloads_intent == o.sign_raw_payloads_intent &&
722
+ create_read_only_session_intent == o.create_read_only_session_intent &&
723
+ create_oauth_providers_intent == o.create_oauth_providers_intent &&
724
+ delete_oauth_providers_intent == o.delete_oauth_providers_intent &&
725
+ create_sub_organization_intent_v5 == o.create_sub_organization_intent_v5 &&
726
+ oauth_intent == o.oauth_intent &&
727
+ create_api_keys_intent_v2 == o.create_api_keys_intent_v2 &&
728
+ create_read_write_session_intent == o.create_read_write_session_intent &&
729
+ email_auth_intent_v2 == o.email_auth_intent_v2 &&
730
+ create_sub_organization_intent_v6 == o.create_sub_organization_intent_v6 &&
731
+ delete_private_keys_intent == o.delete_private_keys_intent &&
732
+ delete_wallets_intent == o.delete_wallets_intent
621
733
  end
622
734
 
623
735
  # @see the `==` method
@@ -629,7 +741,7 @@ module TurnkeyClient
629
741
  # Calculates hash code according to all attributes.
630
742
  # @return [Integer] Hash code
631
743
  def hash
632
- [create_organization_intent, create_authenticators_intent, create_users_intent, create_private_keys_intent, sign_raw_payload_intent, create_invitations_intent, accept_invitation_intent, create_policy_intent, disable_private_key_intent, delete_users_intent, delete_authenticators_intent, delete_invitation_intent, delete_organization_intent, delete_policy_intent, create_user_tag_intent, delete_user_tags_intent, sign_transaction_intent, create_api_keys_intent, delete_api_keys_intent, approve_activity_intent, reject_activity_intent, create_private_key_tag_intent, delete_private_key_tags_intent, create_policy_intent_v2, set_payment_method_intent, activate_billing_tier_intent, delete_payment_method_intent, create_policy_intent_v3, create_api_only_users_intent, update_root_quorum_intent, update_user_tag_intent, update_private_key_tag_intent, create_authenticators_intent_v2, accept_invitation_intent_v2, create_organization_intent_v2, create_users_intent_v2, create_sub_organization_intent, create_sub_organization_intent_v2, update_allowed_origins_intent, create_private_keys_intent_v2, update_user_intent, update_policy_intent, set_payment_method_intent_v2, create_sub_organization_intent_v3, create_wallet_intent, create_wallet_accounts_intent, init_user_email_recovery_intent, recover_user_intent, set_organization_feature_intent, remove_organization_feature_intent, sign_raw_payload_intent_v2, sign_transaction_intent_v2, export_private_key_intent, export_wallet_intent, create_sub_organization_intent_v4, email_auth_intent, export_wallet_account_intent, init_import_wallet_intent, import_wallet_intent, init_import_private_key_intent, import_private_key_intent].hash
744
+ [create_organization_intent, create_authenticators_intent, create_users_intent, create_private_keys_intent, sign_raw_payload_intent, create_invitations_intent, accept_invitation_intent, create_policy_intent, disable_private_key_intent, delete_users_intent, delete_authenticators_intent, delete_invitation_intent, delete_organization_intent, delete_policy_intent, create_user_tag_intent, delete_user_tags_intent, sign_transaction_intent, create_api_keys_intent, delete_api_keys_intent, approve_activity_intent, reject_activity_intent, create_private_key_tag_intent, delete_private_key_tags_intent, create_policy_intent_v2, set_payment_method_intent, activate_billing_tier_intent, delete_payment_method_intent, create_policy_intent_v3, create_api_only_users_intent, update_root_quorum_intent, update_user_tag_intent, update_private_key_tag_intent, create_authenticators_intent_v2, accept_invitation_intent_v2, create_organization_intent_v2, create_users_intent_v2, create_sub_organization_intent, create_sub_organization_intent_v2, update_allowed_origins_intent, create_private_keys_intent_v2, update_user_intent, update_policy_intent, set_payment_method_intent_v2, create_sub_organization_intent_v3, create_wallet_intent, create_wallet_accounts_intent, init_user_email_recovery_intent, recover_user_intent, set_organization_feature_intent, remove_organization_feature_intent, sign_raw_payload_intent_v2, sign_transaction_intent_v2, export_private_key_intent, export_wallet_intent, create_sub_organization_intent_v4, email_auth_intent, export_wallet_account_intent, init_import_wallet_intent, import_wallet_intent, init_import_private_key_intent, import_private_key_intent, create_policies_intent, sign_raw_payloads_intent, create_read_only_session_intent, create_oauth_providers_intent, delete_oauth_providers_intent, create_sub_organization_intent_v5, oauth_intent, create_api_keys_intent_v2, create_read_write_session_intent, email_auth_intent_v2, create_sub_organization_intent_v6, delete_private_keys_intent, delete_wallets_intent].hash
633
745
  end
634
746
 
635
747
  # Builds the object from hash
@@ -0,0 +1,246 @@
1
+ =begin
2
+ #API Reference
3
+
4
+ #Review our [API Introduction](../api-introduction) to get started.
5
+
6
+ OpenAPI spec version: 1.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ =end
10
+
11
+ require 'date'
12
+
13
+ module TurnkeyClient
14
+ class OauthIntent
15
+ # Base64 encoded OIDC token
16
+ attr_accessor :oidc_token
17
+
18
+ # Client-side public key generated by the user, to which the oauth bundle (credentials) will be encrypted.
19
+ attr_accessor :target_public_key
20
+
21
+ # Optional human-readable name for an API Key. If none provided, default to Oauth - <Timestamp>
22
+ attr_accessor :api_key_name
23
+
24
+ # Expiration window (in seconds) indicating how long the API key is valid. If not provided, a default of 15 minutes will be used.
25
+ attr_accessor :expiration_seconds
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'oidc_token' => :'oidcToken',
31
+ :'target_public_key' => :'targetPublicKey',
32
+ :'api_key_name' => :'apiKeyName',
33
+ :'expiration_seconds' => :'expirationSeconds'
34
+ }
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'oidc_token' => :'Object',
41
+ :'target_public_key' => :'Object',
42
+ :'api_key_name' => :'Object',
43
+ :'expiration_seconds' => :'Object'
44
+ }
45
+ end
46
+
47
+ # List of attributes with nullable: true
48
+ def self.openapi_nullable
49
+ Set.new([
50
+ ])
51
+ end
52
+
53
+ # Initializes the object
54
+ # @param [Hash] attributes Model attributes in the form of hash
55
+ def initialize(attributes = {})
56
+ if (!attributes.is_a?(Hash))
57
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::OauthIntent` initialize method"
58
+ end
59
+
60
+ # check to see if the attribute exists and convert string to symbol for hash key
61
+ attributes = attributes.each_with_object({}) { |(k, v), h|
62
+ if (!self.class.attribute_map.key?(k.to_sym))
63
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::OauthIntent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
64
+ end
65
+ h[k.to_sym] = v
66
+ }
67
+
68
+ if attributes.key?(:'oidc_token')
69
+ self.oidc_token = attributes[:'oidc_token']
70
+ end
71
+
72
+ if attributes.key?(:'target_public_key')
73
+ self.target_public_key = attributes[:'target_public_key']
74
+ end
75
+
76
+ if attributes.key?(:'api_key_name')
77
+ self.api_key_name = attributes[:'api_key_name']
78
+ end
79
+
80
+ if attributes.key?(:'expiration_seconds')
81
+ self.expiration_seconds = attributes[:'expiration_seconds']
82
+ end
83
+ end
84
+
85
+ # Show invalid properties with the reasons. Usually used together with valid?
86
+ # @return Array for valid properties with the reasons
87
+ def list_invalid_properties
88
+ invalid_properties = Array.new
89
+ if @oidc_token.nil?
90
+ invalid_properties.push('invalid value for "oidc_token", oidc_token cannot be nil.')
91
+ end
92
+
93
+ if @target_public_key.nil?
94
+ invalid_properties.push('invalid value for "target_public_key", target_public_key cannot be nil.')
95
+ end
96
+
97
+ invalid_properties
98
+ end
99
+
100
+ # Check to see if the all the properties in the model are valid
101
+ # @return true if the model is valid
102
+ def valid?
103
+ return false if @oidc_token.nil?
104
+ return false if @target_public_key.nil?
105
+ true
106
+ end
107
+
108
+ # Checks equality by comparing each attribute.
109
+ # @param [Object] Object to be compared
110
+ def ==(o)
111
+ return true if self.equal?(o)
112
+ self.class == o.class &&
113
+ oidc_token == o.oidc_token &&
114
+ target_public_key == o.target_public_key &&
115
+ api_key_name == o.api_key_name &&
116
+ expiration_seconds == o.expiration_seconds
117
+ end
118
+
119
+ # @see the `==` method
120
+ # @param [Object] Object to be compared
121
+ def eql?(o)
122
+ self == o
123
+ end
124
+
125
+ # Calculates hash code according to all attributes.
126
+ # @return [Integer] Hash code
127
+ def hash
128
+ [oidc_token, target_public_key, api_key_name, expiration_seconds].hash
129
+ end
130
+
131
+ # Builds the object from hash
132
+ # @param [Hash] attributes Model attributes in the form of hash
133
+ # @return [Object] Returns the model itself
134
+ def self.build_from_hash(attributes)
135
+ new.build_from_hash(attributes)
136
+ end
137
+
138
+ # Builds the object from hash
139
+ # @param [Hash] attributes Model attributes in the form of hash
140
+ # @return [Object] Returns the model itself
141
+ def build_from_hash(attributes)
142
+ return nil unless attributes.is_a?(Hash)
143
+ self.class.openapi_types.each_pair do |key, type|
144
+ if type =~ /\AArray<(.*)>/i
145
+ # check to ensure the input is an array given that the attribute
146
+ # is documented as an array but the input is not
147
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
148
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
149
+ end
150
+ elsif !attributes[self.class.attribute_map[key]].nil?
151
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
152
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
153
+ self.send("#{key}=", nil)
154
+ end
155
+ end
156
+
157
+ self
158
+ end
159
+
160
+ # Deserializes the data based on type
161
+ # @param string type Data type
162
+ # @param string value Value to be deserialized
163
+ # @return [Object] Deserialized data
164
+ def _deserialize(type, value)
165
+ case type.to_sym
166
+ when :DateTime
167
+ DateTime.parse(value)
168
+ when :Date
169
+ Date.parse(value)
170
+ when :String
171
+ value.to_s
172
+ when :Integer
173
+ value.to_i
174
+ when :Float
175
+ value.to_f
176
+ when :Boolean
177
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
178
+ true
179
+ else
180
+ false
181
+ end
182
+ when :Object
183
+ # generic object (usually a Hash), return directly
184
+ value
185
+ when /\AArray<(?<inner_type>.+)>\z/
186
+ inner_type = Regexp.last_match[:inner_type]
187
+ value.map { |v| _deserialize(inner_type, v) }
188
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
189
+ k_type = Regexp.last_match[:k_type]
190
+ v_type = Regexp.last_match[:v_type]
191
+ {}.tap do |hash|
192
+ value.each do |k, v|
193
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
194
+ end
195
+ end
196
+ else # model
197
+ TurnkeyClient.const_get(type).build_from_hash(value)
198
+ end
199
+ end
200
+
201
+ # Returns the string representation of the object
202
+ # @return [String] String presentation of the object
203
+ def to_s
204
+ to_hash.to_s
205
+ end
206
+
207
+ # to_body is an alias to to_hash (backward compatibility)
208
+ # @return [Hash] Returns the object in the form of hash
209
+ def to_body
210
+ to_hash
211
+ end
212
+
213
+ # Returns the object in the form of hash
214
+ # @return [Hash] Returns the object in the form of hash
215
+ def to_hash
216
+ hash = {}
217
+ self.class.attribute_map.each_pair do |attr, param|
218
+ value = self.send(attr)
219
+ if value.nil?
220
+ is_nullable = self.class.openapi_nullable.include?(attr)
221
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
222
+ end
223
+
224
+ hash[param] = _to_hash(value)
225
+ end
226
+ hash
227
+ end
228
+
229
+ # Outputs non-array value in the form of hash
230
+ # For object, use to_hash. Otherwise, just return the value
231
+ # @param [Object] value Any valid value
232
+ # @return [Hash] Returns the value in the form of hash
233
+ def _to_hash(value)
234
+ if value.is_a?(Array)
235
+ value.compact.map { |v| _to_hash(v) }
236
+ elsif value.is_a?(Hash)
237
+ {}.tap do |hash|
238
+ value.each { |k, v| hash[k] = _to_hash(v) }
239
+ end
240
+ elsif value.respond_to? :to_hash
241
+ value.to_hash
242
+ else
243
+ value
244
+ end
245
+ end end
246
+ end