turnkey_client 0.0.17 → 0.0.19

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.
Files changed (166) hide show
  1. checksums.yaml +4 -4
  2. data/lib/turnkey_client/api/broadcasting_api.rb +12 -12
  3. data/lib/turnkey_client/api/default_api.rb +46 -0
  4. data/lib/turnkey_client/api/ip_allowlist_api.rb +193 -0
  5. data/lib/turnkey_client/api/organizations_api.rb +290 -0
  6. data/lib/turnkey_client/api/signing_api.rb +232 -0
  7. data/lib/turnkey_client/api/tvc_api.rb +773 -0
  8. data/lib/turnkey_client/api/wallets_api.rb +116 -0
  9. data/lib/turnkey_client/configuration.rb +7 -0
  10. data/lib/turnkey_client/models/activate_billing_tier_intent.rb +14 -4
  11. data/lib/turnkey_client/models/activity_type.rb +21 -0
  12. data/lib/turnkey_client/models/address_format.rb +2 -0
  13. data/lib/turnkey_client/models/app_status.rb +243 -0
  14. data/lib/turnkey_client/models/asset_balance.rb +255 -0
  15. data/lib/turnkey_client/models/asset_balance_display.rb +216 -0
  16. data/lib/turnkey_client/models/asset_metadata.rb +246 -0
  17. data/lib/turnkey_client/models/boot_proof.rb +17 -6
  18. data/lib/turnkey_client/models/create_oauth_providers_intent_v2.rb +228 -0
  19. data/lib/turnkey_client/models/create_oauth_providers_request.rb +2 -2
  20. data/lib/turnkey_client/models/create_oauth_providers_result_v2.rb +213 -0
  21. data/lib/turnkey_client/models/create_read_write_session_intent_v2.rb +1 -1
  22. data/lib/turnkey_client/models/create_sub_organization_intent_v8.rb +316 -0
  23. data/lib/turnkey_client/models/create_sub_organization_request.rb +2 -2
  24. data/lib/turnkey_client/models/create_sub_organization_result_v8.rb +230 -0
  25. data/lib/turnkey_client/models/create_tvc_app_intent.rb +9 -9
  26. data/lib/turnkey_client/models/create_tvc_app_request.rb +288 -0
  27. data/lib/turnkey_client/models/create_tvc_deployment_intent.rb +60 -41
  28. data/lib/turnkey_client/models/create_tvc_deployment_request.rb +288 -0
  29. data/lib/turnkey_client/models/create_tvc_manifest_approvals_request.rb +288 -0
  30. data/lib/turnkey_client/models/create_users_intent_v4.rb +213 -0
  31. data/lib/turnkey_client/models/create_users_request.rb +2 -2
  32. data/lib/turnkey_client/models/create_webhook_endpoint_intent.rb +238 -0
  33. data/lib/turnkey_client/models/create_webhook_endpoint_request.rb +298 -0
  34. data/lib/turnkey_client/models/create_webhook_endpoint_result.rb +225 -0
  35. data/lib/turnkey_client/models/delete_tvc_app_and_deployments_intent.rb +211 -0
  36. data/lib/turnkey_client/models/delete_tvc_app_and_deployments_request.rb +298 -0
  37. data/lib/turnkey_client/models/delete_tvc_app_and_deployments_result.rb +211 -0
  38. data/lib/turnkey_client/models/delete_tvc_deployment_intent.rb +211 -0
  39. data/lib/turnkey_client/models/delete_tvc_deployment_request.rb +298 -0
  40. data/lib/turnkey_client/models/delete_tvc_deployment_result.rb +211 -0
  41. data/lib/turnkey_client/models/delete_webhook_endpoint_intent.rb +211 -0
  42. data/lib/turnkey_client/models/delete_webhook_endpoint_request.rb +298 -0
  43. data/lib/turnkey_client/models/delete_webhook_endpoint_result.rb +211 -0
  44. data/lib/turnkey_client/models/deployment_status.rb +255 -0
  45. data/lib/turnkey_client/models/eth_failure_details.rb +208 -0
  46. data/lib/turnkey_client/models/eth_send_raw_transaction_intent.rb +2 -2
  47. data/lib/turnkey_client/models/eth_send_transaction_intent.rb +12 -1
  48. data/lib/turnkey_client/models/feature_name.rb +1 -0
  49. data/lib/turnkey_client/models/get_app_status_request.rb +226 -0
  50. data/lib/turnkey_client/models/get_app_status_response.rb +210 -0
  51. data/lib/turnkey_client/models/get_ip_allowlist_request.rb +222 -0
  52. data/lib/turnkey_client/models/get_ip_allowlist_response.rb +210 -0
  53. data/lib/turnkey_client/models/get_nonces_request.rb +35 -1
  54. data/lib/turnkey_client/models/get_send_transaction_status_response.rb +10 -1
  55. data/lib/turnkey_client/models/get_tvc_app_deployments_request.rb +226 -0
  56. data/lib/turnkey_client/models/get_tvc_app_deployments_response.rb +213 -0
  57. data/lib/turnkey_client/models/get_tvc_app_request.rb +226 -0
  58. data/lib/turnkey_client/models/get_tvc_app_response.rb +210 -0
  59. data/lib/turnkey_client/models/get_tvc_apps_request.rb +211 -0
  60. data/lib/turnkey_client/models/get_tvc_apps_response.rb +213 -0
  61. data/lib/turnkey_client/models/get_tvc_deployment_request.rb +226 -0
  62. data/lib/turnkey_client/models/get_tvc_deployment_response.rb +210 -0
  63. data/lib/turnkey_client/models/get_wallet_address_balances_request.rb +275 -0
  64. data/lib/turnkey_client/models/get_wallet_address_balances_response.rb +208 -0
  65. data/lib/turnkey_client/models/init_otp_auth_intent.rb +1 -1
  66. data/lib/turnkey_client/models/init_otp_auth_intent_v2.rb +1 -1
  67. data/lib/turnkey_client/models/init_otp_intent_v3.rb +336 -0
  68. data/lib/turnkey_client/models/init_otp_request.rb +2 -2
  69. data/lib/turnkey_client/models/init_otp_result_v2.rb +226 -0
  70. data/lib/turnkey_client/models/intent.rb +193 -4
  71. data/lib/turnkey_client/models/ip_allowlist.rb +261 -0
  72. data/lib/turnkey_client/models/ip_allowlist_intent_rule.rb +222 -0
  73. data/lib/turnkey_client/models/ip_allowlist_rule.rb +232 -0
  74. data/lib/turnkey_client/models/list_supported_assets_request.rb +260 -0
  75. data/lib/turnkey_client/models/list_supported_assets_response.rb +208 -0
  76. data/lib/turnkey_client/models/list_webhook_endpoints_request.rb +211 -0
  77. data/lib/turnkey_client/models/list_webhook_endpoints_response.rb +212 -0
  78. data/lib/turnkey_client/models/login_usage.rb +211 -0
  79. data/lib/turnkey_client/models/noop_codegen_anchor_response.rb +219 -0
  80. data/lib/turnkey_client/models/oauth2_authenticate_intent.rb +6 -2
  81. data/lib/turnkey_client/models/oauth_provider_params_v2.rb +230 -0
  82. data/lib/turnkey_client/models/oidc_claims.rb +241 -0
  83. data/lib/turnkey_client/models/otp_login_intent_v2.rb +262 -0
  84. data/lib/turnkey_client/models/otp_login_request.rb +2 -2
  85. data/lib/turnkey_client/models/post_tvc_quorum_key_share_intent.rb +240 -0
  86. data/lib/turnkey_client/models/post_tvc_quorum_key_share_result.rb +211 -0
  87. data/lib/turnkey_client/models/quorum_key_share_approval_bundle.rb +241 -0
  88. data/lib/turnkey_client/models/remove_ip_allowlist_intent.rb +207 -0
  89. data/lib/turnkey_client/models/remove_ip_allowlist_request.rb +298 -0
  90. data/lib/turnkey_client/models/remove_ip_allowlist_result.rb +196 -0
  91. data/lib/turnkey_client/models/restore_tvc_deployment_intent.rb +211 -0
  92. data/lib/turnkey_client/models/restore_tvc_deployment_request.rb +298 -0
  93. data/lib/turnkey_client/models/restore_tvc_deployment_result.rb +211 -0
  94. data/lib/turnkey_client/models/result.rb +166 -4
  95. data/lib/turnkey_client/models/root_user_params_v5.rb +284 -0
  96. data/lib/turnkey_client/models/set_ip_allowlist_intent.rb +241 -0
  97. data/lib/turnkey_client/models/set_ip_allowlist_request.rb +298 -0
  98. data/lib/turnkey_client/models/set_ip_allowlist_result.rb +196 -0
  99. data/lib/turnkey_client/models/signup_usage.rb +249 -0
  100. data/lib/turnkey_client/models/signup_usage_v2.rb +249 -0
  101. data/lib/turnkey_client/models/sol_send_transaction_intent.rb +3 -3
  102. data/lib/turnkey_client/models/solana_config.rb +207 -0
  103. data/lib/turnkey_client/models/solana_failure_details.rb +273 -0
  104. data/lib/turnkey_client/models/solana_send_transaction_status.rb +207 -0
  105. data/lib/turnkey_client/models/spark_claim_leaf.rb +241 -0
  106. data/lib/turnkey_client/models/spark_claim_package.rb +275 -0
  107. data/lib/turnkey_client/models/spark_claim_transfer_intent.rb +225 -0
  108. data/lib/turnkey_client/models/spark_claim_transfer_request.rb +288 -0
  109. data/lib/turnkey_client/models/spark_claim_transfer_result.rb +230 -0
  110. data/lib/turnkey_client/models/spark_deposit_derivation.rb +196 -0
  111. data/lib/turnkey_client/models/spark_encrypted_operator_package.rb +226 -0
  112. data/lib/turnkey_client/models/spark_frost_commitment.rb +241 -0
  113. data/lib/turnkey_client/models/spark_htlc_preimage_derivation.rb +196 -0
  114. data/lib/turnkey_client/models/spark_identity_derivation.rb +196 -0
  115. data/lib/turnkey_client/models/spark_key_derivation.rb +241 -0
  116. data/lib/turnkey_client/models/spark_leaf_public_key.rb +226 -0
  117. data/lib/turnkey_client/models/spark_lightning_receive_package.rb +228 -0
  118. data/lib/turnkey_client/models/spark_operator_recipient.rb +226 -0
  119. data/lib/turnkey_client/models/spark_partial_signature.rb +241 -0
  120. data/lib/turnkey_client/models/spark_prepare_lightning_receive_intent.rb +225 -0
  121. data/lib/turnkey_client/models/spark_prepare_lightning_receive_request.rb +288 -0
  122. data/lib/turnkey_client/models/spark_prepare_lightning_receive_result.rb +228 -0
  123. data/lib/turnkey_client/models/spark_prepare_transfer_intent.rb +225 -0
  124. data/lib/turnkey_client/models/spark_prepare_transfer_request.rb +288 -0
  125. data/lib/turnkey_client/models/spark_prepare_transfer_result.rb +245 -0
  126. data/lib/turnkey_client/models/spark_sign_frost_intent.rb +228 -0
  127. data/lib/turnkey_client/models/spark_sign_frost_request.rb +288 -0
  128. data/lib/turnkey_client/models/spark_sign_frost_result.rb +213 -0
  129. data/lib/turnkey_client/models/spark_signature_request.rb +268 -0
  130. data/lib/turnkey_client/models/spark_signing_leaf_derivation.rb +211 -0
  131. data/lib/turnkey_client/models/spark_static_deposit_derivation.rb +211 -0
  132. data/lib/turnkey_client/models/spark_transfer_leaf.rb +272 -0
  133. data/lib/turnkey_client/models/spark_transfer_package.rb +275 -0
  134. data/lib/turnkey_client/models/token_usage.rb +252 -0
  135. data/lib/turnkey_client/models/tvc_app.rb +353 -0
  136. data/lib/turnkey_client/models/tvc_container_spec.rb +302 -0
  137. data/lib/turnkey_client/models/tvc_deployment.rb +372 -0
  138. data/lib/turnkey_client/models/tvc_health_check_type.rb +27 -0
  139. data/lib/turnkey_client/models/tvc_manifest.rb +254 -0
  140. data/lib/turnkey_client/models/tvc_operator.rb +269 -0
  141. data/lib/turnkey_client/models/tvc_operator_approval.rb +283 -0
  142. data/lib/turnkey_client/models/tvc_operator_set.rb +301 -0
  143. data/lib/turnkey_client/models/tx_error.rb +22 -4
  144. data/lib/turnkey_client/models/update_auth_proxy_config_intent.rb +17 -5
  145. data/lib/turnkey_client/models/update_organization_name_intent.rb +211 -0
  146. data/lib/turnkey_client/models/update_organization_name_request.rb +298 -0
  147. data/lib/turnkey_client/models/update_organization_name_result.rb +226 -0
  148. data/lib/turnkey_client/models/update_tvc_app_live_deployment_intent.rb +211 -0
  149. data/lib/turnkey_client/models/update_tvc_app_live_deployment_request.rb +298 -0
  150. data/lib/turnkey_client/models/update_tvc_app_live_deployment_result.rb +196 -0
  151. data/lib/turnkey_client/models/update_webhook_endpoint_intent.rb +244 -0
  152. data/lib/turnkey_client/models/update_webhook_endpoint_request.rb +298 -0
  153. data/lib/turnkey_client/models/update_webhook_endpoint_result.rb +225 -0
  154. data/lib/turnkey_client/models/upsert_gas_usage_config_intent.rb +25 -5
  155. data/lib/turnkey_client/models/usage_type.rb +27 -0
  156. data/lib/turnkey_client/models/user_params_v4.rb +301 -0
  157. data/lib/turnkey_client/models/validate_tvc_image_request.rb +237 -0
  158. data/lib/turnkey_client/models/validate_tvc_image_response.rb +205 -0
  159. data/lib/turnkey_client/models/verify_otp_intent_v2.rb +237 -0
  160. data/lib/turnkey_client/models/verify_otp_request.rb +2 -2
  161. data/lib/turnkey_client/models/web_authn_stamp.rb +256 -0
  162. data/lib/turnkey_client/models/webhook_endpoint_data.rb +283 -0
  163. data/lib/turnkey_client/models/webhook_subscription_params.rb +233 -0
  164. data/lib/turnkey_client/version.rb +1 -1
  165. data/lib/turnkey_client.rb +129 -0
  166. metadata +153 -24
