turnkey_client 0.0.13 → 0.0.14
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.
- checksums.yaml +4 -4
- data/lib/turnkey_client/api/activities_api.rb +66 -8
- data/lib/turnkey_client/api/api_keys_api.rb +14 -14
- data/lib/turnkey_client/api/authenticators_api.rb +16 -16
- data/lib/turnkey_client/api/consensus_api.rb +8 -8
- data/lib/turnkey_client/api/features_api.rb +8 -8
- data/lib/turnkey_client/api/invitations_api.rb +8 -8
- data/lib/turnkey_client/api/on_ramp_api.rb +77 -0
- data/lib/turnkey_client/api/organizations_api.rb +18 -18
- data/lib/turnkey_client/api/policies_api.rb +256 -24
- data/lib/turnkey_client/api/private_key_tags_api.rb +12 -12
- data/lib/turnkey_client/api/private_keys_api.rb +28 -28
- data/lib/turnkey_client/api/sessions_api.rb +184 -10
- data/lib/turnkey_client/api/signing_api.rb +12 -12
- data/lib/turnkey_client/api/user_auth_api.rb +20 -20
- data/lib/turnkey_client/api/user_recovery_api.rb +6 -6
- data/lib/turnkey_client/api/user_tags_api.rb +12 -12
- data/lib/turnkey_client/api/user_verification_api.rb +135 -0
- data/lib/turnkey_client/api/users_api.rb +194 -20
- data/lib/turnkey_client/api/wallets_api.rb +48 -48
- data/lib/turnkey_client/models/activity_type.rb +14 -0
- data/lib/turnkey_client/models/activity_v1_policy_evaluation.rb +287 -0
- data/lib/turnkey_client/models/address_format.rb +1 -0
- data/lib/turnkey_client/models/api_key.rb +1 -0
- data/lib/turnkey_client/models/api_key_params.rb +1 -0
- data/lib/turnkey_client/models/api_key_params_v2.rb +1 -0
- data/lib/turnkey_client/models/api_only_user_params.rb +3 -2
- data/lib/turnkey_client/models/create_organization_intent.rb +1 -0
- data/lib/turnkey_client/models/create_organization_intent_v2.rb +1 -0
- data/lib/turnkey_client/models/create_policy_intent_v3.rb +2 -0
- data/lib/turnkey_client/models/create_read_write_session_intent.rb +3 -1
- data/lib/turnkey_client/models/create_read_write_session_intent_v2.rb +19 -5
- data/lib/turnkey_client/models/create_smart_contract_interface_intent.rb +265 -0
- data/lib/turnkey_client/models/create_smart_contract_interface_request.rb +288 -0
- data/lib/turnkey_client/models/create_smart_contract_interface_result.rb +211 -0
- data/lib/turnkey_client/models/create_sub_organization_intent_v4.rb +2 -0
- data/lib/turnkey_client/models/create_sub_organization_intent_v5.rb +2 -0
- data/lib/turnkey_client/models/create_sub_organization_intent_v6.rb +2 -0
- data/lib/turnkey_client/models/create_sub_organization_intent_v7.rb +4 -0
- data/lib/turnkey_client/models/create_users_intent_v3.rb +213 -0
- data/lib/turnkey_client/models/create_users_request.rb +2 -2
- data/lib/turnkey_client/models/create_wallet_intent.rb +2 -1
- data/lib/turnkey_client/models/credential_type.rb +3 -0
- data/lib/turnkey_client/models/data_v1_smart_contract_interface.rb +329 -0
- data/lib/turnkey_client/models/delete_payment_method_intent.rb +1 -0
- data/lib/turnkey_client/models/delete_private_keys_intent.rb +1 -0
- data/lib/turnkey_client/models/delete_smart_contract_interface_intent.rb +211 -0
- data/lib/turnkey_client/models/delete_smart_contract_interface_request.rb +288 -0
- data/lib/turnkey_client/models/delete_smart_contract_interface_result.rb +211 -0
- data/lib/turnkey_client/models/delete_sub_organization_intent.rb +1 -0
- data/lib/turnkey_client/models/delete_wallets_intent.rb +1 -0
- data/lib/turnkey_client/models/email_auth_intent.rb +31 -5
- data/lib/turnkey_client/models/email_auth_intent_v2.rb +31 -5
- data/lib/turnkey_client/models/email_customization_params.rb +5 -0
- data/lib/turnkey_client/models/feature.rb +1 -0
- data/lib/turnkey_client/models/fiat_on_ramp_blockchain_network.rb +29 -0
- data/lib/turnkey_client/models/fiat_on_ramp_crypto_currency.rb +29 -0
- data/lib/turnkey_client/models/fiat_on_ramp_currency.rb +59 -0
- data/lib/turnkey_client/models/fiat_on_ramp_payment_method.rb +38 -0
- data/lib/turnkey_client/models/fiat_on_ramp_provider.rb +27 -0
- data/lib/turnkey_client/models/get_activities_request.rb +3 -3
- data/lib/turnkey_client/models/get_activities_response.rb +1 -1
- data/lib/turnkey_client/models/get_activity_request.rb +2 -2
- data/lib/turnkey_client/models/get_api_key_request.rb +1 -1
- data/lib/turnkey_client/models/get_api_keys_request.rb +3 -2
- data/lib/turnkey_client/models/get_authenticator_request.rb +2 -2
- data/lib/turnkey_client/models/get_authenticators_request.rb +2 -2
- data/lib/turnkey_client/models/get_oauth_providers_request.rb +3 -2
- data/lib/turnkey_client/models/get_oauth_providers_response.rb +1 -1
- data/lib/turnkey_client/models/get_organization_configs_request.rb +1 -1
- data/lib/turnkey_client/models/get_policies_request.rb +1 -1
- data/lib/turnkey_client/models/get_policies_response.rb +1 -1
- data/lib/turnkey_client/models/get_policy_evaluations_request.rb +226 -0
- data/lib/turnkey_client/models/get_policy_evaluations_response.rb +212 -0
- data/lib/turnkey_client/models/get_policy_request.rb +2 -2
- data/lib/turnkey_client/models/get_private_key_request.rb +2 -2
- data/lib/turnkey_client/models/get_private_keys_request.rb +1 -1
- data/lib/turnkey_client/models/get_private_keys_response.rb +1 -1
- data/lib/turnkey_client/models/get_smart_contract_interface_request.rb +226 -0
- data/lib/turnkey_client/models/get_smart_contract_interface_response.rb +210 -0
- data/lib/turnkey_client/models/get_smart_contract_interfaces_request.rb +211 -0
- data/lib/turnkey_client/models/get_smart_contract_interfaces_response.rb +213 -0
- data/lib/turnkey_client/models/get_sub_org_ids_request.rb +2 -2
- data/lib/turnkey_client/models/get_user_request.rb +2 -2
- data/lib/turnkey_client/models/get_users_request.rb +1 -1
- data/lib/turnkey_client/models/get_users_response.rb +1 -1
- data/lib/turnkey_client/models/get_verified_sub_org_ids_request.rb +2 -2
- data/lib/turnkey_client/models/get_wallet_account_request.rb +6 -4
- data/lib/turnkey_client/models/get_wallet_accounts_request.rb +3 -7
- data/lib/turnkey_client/models/get_wallet_accounts_response.rb +1 -1
- data/lib/turnkey_client/models/get_wallet_request.rb +2 -2
- data/lib/turnkey_client/models/get_wallets_request.rb +1 -1
- data/lib/turnkey_client/models/get_wallets_response.rb +1 -1
- data/lib/turnkey_client/models/get_whoami_request.rb +1 -1
- data/lib/turnkey_client/models/get_whoami_response.rb +4 -4
- data/lib/turnkey_client/models/init_fiat_on_ramp_intent.rb +315 -0
- data/lib/turnkey_client/models/init_fiat_on_ramp_request.rb +288 -0
- data/lib/turnkey_client/models/init_fiat_on_ramp_result.rb +226 -0
- data/lib/turnkey_client/models/init_otp_auth_intent.rb +28 -4
- data/lib/turnkey_client/models/init_otp_auth_intent_v2.rb +310 -0
- data/lib/turnkey_client/models/init_otp_auth_request.rb +2 -2
- data/lib/turnkey_client/models/init_otp_auth_result_v2.rb +211 -0
- data/lib/turnkey_client/models/init_otp_intent.rb +321 -0
- data/lib/turnkey_client/models/init_otp_request.rb +288 -0
- data/lib/turnkey_client/models/init_otp_result.rb +211 -0
- data/lib/turnkey_client/models/init_user_email_recovery_intent.rb +2 -1
- data/lib/turnkey_client/models/intent.rb +130 -4
- data/lib/turnkey_client/models/invitation_params.rb +1 -1
- data/lib/turnkey_client/models/list_private_key_tags_request.rb +1 -1
- data/lib/turnkey_client/models/list_private_key_tags_response.rb +1 -1
- data/lib/turnkey_client/models/list_user_tags_request.rb +1 -1
- data/lib/turnkey_client/models/list_user_tags_response.rb +1 -1
- data/lib/turnkey_client/models/oauth_intent.rb +18 -5
- data/lib/turnkey_client/models/oauth_login_intent.rb +248 -0
- data/lib/turnkey_client/models/oauth_login_request.rb +288 -0
- data/lib/turnkey_client/models/oauth_login_result.rb +211 -0
- data/lib/turnkey_client/models/otp_auth_intent.rb +10 -2
- data/lib/turnkey_client/models/otp_login_intent.rb +248 -0
- data/lib/turnkey_client/models/otp_login_request.rb +288 -0
- data/lib/turnkey_client/models/otp_login_result.rb +211 -0
- data/lib/turnkey_client/models/outcome.rb +31 -0
- data/lib/turnkey_client/models/payload_encoding.rb +1 -0
- data/lib/turnkey_client/models/policy.rb +2 -0
- data/lib/turnkey_client/models/private_key_params.rb +1 -1
- data/lib/turnkey_client/models/result.rb +121 -4
- data/lib/turnkey_client/models/root_user_params.rb +3 -2
- data/lib/turnkey_client/models/root_user_params_v2.rb +4 -3
- data/lib/turnkey_client/models/root_user_params_v3.rb +4 -3
- data/lib/turnkey_client/models/root_user_params_v4.rb +5 -3
- data/lib/turnkey_client/models/set_organization_feature_intent.rb +1 -0
- data/lib/turnkey_client/models/simple_client_extension_results.rb +2 -0
- data/lib/turnkey_client/models/smart_contract_interface_type.rb +27 -0
- data/lib/turnkey_client/models/sms_customization_params.rb +1 -0
- data/lib/turnkey_client/models/stamp_login_intent.rb +233 -0
- data/lib/turnkey_client/models/stamp_login_request.rb +288 -0
- data/lib/turnkey_client/models/stamp_login_result.rb +211 -0
- data/lib/turnkey_client/models/transaction_type.rb +1 -0
- data/lib/turnkey_client/models/ump_v1_policy_evaluation.rb +214 -0
- data/lib/turnkey_client/models/update_policy_intent.rb +4 -0
- data/lib/turnkey_client/models/update_policy_intent_v2.rb +264 -0
- data/lib/turnkey_client/models/update_policy_request.rb +2 -2
- data/lib/turnkey_client/models/update_policy_result_v2.rb +211 -0
- data/lib/turnkey_client/models/update_private_key_tag_intent.rb +1 -0
- data/lib/turnkey_client/models/update_user_email_intent.rb +237 -0
- data/lib/turnkey_client/models/update_user_email_request.rb +288 -0
- data/lib/turnkey_client/models/update_user_email_result.rb +211 -0
- data/lib/turnkey_client/models/update_user_intent.rb +4 -1
- data/lib/turnkey_client/models/update_user_name_intent.rb +226 -0
- data/lib/turnkey_client/models/update_user_name_request.rb +288 -0
- data/lib/turnkey_client/models/update_user_name_result.rb +211 -0
- data/lib/turnkey_client/models/update_user_phone_number_intent.rb +237 -0
- data/lib/turnkey_client/models/update_user_phone_number_request.rb +288 -0
- data/lib/turnkey_client/models/update_user_phone_number_result.rb +211 -0
- data/lib/turnkey_client/models/update_user_tag_intent.rb +1 -0
- data/lib/turnkey_client/models/user.rb +3 -1
- data/lib/turnkey_client/models/user_params.rb +4 -3
- data/lib/turnkey_client/models/user_params_v2.rb +4 -3
- data/lib/turnkey_client/models/user_params_v3.rb +301 -0
- data/lib/turnkey_client/models/verify_otp_intent.rb +237 -0
- data/lib/turnkey_client/models/verify_otp_request.rb +288 -0
- data/lib/turnkey_client/models/verify_otp_result.rb +211 -0
- data/lib/turnkey_client/models/wallet_account.rb +15 -4
- data/lib/turnkey_client/models/wallet_params.rb +2 -1
- data/lib/turnkey_client/version.rb +1 -1
- data/lib/turnkey_client.rb +57 -0
- data/turnkey_client-0.0.13.gem +0 -0
- metadata +60 -2
@@ -0,0 +1,226 @@
|
|
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 InitFiatOnRampResult
|
15
|
+
# Unique URL for a given fiat on-ramp flow.
|
16
|
+
attr_accessor :on_ramp_url
|
17
|
+
|
18
|
+
# Unique identifier used to retrieve transaction statuses for a given fiat on-ramp flow.
|
19
|
+
attr_accessor :on_ramp_transaction_id
|
20
|
+
|
21
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
22
|
+
def self.attribute_map
|
23
|
+
{
|
24
|
+
:'on_ramp_url' => :'onRampUrl',
|
25
|
+
:'on_ramp_transaction_id' => :'onRampTransactionId'
|
26
|
+
}
|
27
|
+
end
|
28
|
+
|
29
|
+
# Attribute type mapping.
|
30
|
+
def self.openapi_types
|
31
|
+
{
|
32
|
+
:'on_ramp_url' => :'Object',
|
33
|
+
:'on_ramp_transaction_id' => :'Object'
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
37
|
+
# List of attributes with nullable: true
|
38
|
+
def self.openapi_nullable
|
39
|
+
Set.new([
|
40
|
+
])
|
41
|
+
end
|
42
|
+
|
43
|
+
# Initializes the object
|
44
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
45
|
+
def initialize(attributes = {})
|
46
|
+
if (!attributes.is_a?(Hash))
|
47
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::InitFiatOnRampResult` initialize method"
|
48
|
+
end
|
49
|
+
|
50
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
51
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
52
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
53
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::InitFiatOnRampResult`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
54
|
+
end
|
55
|
+
h[k.to_sym] = v
|
56
|
+
}
|
57
|
+
|
58
|
+
if attributes.key?(:'on_ramp_url')
|
59
|
+
self.on_ramp_url = attributes[:'on_ramp_url']
|
60
|
+
end
|
61
|
+
|
62
|
+
if attributes.key?(:'on_ramp_transaction_id')
|
63
|
+
self.on_ramp_transaction_id = attributes[:'on_ramp_transaction_id']
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
68
|
+
# @return Array for valid properties with the reasons
|
69
|
+
def list_invalid_properties
|
70
|
+
invalid_properties = Array.new
|
71
|
+
if @on_ramp_url.nil?
|
72
|
+
invalid_properties.push('invalid value for "on_ramp_url", on_ramp_url cannot be nil.')
|
73
|
+
end
|
74
|
+
|
75
|
+
if @on_ramp_transaction_id.nil?
|
76
|
+
invalid_properties.push('invalid value for "on_ramp_transaction_id", on_ramp_transaction_id cannot be nil.')
|
77
|
+
end
|
78
|
+
|
79
|
+
invalid_properties
|
80
|
+
end
|
81
|
+
|
82
|
+
# Check to see if the all the properties in the model are valid
|
83
|
+
# @return true if the model is valid
|
84
|
+
def valid?
|
85
|
+
return false if @on_ramp_url.nil?
|
86
|
+
return false if @on_ramp_transaction_id.nil?
|
87
|
+
true
|
88
|
+
end
|
89
|
+
|
90
|
+
# Checks equality by comparing each attribute.
|
91
|
+
# @param [Object] Object to be compared
|
92
|
+
def ==(o)
|
93
|
+
return true if self.equal?(o)
|
94
|
+
self.class == o.class &&
|
95
|
+
on_ramp_url == o.on_ramp_url &&
|
96
|
+
on_ramp_transaction_id == o.on_ramp_transaction_id
|
97
|
+
end
|
98
|
+
|
99
|
+
# @see the `==` method
|
100
|
+
# @param [Object] Object to be compared
|
101
|
+
def eql?(o)
|
102
|
+
self == o
|
103
|
+
end
|
104
|
+
|
105
|
+
# Calculates hash code according to all attributes.
|
106
|
+
# @return [Integer] Hash code
|
107
|
+
def hash
|
108
|
+
[on_ramp_url, on_ramp_transaction_id].hash
|
109
|
+
end
|
110
|
+
|
111
|
+
# Builds the object from hash
|
112
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
113
|
+
# @return [Object] Returns the model itself
|
114
|
+
def self.build_from_hash(attributes)
|
115
|
+
new.build_from_hash(attributes)
|
116
|
+
end
|
117
|
+
|
118
|
+
# Builds the object from hash
|
119
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
120
|
+
# @return [Object] Returns the model itself
|
121
|
+
def build_from_hash(attributes)
|
122
|
+
return nil unless attributes.is_a?(Hash)
|
123
|
+
self.class.openapi_types.each_pair do |key, type|
|
124
|
+
if type =~ /\AArray<(.*)>/i
|
125
|
+
# check to ensure the input is an array given that the attribute
|
126
|
+
# is documented as an array but the input is not
|
127
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
128
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
129
|
+
end
|
130
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
131
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
132
|
+
elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
133
|
+
self.send("#{key}=", nil)
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
self
|
138
|
+
end
|
139
|
+
|
140
|
+
# Deserializes the data based on type
|
141
|
+
# @param string type Data type
|
142
|
+
# @param string value Value to be deserialized
|
143
|
+
# @return [Object] Deserialized data
|
144
|
+
def _deserialize(type, value)
|
145
|
+
case type.to_sym
|
146
|
+
when :DateTime
|
147
|
+
DateTime.parse(value)
|
148
|
+
when :Date
|
149
|
+
Date.parse(value)
|
150
|
+
when :String
|
151
|
+
value.to_s
|
152
|
+
when :Integer
|
153
|
+
value.to_i
|
154
|
+
when :Float
|
155
|
+
value.to_f
|
156
|
+
when :Boolean
|
157
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
158
|
+
true
|
159
|
+
else
|
160
|
+
false
|
161
|
+
end
|
162
|
+
when :Object
|
163
|
+
# generic object (usually a Hash), return directly
|
164
|
+
value
|
165
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
166
|
+
inner_type = Regexp.last_match[:inner_type]
|
167
|
+
value.map { |v| _deserialize(inner_type, v) }
|
168
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
169
|
+
k_type = Regexp.last_match[:k_type]
|
170
|
+
v_type = Regexp.last_match[:v_type]
|
171
|
+
{}.tap do |hash|
|
172
|
+
value.each do |k, v|
|
173
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
174
|
+
end
|
175
|
+
end
|
176
|
+
else # model
|
177
|
+
TurnkeyClient.const_get(type).build_from_hash(value)
|
178
|
+
end
|
179
|
+
end
|
180
|
+
|
181
|
+
# Returns the string representation of the object
|
182
|
+
# @return [String] String presentation of the object
|
183
|
+
def to_s
|
184
|
+
to_hash.to_s
|
185
|
+
end
|
186
|
+
|
187
|
+
# to_body is an alias to to_hash (backward compatibility)
|
188
|
+
# @return [Hash] Returns the object in the form of hash
|
189
|
+
def to_body
|
190
|
+
to_hash
|
191
|
+
end
|
192
|
+
|
193
|
+
# Returns the object in the form of hash
|
194
|
+
# @return [Hash] Returns the object in the form of hash
|
195
|
+
def to_hash
|
196
|
+
hash = {}
|
197
|
+
self.class.attribute_map.each_pair do |attr, param|
|
198
|
+
value = self.send(attr)
|
199
|
+
if value.nil?
|
200
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
201
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
202
|
+
end
|
203
|
+
|
204
|
+
hash[param] = _to_hash(value)
|
205
|
+
end
|
206
|
+
hash
|
207
|
+
end
|
208
|
+
|
209
|
+
# Outputs non-array value in the form of hash
|
210
|
+
# For object, use to_hash. Otherwise, just return the value
|
211
|
+
# @param [Object] value Any valid value
|
212
|
+
# @return [Hash] Returns the value in the form of hash
|
213
|
+
def _to_hash(value)
|
214
|
+
if value.is_a?(Array)
|
215
|
+
value.compact.map { |v| _to_hash(v) }
|
216
|
+
elsif value.is_a?(Hash)
|
217
|
+
{}.tap do |hash|
|
218
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
219
|
+
end
|
220
|
+
elsif value.respond_to? :to_hash
|
221
|
+
value.to_hash
|
222
|
+
else
|
223
|
+
value
|
224
|
+
end
|
225
|
+
end end
|
226
|
+
end
|
@@ -28,6 +28,12 @@ module TurnkeyClient
|
|
28
28
|
# Optional custom email address from which to send the OTP email
|
29
29
|
attr_accessor :send_from_email_address
|
30
30
|
|
31
|
+
# Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications'
|
32
|
+
attr_accessor :send_from_email_sender_name
|
33
|
+
|
34
|
+
# Optional custom email address to use as reply-to
|
35
|
+
attr_accessor :reply_to_email_address
|
36
|
+
|
31
37
|
# Attribute mapping from ruby-style variable name to JSON key.
|
32
38
|
def self.attribute_map
|
33
39
|
{
|
@@ -36,7 +42,9 @@ module TurnkeyClient
|
|
36
42
|
:'email_customization' => :'emailCustomization',
|
37
43
|
:'sms_customization' => :'smsCustomization',
|
38
44
|
:'user_identifier' => :'userIdentifier',
|
39
|
-
:'send_from_email_address' => :'sendFromEmailAddress'
|
45
|
+
:'send_from_email_address' => :'sendFromEmailAddress',
|
46
|
+
:'send_from_email_sender_name' => :'sendFromEmailSenderName',
|
47
|
+
:'reply_to_email_address' => :'replyToEmailAddress'
|
40
48
|
}
|
41
49
|
end
|
42
50
|
|
@@ -48,13 +56,19 @@ module TurnkeyClient
|
|
48
56
|
:'email_customization' => :'Object',
|
49
57
|
:'sms_customization' => :'Object',
|
50
58
|
:'user_identifier' => :'Object',
|
51
|
-
:'send_from_email_address' => :'Object'
|
59
|
+
:'send_from_email_address' => :'Object',
|
60
|
+
:'send_from_email_sender_name' => :'Object',
|
61
|
+
:'reply_to_email_address' => :'Object'
|
52
62
|
}
|
53
63
|
end
|
54
64
|
|
55
65
|
# List of attributes with nullable: true
|
56
66
|
def self.openapi_nullable
|
57
67
|
Set.new([
|
68
|
+
:'user_identifier',
|
69
|
+
:'send_from_email_address',
|
70
|
+
:'send_from_email_sender_name',
|
71
|
+
:'reply_to_email_address'
|
58
72
|
])
|
59
73
|
end
|
60
74
|
|
@@ -96,6 +110,14 @@ module TurnkeyClient
|
|
96
110
|
if attributes.key?(:'send_from_email_address')
|
97
111
|
self.send_from_email_address = attributes[:'send_from_email_address']
|
98
112
|
end
|
113
|
+
|
114
|
+
if attributes.key?(:'send_from_email_sender_name')
|
115
|
+
self.send_from_email_sender_name = attributes[:'send_from_email_sender_name']
|
116
|
+
end
|
117
|
+
|
118
|
+
if attributes.key?(:'reply_to_email_address')
|
119
|
+
self.reply_to_email_address = attributes[:'reply_to_email_address']
|
120
|
+
end
|
99
121
|
end
|
100
122
|
|
101
123
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -131,7 +153,9 @@ module TurnkeyClient
|
|
131
153
|
email_customization == o.email_customization &&
|
132
154
|
sms_customization == o.sms_customization &&
|
133
155
|
user_identifier == o.user_identifier &&
|
134
|
-
send_from_email_address == o.send_from_email_address
|
156
|
+
send_from_email_address == o.send_from_email_address &&
|
157
|
+
send_from_email_sender_name == o.send_from_email_sender_name &&
|
158
|
+
reply_to_email_address == o.reply_to_email_address
|
135
159
|
end
|
136
160
|
|
137
161
|
# @see the `==` method
|
@@ -143,7 +167,7 @@ module TurnkeyClient
|
|
143
167
|
# Calculates hash code according to all attributes.
|
144
168
|
# @return [Integer] Hash code
|
145
169
|
def hash
|
146
|
-
[otp_type, contact, email_customization, sms_customization, user_identifier, send_from_email_address].hash
|
170
|
+
[otp_type, contact, email_customization, sms_customization, user_identifier, send_from_email_address, send_from_email_sender_name, reply_to_email_address].hash
|
147
171
|
end
|
148
172
|
|
149
173
|
# Builds the object from hash
|
@@ -0,0 +1,310 @@
|
|
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 InitOtpAuthIntentV2
|
15
|
+
# Enum to specifiy whether to send OTP via SMS or email
|
16
|
+
attr_accessor :otp_type
|
17
|
+
|
18
|
+
# Email or phone number to send the OTP code to
|
19
|
+
attr_accessor :contact
|
20
|
+
|
21
|
+
# Optional length of the OTP code. Default = 9
|
22
|
+
attr_accessor :otp_length
|
23
|
+
|
24
|
+
attr_accessor :email_customization
|
25
|
+
|
26
|
+
attr_accessor :sms_customization
|
27
|
+
|
28
|
+
# Optional client-generated user identifier to enable per-user rate limiting for SMS auth. We recommend using a hash of the client-side IP address.
|
29
|
+
attr_accessor :user_identifier
|
30
|
+
|
31
|
+
# Optional custom email address from which to send the OTP email
|
32
|
+
attr_accessor :send_from_email_address
|
33
|
+
|
34
|
+
# Optional flag to specify if the OTP code should be alphanumeric (Crockford’s Base32). Default = true
|
35
|
+
attr_accessor :alphanumeric
|
36
|
+
|
37
|
+
# Optional custom sender name for use with sendFromEmailAddress; if left empty, will default to 'Notifications'
|
38
|
+
attr_accessor :send_from_email_sender_name
|
39
|
+
|
40
|
+
# Optional custom email address to use as reply-to
|
41
|
+
attr_accessor :reply_to_email_address
|
42
|
+
|
43
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
44
|
+
def self.attribute_map
|
45
|
+
{
|
46
|
+
:'otp_type' => :'otpType',
|
47
|
+
:'contact' => :'contact',
|
48
|
+
:'otp_length' => :'otpLength',
|
49
|
+
:'email_customization' => :'emailCustomization',
|
50
|
+
:'sms_customization' => :'smsCustomization',
|
51
|
+
:'user_identifier' => :'userIdentifier',
|
52
|
+
:'send_from_email_address' => :'sendFromEmailAddress',
|
53
|
+
:'alphanumeric' => :'alphanumeric',
|
54
|
+
:'send_from_email_sender_name' => :'sendFromEmailSenderName',
|
55
|
+
:'reply_to_email_address' => :'replyToEmailAddress'
|
56
|
+
}
|
57
|
+
end
|
58
|
+
|
59
|
+
# Attribute type mapping.
|
60
|
+
def self.openapi_types
|
61
|
+
{
|
62
|
+
:'otp_type' => :'Object',
|
63
|
+
:'contact' => :'Object',
|
64
|
+
:'otp_length' => :'Object',
|
65
|
+
:'email_customization' => :'Object',
|
66
|
+
:'sms_customization' => :'Object',
|
67
|
+
:'user_identifier' => :'Object',
|
68
|
+
:'send_from_email_address' => :'Object',
|
69
|
+
:'alphanumeric' => :'Object',
|
70
|
+
:'send_from_email_sender_name' => :'Object',
|
71
|
+
:'reply_to_email_address' => :'Object'
|
72
|
+
}
|
73
|
+
end
|
74
|
+
|
75
|
+
# List of attributes with nullable: true
|
76
|
+
def self.openapi_nullable
|
77
|
+
Set.new([
|
78
|
+
:'otp_length',
|
79
|
+
:'user_identifier',
|
80
|
+
:'send_from_email_address',
|
81
|
+
:'alphanumeric',
|
82
|
+
:'send_from_email_sender_name',
|
83
|
+
:'reply_to_email_address'
|
84
|
+
])
|
85
|
+
end
|
86
|
+
|
87
|
+
# Initializes the object
|
88
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
89
|
+
def initialize(attributes = {})
|
90
|
+
if (!attributes.is_a?(Hash))
|
91
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::InitOtpAuthIntentV2` initialize method"
|
92
|
+
end
|
93
|
+
|
94
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
95
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
96
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
97
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::InitOtpAuthIntentV2`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
98
|
+
end
|
99
|
+
h[k.to_sym] = v
|
100
|
+
}
|
101
|
+
|
102
|
+
if attributes.key?(:'otp_type')
|
103
|
+
self.otp_type = attributes[:'otp_type']
|
104
|
+
end
|
105
|
+
|
106
|
+
if attributes.key?(:'contact')
|
107
|
+
self.contact = attributes[:'contact']
|
108
|
+
end
|
109
|
+
|
110
|
+
if attributes.key?(:'otp_length')
|
111
|
+
self.otp_length = attributes[:'otp_length']
|
112
|
+
end
|
113
|
+
|
114
|
+
if attributes.key?(:'email_customization')
|
115
|
+
self.email_customization = attributes[:'email_customization']
|
116
|
+
end
|
117
|
+
|
118
|
+
if attributes.key?(:'sms_customization')
|
119
|
+
self.sms_customization = attributes[:'sms_customization']
|
120
|
+
end
|
121
|
+
|
122
|
+
if attributes.key?(:'user_identifier')
|
123
|
+
self.user_identifier = attributes[:'user_identifier']
|
124
|
+
end
|
125
|
+
|
126
|
+
if attributes.key?(:'send_from_email_address')
|
127
|
+
self.send_from_email_address = attributes[:'send_from_email_address']
|
128
|
+
end
|
129
|
+
|
130
|
+
if attributes.key?(:'alphanumeric')
|
131
|
+
self.alphanumeric = attributes[:'alphanumeric']
|
132
|
+
end
|
133
|
+
|
134
|
+
if attributes.key?(:'send_from_email_sender_name')
|
135
|
+
self.send_from_email_sender_name = attributes[:'send_from_email_sender_name']
|
136
|
+
end
|
137
|
+
|
138
|
+
if attributes.key?(:'reply_to_email_address')
|
139
|
+
self.reply_to_email_address = attributes[:'reply_to_email_address']
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
143
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
144
|
+
# @return Array for valid properties with the reasons
|
145
|
+
def list_invalid_properties
|
146
|
+
invalid_properties = Array.new
|
147
|
+
if @otp_type.nil?
|
148
|
+
invalid_properties.push('invalid value for "otp_type", otp_type cannot be nil.')
|
149
|
+
end
|
150
|
+
|
151
|
+
if @contact.nil?
|
152
|
+
invalid_properties.push('invalid value for "contact", contact cannot be nil.')
|
153
|
+
end
|
154
|
+
|
155
|
+
invalid_properties
|
156
|
+
end
|
157
|
+
|
158
|
+
# Check to see if the all the properties in the model are valid
|
159
|
+
# @return true if the model is valid
|
160
|
+
def valid?
|
161
|
+
return false if @otp_type.nil?
|
162
|
+
return false if @contact.nil?
|
163
|
+
true
|
164
|
+
end
|
165
|
+
|
166
|
+
# Checks equality by comparing each attribute.
|
167
|
+
# @param [Object] Object to be compared
|
168
|
+
def ==(o)
|
169
|
+
return true if self.equal?(o)
|
170
|
+
self.class == o.class &&
|
171
|
+
otp_type == o.otp_type &&
|
172
|
+
contact == o.contact &&
|
173
|
+
otp_length == o.otp_length &&
|
174
|
+
email_customization == o.email_customization &&
|
175
|
+
sms_customization == o.sms_customization &&
|
176
|
+
user_identifier == o.user_identifier &&
|
177
|
+
send_from_email_address == o.send_from_email_address &&
|
178
|
+
alphanumeric == o.alphanumeric &&
|
179
|
+
send_from_email_sender_name == o.send_from_email_sender_name &&
|
180
|
+
reply_to_email_address == o.reply_to_email_address
|
181
|
+
end
|
182
|
+
|
183
|
+
# @see the `==` method
|
184
|
+
# @param [Object] Object to be compared
|
185
|
+
def eql?(o)
|
186
|
+
self == o
|
187
|
+
end
|
188
|
+
|
189
|
+
# Calculates hash code according to all attributes.
|
190
|
+
# @return [Integer] Hash code
|
191
|
+
def hash
|
192
|
+
[otp_type, contact, otp_length, email_customization, sms_customization, user_identifier, send_from_email_address, alphanumeric, send_from_email_sender_name, reply_to_email_address].hash
|
193
|
+
end
|
194
|
+
|
195
|
+
# Builds the object from hash
|
196
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
197
|
+
# @return [Object] Returns the model itself
|
198
|
+
def self.build_from_hash(attributes)
|
199
|
+
new.build_from_hash(attributes)
|
200
|
+
end
|
201
|
+
|
202
|
+
# Builds the object from hash
|
203
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
204
|
+
# @return [Object] Returns the model itself
|
205
|
+
def build_from_hash(attributes)
|
206
|
+
return nil unless attributes.is_a?(Hash)
|
207
|
+
self.class.openapi_types.each_pair do |key, type|
|
208
|
+
if type =~ /\AArray<(.*)>/i
|
209
|
+
# check to ensure the input is an array given that the attribute
|
210
|
+
# is documented as an array but the input is not
|
211
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
212
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
213
|
+
end
|
214
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
215
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
216
|
+
elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
217
|
+
self.send("#{key}=", nil)
|
218
|
+
end
|
219
|
+
end
|
220
|
+
|
221
|
+
self
|
222
|
+
end
|
223
|
+
|
224
|
+
# Deserializes the data based on type
|
225
|
+
# @param string type Data type
|
226
|
+
# @param string value Value to be deserialized
|
227
|
+
# @return [Object] Deserialized data
|
228
|
+
def _deserialize(type, value)
|
229
|
+
case type.to_sym
|
230
|
+
when :DateTime
|
231
|
+
DateTime.parse(value)
|
232
|
+
when :Date
|
233
|
+
Date.parse(value)
|
234
|
+
when :String
|
235
|
+
value.to_s
|
236
|
+
when :Integer
|
237
|
+
value.to_i
|
238
|
+
when :Float
|
239
|
+
value.to_f
|
240
|
+
when :Boolean
|
241
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
242
|
+
true
|
243
|
+
else
|
244
|
+
false
|
245
|
+
end
|
246
|
+
when :Object
|
247
|
+
# generic object (usually a Hash), return directly
|
248
|
+
value
|
249
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
250
|
+
inner_type = Regexp.last_match[:inner_type]
|
251
|
+
value.map { |v| _deserialize(inner_type, v) }
|
252
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
253
|
+
k_type = Regexp.last_match[:k_type]
|
254
|
+
v_type = Regexp.last_match[:v_type]
|
255
|
+
{}.tap do |hash|
|
256
|
+
value.each do |k, v|
|
257
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
258
|
+
end
|
259
|
+
end
|
260
|
+
else # model
|
261
|
+
TurnkeyClient.const_get(type).build_from_hash(value)
|
262
|
+
end
|
263
|
+
end
|
264
|
+
|
265
|
+
# Returns the string representation of the object
|
266
|
+
# @return [String] String presentation of the object
|
267
|
+
def to_s
|
268
|
+
to_hash.to_s
|
269
|
+
end
|
270
|
+
|
271
|
+
# to_body is an alias to to_hash (backward compatibility)
|
272
|
+
# @return [Hash] Returns the object in the form of hash
|
273
|
+
def to_body
|
274
|
+
to_hash
|
275
|
+
end
|
276
|
+
|
277
|
+
# Returns the object in the form of hash
|
278
|
+
# @return [Hash] Returns the object in the form of hash
|
279
|
+
def to_hash
|
280
|
+
hash = {}
|
281
|
+
self.class.attribute_map.each_pair do |attr, param|
|
282
|
+
value = self.send(attr)
|
283
|
+
if value.nil?
|
284
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
285
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
286
|
+
end
|
287
|
+
|
288
|
+
hash[param] = _to_hash(value)
|
289
|
+
end
|
290
|
+
hash
|
291
|
+
end
|
292
|
+
|
293
|
+
# Outputs non-array value in the form of hash
|
294
|
+
# For object, use to_hash. Otherwise, just return the value
|
295
|
+
# @param [Object] value Any valid value
|
296
|
+
# @return [Hash] Returns the value in the form of hash
|
297
|
+
def _to_hash(value)
|
298
|
+
if value.is_a?(Array)
|
299
|
+
value.compact.map { |v| _to_hash(v) }
|
300
|
+
elsif value.is_a?(Hash)
|
301
|
+
{}.tap do |hash|
|
302
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
303
|
+
end
|
304
|
+
elsif value.respond_to? :to_hash
|
305
|
+
value.to_hash
|
306
|
+
else
|
307
|
+
value
|
308
|
+
end
|
309
|
+
end end
|
310
|
+
end
|
@@ -129,7 +129,7 @@ module TurnkeyClient
|
|
129
129
|
# @return true if the model is valid
|
130
130
|
def valid?
|
131
131
|
return false if @type.nil?
|
132
|
-
type_validator = EnumAttributeValidator.new('Object', ['
|
132
|
+
type_validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_INIT_OTP_AUTH_V2'])
|
133
133
|
return false unless type_validator.valid?(@type)
|
134
134
|
return false if @timestamp_ms.nil?
|
135
135
|
return false if @organization_id.nil?
|
@@ -140,7 +140,7 @@ module TurnkeyClient
|
|
140
140
|
# Custom attribute writer method checking allowed values (enum).
|
141
141
|
# @param [Object] type Object to be assigned
|
142
142
|
def type=(type)
|
143
|
-
validator = EnumAttributeValidator.new('Object', ['
|
143
|
+
validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_INIT_OTP_AUTH_V2'])
|
144
144
|
unless validator.valid?(type)
|
145
145
|
fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
|
146
146
|
end
|