@@ -0,0 +1,213 @@
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 CreateUsersIntentV4
15
+ # A list of Users.
16
+ attr_accessor :users
17
+
18
+ # Attribute mapping from ruby-style variable name to JSON key.
19
+ def self.attribute_map
20
+ {
21
+ :'users' => :'users'
22
+ }
23
+ end
24
+
25
+ # Attribute type mapping.
26
+ def self.openapi_types
27
+ {
28
+ :'users' => :'Object'
29
+ }
30
+ end
31
+
32
+ # List of attributes with nullable: true
33
+ def self.openapi_nullable
34
+ Set.new([
35
+ ])
36
+ end
37
+
38
+ # Initializes the object
39
+ # @param [Hash] attributes Model attributes in the form of hash
40
+ def initialize(attributes = {})
41
+ if (!attributes.is_a?(Hash))
42
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::CreateUsersIntentV4` initialize method"
43
+ end
44
+
45
+ # check to see if the attribute exists and convert string to symbol for hash key
46
+ attributes = attributes.each_with_object({}) { |(k, v), h|
47
+ if (!self.class.attribute_map.key?(k.to_sym))
48
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::CreateUsersIntentV4`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
49
+ end
50
+ h[k.to_sym] = v
51
+ }
52
+
53
+ if attributes.key?(:'users')
54
+ if (value = attributes[:'users']).is_a?(Array)
55
+ self.users = value
56
+ end
57
+ end
58
+ end
59
+
60
+ # Show invalid properties with the reasons. Usually used together with valid?
61
+ # @return Array for valid properties with the reasons
62
+ def list_invalid_properties
63
+ invalid_properties = Array.new
64
+ if @users.nil?
65
+ invalid_properties.push('invalid value for "users", users cannot be nil.')
66
+ end
67
+
68
+ invalid_properties
69
+ end
70
+
71
+ # Check to see if the all the properties in the model are valid
72
+ # @return true if the model is valid
73
+ def valid?
74
+ return false if @users.nil?
75
+ true
76
+ end
77
+
78
+ # Checks equality by comparing each attribute.
79
+ # @param [Object] Object to be compared
80
+ def ==(o)
81
+ return true if self.equal?(o)
82
+ self.class == o.class &&
83
+ users == o.users
84
+ end
85
+
86
+ # @see the `==` method
87
+ # @param [Object] Object to be compared
88
+ def eql?(o)
89
+ self == o
90
+ end
91
+
92
+ # Calculates hash code according to all attributes.
93
+ # @return [Integer] Hash code
94
+ def hash
95
+ [users].hash
96
+ end
97
+
98
+ # Builds the object from hash
99
+ # @param [Hash] attributes Model attributes in the form of hash
100
+ # @return [Object] Returns the model itself
101
+ def self.build_from_hash(attributes)
102
+ new.build_from_hash(attributes)
103
+ end
104
+
105
+ # Builds the object from hash
106
+ # @param [Hash] attributes Model attributes in the form of hash
107
+ # @return [Object] Returns the model itself
108
+ def build_from_hash(attributes)
109
+ return nil unless attributes.is_a?(Hash)
110
+ self.class.openapi_types.each_pair do |key, type|
111
+ if type =~ /\AArray<(.*)>/i
112
+ # check to ensure the input is an array given that the attribute
113
+ # is documented as an array but the input is not
114
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
115
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
116
+ end
117
+ elsif !attributes[self.class.attribute_map[key]].nil?
118
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
119
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
120
+ self.send("#{key}=", nil)
121
+ end
122
+ end
123
+
124
+ self
125
+ end
126
+
127
+ # Deserializes the data based on type
128
+ # @param string type Data type
129
+ # @param string value Value to be deserialized
130
+ # @return [Object] Deserialized data
131
+ def _deserialize(type, value)
132
+ case type.to_sym
133
+ when :DateTime
134
+ DateTime.parse(value)
135
+ when :Date
136
+ Date.parse(value)
137
+ when :String
138
+ value.to_s
139
+ when :Integer
140
+ value.to_i
141
+ when :Float
142
+ value.to_f
143
+ when :Boolean
144
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
145
+ true
146
+ else
147
+ false
148
+ end
149
+ when :Object
150
+ # generic object (usually a Hash), return directly
151
+ value
152
+ when /\AArray<(?<inner_type>.+)>\z/
153
+ inner_type = Regexp.last_match[:inner_type]
154
+ value.map { |v| _deserialize(inner_type, v) }
155
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
156
+ k_type = Regexp.last_match[:k_type]
157
+ v_type = Regexp.last_match[:v_type]
158
+ {}.tap do |hash|
159
+ value.each do |k, v|
160
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
161
+ end
162
+ end
163
+ else # model
164
+ TurnkeyClient.const_get(type).build_from_hash(value)
165
+ end
166
+ end
167
+
168
+ # Returns the string representation of the object
169
+ # @return [String] String presentation of the object
170
+ def to_s
171
+ to_hash.to_s
172
+ end
173
+
174
+ # to_body is an alias to to_hash (backward compatibility)
175
+ # @return [Hash] Returns the object in the form of hash
176
+ def to_body
177
+ to_hash
178
+ end
179
+
180
+ # Returns the object in the form of hash
181
+ # @return [Hash] Returns the object in the form of hash
182
+ def to_hash
183
+ hash = {}
184
+ self.class.attribute_map.each_pair do |attr, param|
185
+ value = self.send(attr)
186
+ if value.nil?
187
+ is_nullable = self.class.openapi_nullable.include?(attr)
188
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
189
+ end
190
+
191
+ hash[param] = _to_hash(value)
192
+ end
193
+ hash
194
+ end
195
+
196
+ # Outputs non-array value in the form of hash
197
+ # For object, use to_hash. Otherwise, just return the value
198
+ # @param [Object] value Any valid value
199
+ # @return [Hash] Returns the value in the form of hash
200
+ def _to_hash(value)
201
+ if value.is_a?(Array)
202
+ value.compact.map { |v| _to_hash(v) }
203
+ elsif value.is_a?(Hash)
204
+ {}.tap do |hash|
205
+ value.each { |k, v| hash[k] = _to_hash(v) }
206
+ end
207
+ elsif value.respond_to? :to_hash
208
+ value.to_hash
209
+ else
210
+ value
211
+ end
212
+ end end
213
+ end
@@ -138,7 +138,7 @@ module TurnkeyClient
138
138
  # @return true if the model is valid
139
139
  def valid?
140
140
  return false if @type.nil?
141
- type_validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_CREATE_USERS_V3'])
141
+ type_validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_CREATE_USERS_V4'])
142
142
  return false unless type_validator.valid?(@type)
143
143
  return false if @timestamp_ms.nil?
144
144
  return false if @organization_id.nil?
@@ -149,7 +149,7 @@ module TurnkeyClient
149
149
  # Custom attribute writer method checking allowed values (enum).
150
150
  # @param [Object] type Object to be assigned
151
151
  def type=(type)
152
- validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_CREATE_USERS_V3'])
152
+ validator = EnumAttributeValidator.new('Object', ['ACTIVITY_TYPE_CREATE_USERS_V4'])
153
153
  unless validator.valid?(type)
154
154
  fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
155
155
  end
@@ -0,0 +1,238 @@
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 CreateWebhookEndpointIntent
15
+ # The destination URL for webhook delivery.
16
+ attr_accessor :url
17
+
18
+ # Human-readable name for this webhook endpoint.
19
+ attr_accessor :name
20
+
21
+ # Event subscriptions to create for this endpoint.
22
+ attr_accessor :subscriptions
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'url' => :'url',
28
+ :'name' => :'name',
29
+ :'subscriptions' => :'subscriptions'
30
+ }
31
+ end
32
+
33
+ # Attribute type mapping.
34
+ def self.openapi_types
35
+ {
36
+ :'url' => :'Object',
37
+ :'name' => :'Object',
38
+ :'subscriptions' => :'Object'
39
+ }
40
+ end
41
+
42
+ # List of attributes with nullable: true
43
+ def self.openapi_nullable
44
+ Set.new([
45
+ ])
46
+ end
47
+
48
+ # Initializes the object
49
+ # @param [Hash] attributes Model attributes in the form of hash
50
+ def initialize(attributes = {})
51
+ if (!attributes.is_a?(Hash))
52
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TurnkeyClient::CreateWebhookEndpointIntent` initialize method"
53
+ end
54
+
55
+ # check to see if the attribute exists and convert string to symbol for hash key
56
+ attributes = attributes.each_with_object({}) { |(k, v), h|
57
+ if (!self.class.attribute_map.key?(k.to_sym))
58
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TurnkeyClient::CreateWebhookEndpointIntent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
59
+ end
60
+ h[k.to_sym] = v
61
+ }
62
+
63
+ if attributes.key?(:'url')
64
+ self.url = attributes[:'url']
65
+ end
66
+
67
+ if attributes.key?(:'name')
68
+ self.name = attributes[:'name']
69
+ end
70
+
71
+ if attributes.key?(:'subscriptions')
72
+ if (value = attributes[:'subscriptions']).is_a?(Array)
73
+ self.subscriptions = value
74
+ end
75
+ end
76
+ end
77
+
78
+ # Show invalid properties with the reasons. Usually used together with valid?
79
+ # @return Array for valid properties with the reasons
80
+ def list_invalid_properties
81
+ invalid_properties = Array.new
82
+ if @url.nil?
83
+ invalid_properties.push('invalid value for "url", url cannot be nil.')
84
+ end
85
+
86
+ if @name.nil?
87
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
88
+ end
89
+
90
+ invalid_properties
91
+ end
92
+
93
+ # Check to see if the all the properties in the model are valid
94
+ # @return true if the model is valid
95
+ def valid?
96
+ return false if @url.nil?
97
+ return false if @name.nil?
98
+ true
99
+ end
100
+
101
+ # Checks equality by comparing each attribute.
102
+ # @param [Object] Object to be compared
103
+ def ==(o)
104
+ return true if self.equal?(o)
105
+ self.class == o.class &&
106
+ url == o.url &&
107
+ name == o.name &&
108
+ subscriptions == o.subscriptions
109
+ end
110
+
111
+ # @see the `==` method
112
+ # @param [Object] Object to be compared
113
+ def eql?(o)
114
+ self == o
115
+ end
116
+
117
+ # Calculates hash code according to all attributes.
118
+ # @return [Integer] Hash code
119
+ def hash
120
+ [url, name, subscriptions].hash
121
+ end
122
+
123
+ # Builds the object from hash
124
+ # @param [Hash] attributes Model attributes in the form of hash
125
+ # @return [Object] Returns the model itself
126
+ def self.build_from_hash(attributes)
127
+ new.build_from_hash(attributes)
128
+ end
129
+
130
+ # Builds the object from hash
131
+ # @param [Hash] attributes Model attributes in the form of hash
132
+ # @return [Object] Returns the model itself
133
+ def build_from_hash(attributes)
134
+ return nil unless attributes.is_a?(Hash)
135
+ self.class.openapi_types.each_pair do |key, type|
136
+ if type =~ /\AArray<(.*)>/i
137
+ # check to ensure the input is an array given that the attribute
138
+ # is documented as an array but the input is not
139
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
140
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
141
+ end
142
+ elsif !attributes[self.class.attribute_map[key]].nil?
143
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
144
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
145
+ self.send("#{key}=", nil)
146
+ end
147
+ end
148
+
149
+ self
150
+ end
151
+
152
+ # Deserializes the data based on type
153
+ # @param string type Data type
154
+ # @param string value Value to be deserialized
155
+ # @return [Object] Deserialized data
156
+ def _deserialize(type, value)
157
+ case type.to_sym
158
+ when :DateTime
159
+ DateTime.parse(value)
160
+ when :Date
161
+ Date.parse(value)
162
+ when :String
163
+ value.to_s
164
+ when :Integer
165
+ value.to_i
166
+ when :Float
167
+ value.to_f
168
+ when :Boolean
169
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
170
+ true
171
+ else
172
+ false
173
+ end
174
+ when :Object
175
+ # generic object (usually a Hash), return directly
176
+ value
177
+ when /\AArray<(?<inner_type>.+)>\z/
178
+ inner_type = Regexp.last_match[:inner_type]
179
+ value.map { |v| _deserialize(inner_type, v) }
180
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
181
+ k_type = Regexp.last_match[:k_type]
182
+ v_type = Regexp.last_match[:v_type]
183
+ {}.tap do |hash|
184
+ value.each do |k, v|
185
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
186
+ end
187
+ end
188
+ else # model
189
+ TurnkeyClient.const_get(type).build_from_hash(value)
190
+ end
191
+ end
192
+
193
+ # Returns the string representation of the object
194
+ # @return [String] String presentation of the object
195
+ def to_s
196
+ to_hash.to_s
197
+ end
198
+
199
+ # to_body is an alias to to_hash (backward compatibility)
200
+ # @return [Hash] Returns the object in the form of hash
201
+ def to_body
202
+ to_hash
203
+ end
204
+
205
+ # Returns the object in the form of hash
206
+ # @return [Hash] Returns the object in the form of hash
207
+ def to_hash
208
+ hash = {}
209
+ self.class.attribute_map.each_pair do |attr, param|
210
+ value = self.send(attr)
211
+ if value.nil?
212
+ is_nullable = self.class.openapi_nullable.include?(attr)
213
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
214
+ end
215
+
216
+ hash[param] = _to_hash(value)
217
+ end
218
+ hash
219
+ end
220
+
221
+ # Outputs non-array value in the form of hash
222
+ # For object, use to_hash. Otherwise, just return the value
223
+ # @param [Object] value Any valid value
224
+ # @return [Hash] Returns the value in the form of hash
225
+ def _to_hash(value)
226
+ if value.is_a?(Array)
227
+ value.compact.map { |v| _to_hash(v) }
228
+ elsif value.is_a?(Hash)
229
+ {}.tap do |hash|
230
+ value.each { |k, v| hash[k] = _to_hash(v) }
231
+ end
232
+ elsif value.respond_to? :to_hash
233
+ value.to_hash
234
+ else
235
+ value
236
+ end
237
+ end end
238
+ end