class Wallet::WalletClient
A service client - single point of access to the REST API.
Attributes
@return [String] the base URI of the service.
@return Subscription credentials which uniquely identify client subscription.
Public Class Methods
Creates initializes a new instance of the WalletClient
class. @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client. @param base_url
[String] the base URI of the service. @param options [Array] filters to be applied to the HTTP requests.
# File lib/generated/wallet/wallet_client.rb, line 26 def initialize(credentials = nil, base_url = nil, options = nil) super(credentials, options) @base_url = base_url || 'https://api.trinsic.id/wallet/v1' fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil? @credentials = credentials add_telemetry end
Public Instance Methods
Accept credential offer from URL or data
Accept a credential offer using the provided URL or data. The credential field can be in the form of a URL or JSON encoded as base64 data. This endpoint is used to accept connectionless credential issuance.
@param wallet_id [String] The wallet identifier @param credential_data [String] The credential data as URL or base64 @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [CredentialContract] operation results.
# File lib/generated/wallet/wallet_client.rb, line 1030 def accept_credential(wallet_id, credential_data, custom_headers:nil) response = accept_credential_async(wallet_id, credential_data, custom_headers:custom_headers).value! response.body unless response.nil? end
Accept credential offer from URL or data
Accept a credential offer using the provided URL or data. The credential field can be in the form of a URL or JSON encoded as base64 data. This endpoint is used to accept connectionless credential issuance.
@param wallet_id [String] The wallet identifier @param credential_data [String] The credential data as URL or base64 @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/generated/wallet/wallet_client.rb, line 1069 def accept_credential_async(wallet_id, credential_data, custom_headers:nil) fail ArgumentError, 'wallet_id is nil' if wallet_id.nil? fail ArgumentError, 'credential_data is nil' if credential_data.nil? request_headers = {} request_headers['Content-Type'] = 'multipart/form-data' # Set Form Data form_data = {} form_data['credentialData'] = credential_data unless credential_data.nil? path_template = 'api/{walletId}/credentials/fromData' request_url = @base_url || self.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'walletId' => wallet_id}, headers: request_headers.merge(custom_headers || {}), body: URI.encode_www_form(form_data), base_url: request_url } promise = self.make_request_async(:put, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 || status_code == 401 || status_code == 403 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Wallet::Models::CredentialContract.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Accept credential offer
Accept the specified credential offer in the specified wallet.
@param wallet_id [String] The wallet identifier @param credential_id [String] The credential identifier @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
# File lib/generated/wallet/wallet_client.rb, line 947 def accept_credential_offer(wallet_id, credential_id, custom_headers:nil) response = accept_credential_offer_async(wallet_id, credential_id, custom_headers:custom_headers).value! nil end
Accept credential offer
Accept the specified credential offer in the specified wallet.
@param wallet_id [String] The wallet identifier @param credential_id [String] The credential identifier @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/generated/wallet/wallet_client.rb, line 980 def accept_credential_offer_async(wallet_id, credential_id, custom_headers:nil) fail ArgumentError, 'wallet_id is nil' if wallet_id.nil? fail ArgumentError, 'credential_id is nil' if credential_id.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' path_template = 'api/{walletId}/credentials/{credentialId}' request_url = @base_url || self.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'walletId' => wallet_id,'credentialId' => credential_id}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:post, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 || status_code == 401 || status_code == 403 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result end promise.execute end
Accept credential offer
Accept the specified credential offer in the specified wallet.
@param wallet_id [String] The wallet identifier @param credential_id [String] The credential identifier @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRest::HttpOperationResponse] HTTP response information.
# File lib/generated/wallet/wallet_client.rb, line 964 def accept_credential_offer_with_http_info(wallet_id, credential_id, custom_headers:nil) accept_credential_offer_async(wallet_id, credential_id, custom_headers:custom_headers).value! end
Accept credential offer from URL or data
Accept a credential offer using the provided URL or data. The credential field can be in the form of a URL or JSON encoded as base64 data. This endpoint is used to accept connectionless credential issuance.
@param wallet_id [String] The wallet identifier @param credential_data [String] The credential data as URL or base64 @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRest::HttpOperationResponse] HTTP response information.
# File lib/generated/wallet/wallet_client.rb, line 1050 def accept_credential_with_http_info(wallet_id, credential_data, custom_headers:nil) accept_credential_async(wallet_id, credential_data, custom_headers:custom_headers).value! end
Accept connection invitation
Accept a connection invitation in the specified wallet. The invitation can be in a form of URL or invitation JSON encoded as base64 data.
@param wallet_id [String] The wallet identifier @param invitation [String] The base 64 encoded invitation @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [ConnectionContract] operation results.
# File lib/generated/wallet/wallet_client.rb, line 107 def accept_invitation(wallet_id, invitation, custom_headers:nil) response = accept_invitation_async(wallet_id, invitation, custom_headers:custom_headers).value! response.body unless response.nil? end
Accept connection invitation
Accept a connection invitation in the specified wallet. The invitation can be in a form of URL or invitation JSON encoded as base64 data.
@param wallet_id [String] The wallet identifier @param invitation [String] The base 64 encoded invitation @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/generated/wallet/wallet_client.rb, line 144 def accept_invitation_async(wallet_id, invitation, custom_headers:nil) fail ArgumentError, 'wallet_id is nil' if wallet_id.nil? fail ArgumentError, 'invitation is nil' if invitation.nil? request_headers = {} request_headers['Content-Type'] = 'multipart/form-data' # Set Form Data form_data = {} form_data['invitation'] = invitation unless invitation.nil? path_template = 'api/{walletId}/connections/invitation' request_url = @base_url || self.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'walletId' => wallet_id}, headers: request_headers.merge(custom_headers || {}), body: URI.encode_www_form(form_data), base_url: request_url } promise = self.make_request_async(:post, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 || status_code == 401 || status_code == 403 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Wallet::Models::ConnectionContract.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Accept connection invitation
Accept a connection invitation in the specified wallet. The invitation can be in a form of URL or invitation JSON encoded as base64 data.
@param wallet_id [String] The wallet identifier @param invitation [String] The base 64 encoded invitation @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRest::HttpOperationResponse] HTTP response information.
# File lib/generated/wallet/wallet_client.rb, line 126 def accept_invitation_with_http_info(wallet_id, invitation, custom_headers:nil) accept_invitation_async(wallet_id, invitation, custom_headers:custom_headers).value! end
Create wallet
Create a new custodian wallet.
@param body [WalletParameters] The wallet parameters @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [CustodianWalletContract] operation results.
# File lib/generated/wallet/wallet_client.rb, line 2285 def create_wallet(body, custom_headers:nil) response = create_wallet_async(body, custom_headers:custom_headers).value! response.body unless response.nil? end
Create wallet
Create a new custodian wallet.
@param body [WalletParameters] The wallet parameters @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/generated/wallet/wallet_client.rb, line 2316 def create_wallet_async(body, custom_headers:nil) fail ArgumentError, 'body is nil' if body.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Serialize Request request_mapper = Wallet::Models::WalletParameters.mapper() request_content = self.serialize(request_mapper, body) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'api/wallets' request_url = @base_url || self.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:post, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 || status_code == 401 || status_code == 403 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Wallet::Models::CustodianWalletContract.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Create wallet
Create a new custodian wallet.
@param body [WalletParameters] The wallet parameters @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRest::HttpOperationResponse] HTTP response information.
# File lib/generated/wallet/wallet_client.rb, line 2301 def create_wallet_with_http_info(body, custom_headers:nil) create_wallet_async(body, custom_headers:custom_headers).value! end
Delete a connection with the given identifier.
@param wallet_id [String] The wallet identifier. @param connection_id [String] The connection identifier. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
# File lib/generated/wallet/wallet_client.rb, line 294 def delete_connection(wallet_id, connection_id, custom_headers:nil) response = delete_connection_async(wallet_id, connection_id, custom_headers:custom_headers).value! nil end
Delete a connection with the given identifier.
@param wallet_id [String] The wallet identifier. @param connection_id [String] The connection identifier. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/generated/wallet/wallet_client.rb, line 323 def delete_connection_async(wallet_id, connection_id, custom_headers:nil) fail ArgumentError, 'wallet_id is nil' if wallet_id.nil? fail ArgumentError, 'connection_id is nil' if connection_id.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' path_template = 'api/{walletId}/connections/{connectionId}' request_url = @base_url || self.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'walletId' => wallet_id,'connectionId' => connection_id}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:delete, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 || status_code == 401 || status_code == 403 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result end promise.execute end
Delete a connection with the given identifier.
@param wallet_id [String] The wallet identifier. @param connection_id [String] The connection identifier. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRest::HttpOperationResponse] HTTP response information.
# File lib/generated/wallet/wallet_client.rb, line 309 def delete_connection_with_http_info(wallet_id, connection_id, custom_headers:nil) delete_connection_async(wallet_id, connection_id, custom_headers:custom_headers).value! end
Deletes the credential with the given identifier.
@param wallet_id [String] The wallet identifier. @param credential_id [String] The credential identifier. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
# File lib/generated/wallet/wallet_client.rb, line 872 def delete_credential(wallet_id, credential_id, custom_headers:nil) response = delete_credential_async(wallet_id, credential_id, custom_headers:custom_headers).value! nil end
Deletes the credential with the given identifier.
@param wallet_id [String] The wallet identifier. @param credential_id [String] The credential identifier. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/generated/wallet/wallet_client.rb, line 901 def delete_credential_async(wallet_id, credential_id, custom_headers:nil) fail ArgumentError, 'wallet_id is nil' if wallet_id.nil? fail ArgumentError, 'credential_id is nil' if credential_id.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' path_template = 'api/{walletId}/credentials/{credentialId}' request_url = @base_url || self.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'walletId' => wallet_id,'credentialId' => credential_id}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:delete, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 || status_code == 401 || status_code == 403 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result end promise.execute end
Deletes the credential with the given identifier.
@param wallet_id [String] The wallet identifier. @param credential_id [String] The credential identifier. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRest::HttpOperationResponse] HTTP response information.
# File lib/generated/wallet/wallet_client.rb, line 887 def delete_credential_with_http_info(wallet_id, credential_id, custom_headers:nil) delete_credential_async(wallet_id, credential_id, custom_headers:custom_headers).value! end
Deletes the verification with the given identifier.
@param wallet_id [String] The wallet identifier. @param verification_id [String] The verification identifier. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
# File lib/generated/wallet/wallet_client.rb, line 1430 def delete_verification(wallet_id, verification_id, custom_headers:nil) response = delete_verification_async(wallet_id, verification_id, custom_headers:custom_headers).value! nil end
Deletes the verification with the given identifier.
@param wallet_id [String] The wallet identifier. @param verification_id [String] The verification identifier. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/generated/wallet/wallet_client.rb, line 1459 def delete_verification_async(wallet_id, verification_id, custom_headers:nil) fail ArgumentError, 'wallet_id is nil' if wallet_id.nil? fail ArgumentError, 'verification_id is nil' if verification_id.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' path_template = 'api/{walletId}/verifications/{verificationId}' request_url = @base_url || self.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'walletId' => wallet_id,'verificationId' => verification_id}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:delete, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 || status_code == 401 || status_code == 403 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result end promise.execute end
Deletes the verification with the given identifier.
@param wallet_id [String] The wallet identifier. @param verification_id [String] The verification identifier. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRest::HttpOperationResponse] HTTP response information.
# File lib/generated/wallet/wallet_client.rb, line 1445 def delete_verification_with_http_info(wallet_id, verification_id, custom_headers:nil) delete_verification_async(wallet_id, verification_id, custom_headers:custom_headers).value! end
Delete wallet
Permanently delete all connections, credentials and verification records for the specified wallet.
@param wallet_id [String] The wallet identifier @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
# File lib/generated/wallet/wallet_client.rb, line 2458 def delete_wallet(wallet_id, custom_headers:nil) response = delete_wallet_async(wallet_id, custom_headers:custom_headers).value! nil end
Delete wallet
Permanently delete all connections, credentials and verification records for the specified wallet.
@param wallet_id [String] The wallet identifier @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/generated/wallet/wallet_client.rb, line 2491 def delete_wallet_async(wallet_id, custom_headers:nil) fail ArgumentError, 'wallet_id is nil' if wallet_id.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' path_template = 'api/wallets/{walletId}' request_url = @base_url || self.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'walletId' => wallet_id}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:delete, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 || status_code == 401 || status_code == 403 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result end promise.execute end
- Deprecated
-
Delete wallet by query
Please use the DELETE /wallets/{walletId} endpoint instead. Permanently delete all connections, credentials and verification records for the specified wallet.
@param wallet_id [String] The wallet identifier @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
# File lib/generated/wallet/wallet_client.rb, line 2378 def delete_wallet_by_query(wallet_id, custom_headers:nil) response = delete_wallet_by_query_async(wallet_id, custom_headers:custom_headers).value! nil end
- Deprecated
-
Delete wallet by query
Please use the DELETE /wallets/{walletId} endpoint instead. Permanently delete all connections, credentials and verification records for the specified wallet.
@param wallet_id [String] The wallet identifier @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/generated/wallet/wallet_client.rb, line 2413 def delete_wallet_by_query_async(wallet_id, custom_headers:nil) fail ArgumentError, 'wallet_id is nil' if wallet_id.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' path_template = 'api/wallets' request_url = @base_url || self.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], query_params: {'walletId' => wallet_id}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:delete, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 || status_code == 401 || status_code == 403 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result end promise.execute end
- Deprecated
-
Delete wallet by query
Please use the DELETE /wallets/{walletId} endpoint instead. Permanently delete all connections, credentials and verification records for the specified wallet.
@param wallet_id [String] The wallet identifier @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRest::HttpOperationResponse] HTTP response information.
# File lib/generated/wallet/wallet_client.rb, line 2396 def delete_wallet_by_query_with_http_info(wallet_id, custom_headers:nil) delete_wallet_by_query_async(wallet_id, custom_headers:custom_headers).value! end
Delete wallet
Permanently delete all connections, credentials and verification records for the specified wallet.
@param wallet_id [String] The wallet identifier @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRest::HttpOperationResponse] HTTP response information.
# File lib/generated/wallet/wallet_client.rb, line 2475 def delete_wallet_with_http_info(wallet_id, custom_headers:nil) delete_wallet_async(wallet_id, custom_headers:custom_headers).value! end
Gets the available credentials for parameters in a form of URL or proof request data
@param wallet_id [String] The wallet identifier. @param verification_data [String] The verification. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Array] operation results.
# File lib/generated/wallet/wallet_client.rb, line 1997 def get_available_credentials_for_parameters(wallet_id, verification_data, custom_headers:nil) response = get_available_credentials_for_parameters_async(wallet_id, verification_data, custom_headers:custom_headers).value! response.body unless response.nil? end
Gets the available credentials for parameters in a form of URL or proof request data
@param wallet_id [String] The wallet identifier. @param verification_data [String] The verification. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/generated/wallet/wallet_client.rb, line 2028 def get_available_credentials_for_parameters_async(wallet_id, verification_data, custom_headers:nil) fail ArgumentError, 'wallet_id is nil' if wallet_id.nil? fail ArgumentError, 'verification_data is nil' if verification_data.nil? request_headers = {} request_headers['Content-Type'] = 'multipart/form-data' # Set Form Data form_data = {} form_data['verificationData'] = verification_data unless verification_data.nil? path_template = 'api/{walletId}/verifications/fromData/availableCredentials' request_url = @base_url || self.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'walletId' => wallet_id}, headers: request_headers.merge(custom_headers || {}), body: URI.encode_www_form(form_data), base_url: request_url } promise = self.make_request_async(:post, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 || status_code == 401 || status_code == 403 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = { client_side_validation: true, required: false, serialized_name: 'parsed_response', type: { name: 'Sequence', element: { client_side_validation: true, required: false, serialized_name: 'VerificationPolicyCredentialContractElementType', type: { name: 'Composite', class_name: 'VerificationPolicyCredentialContract' } } } } result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Gets the available credentials for parameters in a form of URL or proof request data
@param wallet_id [String] The wallet identifier. @param verification_data [String] The verification. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRest::HttpOperationResponse] HTTP response information.
# File lib/generated/wallet/wallet_client.rb, line 2013 def get_available_credentials_for_parameters_with_http_info(wallet_id, verification_data, custom_headers:nil) get_available_credentials_for_parameters_async(wallet_id, verification_data, custom_headers:custom_headers).value! end
List all credentials for verification
List all available credentials that satisfy the verification request.
@param wallet_id [String] The wallet identifier @param verification_id [String] The verification identifier @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Array] operation results.
# File lib/generated/wallet/wallet_client.rb, line 1804 def get_available_credentials_for_verification(wallet_id, verification_id, custom_headers:nil) response = get_available_credentials_for_verification_async(wallet_id, verification_id, custom_headers:custom_headers).value! response.body unless response.nil? end
List all credentials for verification
List all available credentials that satisfy the verification request.
@param wallet_id [String] The wallet identifier @param verification_id [String] The verification identifier @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/generated/wallet/wallet_client.rb, line 1837 def get_available_credentials_for_verification_async(wallet_id, verification_id, custom_headers:nil) fail ArgumentError, 'wallet_id is nil' if wallet_id.nil? fail ArgumentError, 'verification_id is nil' if verification_id.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' path_template = 'api/{walletId}/verifications/{verificationId}/availableCredentials' request_url = @base_url || self.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'walletId' => wallet_id,'verificationId' => verification_id}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 || status_code == 401 || status_code == 403 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = { client_side_validation: true, required: false, serialized_name: 'parsed_response', type: { name: 'Sequence', element: { client_side_validation: true, required: false, serialized_name: 'VerificationPolicyCredentialContractElementType', type: { name: 'Composite', class_name: 'VerificationPolicyCredentialContract' } } } } result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
List all credentials for verification
List all available credentials that satisfy the verification request.
@param wallet_id [String] The wallet identifier @param verification_id [String] The verification identifier @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRest::HttpOperationResponse] HTTP response information.
# File lib/generated/wallet/wallet_client.rb, line 1821 def get_available_credentials_for_verification_with_http_info(wallet_id, verification_id, custom_headers:nil) get_available_credentials_for_verification_async(wallet_id, verification_id, custom_headers:custom_headers).value! end
Get connection
Get the specified connection in the specified wallet.
@param wallet_id [String] The wallet identifier @param connection_id [String] The connection identifier @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [ConnectionContract] operation results.
# File lib/generated/wallet/wallet_client.rb, line 207 def get_connection(wallet_id, connection_id, custom_headers:nil) response = get_connection_async(wallet_id, connection_id, custom_headers:custom_headers).value! response.body unless response.nil? end
Get connection
Get the specified connection in the specified wallet.
@param wallet_id [String] The wallet identifier @param connection_id [String] The connection identifier @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/generated/wallet/wallet_client.rb, line 240 def get_connection_async(wallet_id, connection_id, custom_headers:nil) fail ArgumentError, 'wallet_id is nil' if wallet_id.nil? fail ArgumentError, 'connection_id is nil' if connection_id.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' path_template = 'api/{walletId}/connections/{connectionId}' request_url = @base_url || self.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'walletId' => wallet_id,'connectionId' => connection_id}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 || status_code == 401 || status_code == 403 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Wallet::Models::ConnectionContract.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Get connection
Get the specified connection in the specified wallet.
@param wallet_id [String] The wallet identifier @param connection_id [String] The connection identifier @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRest::HttpOperationResponse] HTTP response information.
# File lib/generated/wallet/wallet_client.rb, line 224 def get_connection_with_http_info(wallet_id, connection_id, custom_headers:nil) get_connection_async(wallet_id, connection_id, custom_headers:custom_headers).value! end
Get credential
Get the specified credential in the specified wallet.
@param wallet_id [String] The wallet identifier @param credential_id [String] The credential identifier @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [CredentialContract] operation results.
# File lib/generated/wallet/wallet_client.rb, line 785 def get_credential(wallet_id, credential_id, custom_headers:nil) response = get_credential_async(wallet_id, credential_id, custom_headers:custom_headers).value! response.body unless response.nil? end
Get credential
Get the specified credential in the specified wallet.
@param wallet_id [String] The wallet identifier @param credential_id [String] The credential identifier @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/generated/wallet/wallet_client.rb, line 818 def get_credential_async(wallet_id, credential_id, custom_headers:nil) fail ArgumentError, 'wallet_id is nil' if wallet_id.nil? fail ArgumentError, 'credential_id is nil' if credential_id.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' path_template = 'api/{walletId}/credentials/{credentialId}' request_url = @base_url || self.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'walletId' => wallet_id,'credentialId' => credential_id}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 || status_code == 401 || status_code == 403 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Wallet::Models::CredentialContract.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Get credential
Get the specified credential in the specified wallet.
@param wallet_id [String] The wallet identifier @param credential_id [String] The credential identifier @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRest::HttpOperationResponse] HTTP response information.
# File lib/generated/wallet/wallet_client.rb, line 802 def get_credential_with_http_info(wallet_id, credential_id, custom_headers:nil) get_credential_async(wallet_id, credential_id, custom_headers:custom_headers).value! end
Get verification
Get the specified verification in the specified wallet.
@param wallet_id [String] The wallet identifier @param verification_id [String] The verification identifier @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [VerificationContract] operation results.
# File lib/generated/wallet/wallet_client.rb, line 1343 def get_verification(wallet_id, verification_id, custom_headers:nil) response = get_verification_async(wallet_id, verification_id, custom_headers:custom_headers).value! response.body unless response.nil? end
Get verification
Get the specified verification in the specified wallet.
@param wallet_id [String] The wallet identifier @param verification_id [String] The verification identifier @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/generated/wallet/wallet_client.rb, line 1376 def get_verification_async(wallet_id, verification_id, custom_headers:nil) fail ArgumentError, 'wallet_id is nil' if wallet_id.nil? fail ArgumentError, 'verification_id is nil' if verification_id.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' path_template = 'api/{walletId}/verifications/{verificationId}' request_url = @base_url || self.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'walletId' => wallet_id,'verificationId' => verification_id}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 || status_code == 401 || status_code == 403 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Wallet::Models::VerificationContract.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Get verification
Get the specified verification in the specified wallet.
@param wallet_id [String] The wallet identifier @param verification_id [String] The verification identifier @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRest::HttpOperationResponse] HTTP response information.
# File lib/generated/wallet/wallet_client.rb, line 1360 def get_verification_with_http_info(wallet_id, verification_id, custom_headers:nil) get_verification_async(wallet_id, verification_id, custom_headers:custom_headers).value! end
Health check
Check the health of the API.
@param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
# File lib/generated/wallet/wallet_client.rb, line 2534 def health(custom_headers:nil) response = health_async(custom_headers:custom_headers).value! nil end
Health check
Check the health of the API.
@param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/generated/wallet/wallet_client.rb, line 2563 def health_async(custom_headers:nil) request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' path_template = 'health' request_url = @base_url || self.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result end promise.execute end
Health check
Check the health of the API.
@param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRest::HttpOperationResponse] HTTP response information.
# File lib/generated/wallet/wallet_client.rb, line 2549 def health_with_http_info(custom_headers:nil) health_async(custom_headers:custom_headers).value! end
List all connections
List all connections in the specified wallet in the “Connected” state.
@param wallet_id [String] The wallet identifier @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Array] operation results.
# File lib/generated/wallet/wallet_client.rb, line 369 def list_connections(wallet_id, custom_headers:nil) response = list_connections_async(wallet_id, custom_headers:custom_headers).value! response.body unless response.nil? end
List all connections
List all connections in the specified wallet in the “Connected” state.
@param wallet_id [String] The wallet identifier @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/generated/wallet/wallet_client.rb, line 400 def list_connections_async(wallet_id, custom_headers:nil) fail ArgumentError, 'wallet_id is nil' if wallet_id.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' path_template = 'api/{walletId}/connections' request_url = @base_url || self.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'walletId' => wallet_id}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 || status_code == 401 || status_code == 403 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = { client_side_validation: true, required: false, serialized_name: 'parsed_response', type: { name: 'Sequence', element: { client_side_validation: true, required: false, serialized_name: 'ConnectionContractElementType', type: { name: 'Composite', class_name: 'ConnectionContract' } } } } result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
List all connections
List all connections in the specified wallet in the “Connected” state.
@param wallet_id [String] The wallet identifier @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRest::HttpOperationResponse] HTTP response information.
# File lib/generated/wallet/wallet_client.rb, line 385 def list_connections_with_http_info(wallet_id, custom_headers:nil) list_connections_async(wallet_id, custom_headers:custom_headers).value! end
List all credentials
List all credentials in the specified wallet
@param wallet_id [String] @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Array] operation results.
# File lib/generated/wallet/wallet_client.rb, line 682 def list_credentials(wallet_id, custom_headers:nil) response = list_credentials_async(wallet_id, custom_headers:custom_headers).value! response.body unless response.nil? end
List all credentials
List all credentials in the specified wallet
@param wallet_id [String] @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/generated/wallet/wallet_client.rb, line 713 def list_credentials_async(wallet_id, custom_headers:nil) fail ArgumentError, 'wallet_id is nil' if wallet_id.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' path_template = 'api/{walletId}/credentials' request_url = @base_url || self.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'walletId' => wallet_id}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 || status_code == 401 || status_code == 403 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = { client_side_validation: true, required: false, serialized_name: 'parsed_response', type: { name: 'Sequence', element: { client_side_validation: true, required: false, serialized_name: 'CredentialContractElementType', type: { name: 'Composite', class_name: 'CredentialContract' } } } } result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
List all credentials for connection
List all credentials in the specified wallet associated with the specified connection.
@param wallet_id [String] The wallet identifier @param connection_id [String] The connection identifier @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Array] operation results.
# File lib/generated/wallet/wallet_client.rb, line 575 def list_credentials_for_connection_id(wallet_id, connection_id, custom_headers:nil) response = list_credentials_for_connection_id_async(wallet_id, connection_id, custom_headers:custom_headers).value! response.body unless response.nil? end
List all credentials for connection
List all credentials in the specified wallet associated with the specified connection.
@param wallet_id [String] The wallet identifier @param connection_id [String] The connection identifier @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/generated/wallet/wallet_client.rb, line 610 def list_credentials_for_connection_id_async(wallet_id, connection_id, custom_headers:nil) fail ArgumentError, 'wallet_id is nil' if wallet_id.nil? fail ArgumentError, 'connection_id is nil' if connection_id.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' path_template = 'api/{walletId}/credentials/connection/{connectionId}' request_url = @base_url || self.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'walletId' => wallet_id,'connectionId' => connection_id}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 || status_code == 401 || status_code == 403 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = { client_side_validation: true, required: false, serialized_name: 'parsed_response', type: { name: 'Sequence', element: { client_side_validation: true, required: false, serialized_name: 'CredentialContractElementType', type: { name: 'Composite', class_name: 'CredentialContract' } } } } result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
List all credentials for connection
List all credentials in the specified wallet associated with the specified connection.
@param wallet_id [String] The wallet identifier @param connection_id [String] The connection identifier @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRest::HttpOperationResponse] HTTP response information.
# File lib/generated/wallet/wallet_client.rb, line 593 def list_credentials_for_connection_id_with_http_info(wallet_id, connection_id, custom_headers:nil) list_credentials_for_connection_id_async(wallet_id, connection_id, custom_headers:custom_headers).value! end
List all credentials
List all credentials in the specified wallet
@param wallet_id [String] @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRest::HttpOperationResponse] HTTP response information.
# File lib/generated/wallet/wallet_client.rb, line 698 def list_credentials_with_http_info(wallet_id, custom_headers:nil) list_credentials_async(wallet_id, custom_headers:custom_headers).value! end
List connection invitations
List all connection invitations in the specified wallet.
@param wallet_id [String] The wallet identifier @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Array] operation results.
# File lib/generated/wallet/wallet_client.rb, line 471 def list_invitations(wallet_id, custom_headers:nil) response = list_invitations_async(wallet_id, custom_headers:custom_headers).value! response.body unless response.nil? end
List connection invitations
List all connection invitations in the specified wallet.
@param wallet_id [String] The wallet identifier @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/generated/wallet/wallet_client.rb, line 502 def list_invitations_async(wallet_id, custom_headers:nil) fail ArgumentError, 'wallet_id is nil' if wallet_id.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' path_template = 'api/{walletId}/connections/invitations' request_url = @base_url || self.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'walletId' => wallet_id}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 || status_code == 401 || status_code == 403 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = { client_side_validation: true, required: false, serialized_name: 'parsed_response', type: { name: 'Sequence', element: { client_side_validation: true, required: false, serialized_name: 'ConnectionContractElementType', type: { name: 'Composite', class_name: 'ConnectionContract' } } } } result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
List connection invitations
List all connection invitations in the specified wallet.
@param wallet_id [String] The wallet identifier @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRest::HttpOperationResponse] HTTP response information.
# File lib/generated/wallet/wallet_client.rb, line 487 def list_invitations_with_http_info(wallet_id, custom_headers:nil) list_invitations_async(wallet_id, custom_headers:custom_headers).value! end
List all verifications
List all available verifications in the specified wallet.
@param wallet_id [String] The wallet identifier @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Array] operation results.
# File lib/generated/wallet/wallet_client.rb, line 1240 def list_verifications(wallet_id, custom_headers:nil) response = list_verifications_async(wallet_id, custom_headers:custom_headers).value! response.body unless response.nil? end
List all verifications
List all available verifications in the specified wallet.
@param wallet_id [String] The wallet identifier @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/generated/wallet/wallet_client.rb, line 1271 def list_verifications_async(wallet_id, custom_headers:nil) fail ArgumentError, 'wallet_id is nil' if wallet_id.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' path_template = 'api/{walletId}/verifications' request_url = @base_url || self.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'walletId' => wallet_id}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 || status_code == 401 || status_code == 403 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = { client_side_validation: true, required: false, serialized_name: 'parsed_response', type: { name: 'Sequence', element: { client_side_validation: true, required: false, serialized_name: 'VerificationContractElementType', type: { name: 'Composite', class_name: 'VerificationContract' } } } } result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
List all verifications for connection
List all available verifications in the specified wallet for the specified connection.
@param wallet_id [String] The wallet identifier @param connection_id [String] The connection identifier @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Array] operation results.
# File lib/generated/wallet/wallet_client.rb, line 1133 def list_verifications_for_connection(wallet_id, connection_id, custom_headers:nil) response = list_verifications_for_connection_async(wallet_id, connection_id, custom_headers:custom_headers).value! response.body unless response.nil? end
List all verifications for connection
List all available verifications in the specified wallet for the specified connection.
@param wallet_id [String] The wallet identifier @param connection_id [String] The connection identifier @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/generated/wallet/wallet_client.rb, line 1168 def list_verifications_for_connection_async(wallet_id, connection_id, custom_headers:nil) fail ArgumentError, 'wallet_id is nil' if wallet_id.nil? fail ArgumentError, 'connection_id is nil' if connection_id.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' path_template = 'api/{walletId}/verifications/connection/{connectionId}' request_url = @base_url || self.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'walletId' => wallet_id,'connectionId' => connection_id}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 || status_code == 401 || status_code == 403 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = { client_side_validation: true, required: false, serialized_name: 'parsed_response', type: { name: 'Sequence', element: { client_side_validation: true, required: false, serialized_name: 'VerificationContractElementType', type: { name: 'Composite', class_name: 'VerificationContract' } } } } result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
List all verifications for connection
List all available verifications in the specified wallet for the specified connection.
@param wallet_id [String] The wallet identifier @param connection_id [String] The connection identifier @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRest::HttpOperationResponse] HTTP response information.
# File lib/generated/wallet/wallet_client.rb, line 1151 def list_verifications_for_connection_with_http_info(wallet_id, connection_id, custom_headers:nil) list_verifications_for_connection_async(wallet_id, connection_id, custom_headers:custom_headers).value! end
List all verifications
List all available verifications in the specified wallet.
@param wallet_id [String] The wallet identifier @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRest::HttpOperationResponse] HTTP response information.
# File lib/generated/wallet/wallet_client.rb, line 1256 def list_verifications_with_http_info(wallet_id, custom_headers:nil) list_verifications_async(wallet_id, custom_headers:custom_headers).value! end
List all wallets
List all custodian wallets for the current authorization context.
@param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Array] operation results.
# File lib/generated/wallet/wallet_client.rb, line 2187 def list_wallets(custom_headers:nil) response = list_wallets_async(custom_headers:custom_headers).value! response.body unless response.nil? end
List all wallets
List all custodian wallets for the current authorization context.
@param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/generated/wallet/wallet_client.rb, line 2216 def list_wallets_async(custom_headers:nil) request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' path_template = 'api/wallets' request_url = @base_url || self.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:get, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 || status_code == 401 || status_code == 403 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = { client_side_validation: true, required: false, serialized_name: 'parsed_response', type: { name: 'Sequence', element: { client_side_validation: true, required: false, serialized_name: 'CustodianWalletContractElementType', type: { name: 'Composite', class_name: 'CustodianWalletContract' } } } } result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
List all wallets
List all custodian wallets for the current authorization context.
@param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRest::HttpOperationResponse] HTTP response information.
# File lib/generated/wallet/wallet_client.rb, line 2202 def list_wallets_with_http_info(custom_headers:nil) list_wallets_async(custom_headers:custom_headers).value! end
Makes a request and returns the body of the response. @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete. @param path [String] the path, relative to {base_url}. @param options [Hash{String=>String}] specifying any request options like :body. @return [Hash{String=>String}] containing the body of the response. Example:
request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}" path = "/path" options = { body: request_content, query_params: {'api-version' => '2016-02-01'} } result = @client.make_request(:put, path, options)
# File lib/generated/wallet/wallet_client.rb, line 52 def make_request(method, path, options = {}) result = make_request_with_http_info(method, path, options) result.body unless result.nil? end
Makes a request asynchronously. @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete. @param path [String] the path, relative to {base_url}. @param options [Hash{String=>String}] specifying any request options like :body. @return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/generated/wallet/wallet_client.rb, line 77 def make_request_async(method, path, options = {}) fail ArgumentError, 'method is nil' if method.nil? fail ArgumentError, 'path is nil' if path.nil? request_url = options[:base_url] || @base_url if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?) @request_headers['Content-Type'] = options[:headers]['Content-Type'] end request_headers = @request_headers options.merge!({headers: request_headers.merge(options[:headers] || {})}) options.merge!({credentials: @credentials}) unless @credentials.nil? super(request_url, method, path, options) end
Makes a request and returns the operation response. @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete. @param path [String] the path, relative to {base_url}. @param options [Hash{String=>String}] specifying any request options like :body. @return [MsRest::HttpOperationResponse] Operation response containing the request, response and status.
# File lib/generated/wallet/wallet_client.rb, line 64 def make_request_with_http_info(method, path, options = {}) result = make_request_async(method, path, options).value! result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body) result end
Create verification proposal
Create a verification proposal from the specified policy
@param wallet_id [String] The wallet identifier @param connection_id [String] The connection identifier @param body [VerificationPolicyParameters] The proposal policy @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [VerificationContract] operation results.
# File lib/generated/wallet/wallet_client.rb, line 1616 def propose_verification(wallet_id, connection_id, body, custom_headers:nil) response = propose_verification_async(wallet_id, connection_id, body, custom_headers:custom_headers).value! response.body unless response.nil? end
Create verification proposal
Create a verification proposal from the specified policy
@param wallet_id [String] The wallet identifier @param connection_id [String] The connection identifier @param body [VerificationPolicyParameters] The proposal policy @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/generated/wallet/wallet_client.rb, line 1651 def propose_verification_async(wallet_id, connection_id, body, custom_headers:nil) fail ArgumentError, 'wallet_id is nil' if wallet_id.nil? fail ArgumentError, 'connection_id is nil' if connection_id.nil? fail ArgumentError, 'body is nil' if body.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Serialize Request request_mapper = Wallet::Models::VerificationPolicyParameters.mapper() request_content = self.serialize(request_mapper, body) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'api/{walletId}/verifications/propose/{connectionId}' request_url = @base_url || self.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'walletId' => wallet_id,'connectionId' => connection_id}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:put, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 || status_code == 401 || status_code == 403 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end # Deserialize Response if status_code == 200 begin parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) result_mapper = Wallet::Models::VerificationContract.mapper() result.body = self.deserialize(result_mapper, parsed_response) rescue Exception => e fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) end end result end promise.execute end
Create verification proposal
Create a verification proposal from the specified policy
@param wallet_id [String] The wallet identifier @param connection_id [String] The connection identifier @param body [VerificationPolicyParameters] The proposal policy @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRest::HttpOperationResponse] HTTP response information.
# File lib/generated/wallet/wallet_client.rb, line 1634 def propose_verification_with_http_info(wallet_id, connection_id, body, custom_headers:nil) propose_verification_async(wallet_id, connection_id, body, custom_headers:custom_headers).value! end
Submit verification using policy parameters
Submit the verification using the provided policy parameters.
@param wallet_id [String] The wallet identifier @param verification_id [String] The verification identifier @param body [Array<VerificationPolicyCredentialParameters>] The verification policy parameters @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
# File lib/generated/wallet/wallet_client.rb, line 1507 def submit_verification(wallet_id, verification_id, body, custom_headers:nil) response = submit_verification_async(wallet_id, verification_id, body, custom_headers:custom_headers).value! nil end
Submit verification using policy parameters
Submit the verification using the provided policy parameters.
@param wallet_id [String] The wallet identifier @param verification_id [String] The verification identifier @param body [Array<VerificationPolicyCredentialParameters>] The verification policy parameters @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/generated/wallet/wallet_client.rb, line 1544 def submit_verification_async(wallet_id, verification_id, body, custom_headers:nil) fail ArgumentError, 'wallet_id is nil' if wallet_id.nil? fail ArgumentError, 'verification_id is nil' if verification_id.nil? fail ArgumentError, 'body is nil' if body.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Serialize Request request_mapper = { client_side_validation: true, required: true, serialized_name: 'body', type: { name: 'Sequence', element: { client_side_validation: true, required: false, serialized_name: 'VerificationPolicyCredentialParametersElementType', type: { name: 'Composite', class_name: 'VerificationPolicyCredentialParameters' } } } } request_content = self.serialize(request_mapper, body) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'api/{walletId}/verifications/{verificationId}' request_url = @base_url || self.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'walletId' => wallet_id,'verificationId' => verification_id}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:put, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 || status_code == 401 || status_code == 403 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result end promise.execute end
Submit verification with automatic credential selection
Submit the verification with a credential that matches the requested information. If a credential is not available for a certain policy, that policy will not be included in the submitted verification.
@param wallet_id [String] The wallet identifier @param verification_id [String] The verification identifier @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
# File lib/generated/wallet/wallet_client.rb, line 1718 def submit_verification_auto_select(wallet_id, verification_id, custom_headers:nil) response = submit_verification_auto_select_async(wallet_id, verification_id, custom_headers:custom_headers).value! nil end
Submit verification with automatic credential selection
Submit the verification with a credential that matches the requested information. If a credential is not available for a certain policy, that policy will not be included in the submitted verification.
@param wallet_id [String] The wallet identifier @param verification_id [String] The verification identifier @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/generated/wallet/wallet_client.rb, line 1757 def submit_verification_auto_select_async(wallet_id, verification_id, custom_headers:nil) fail ArgumentError, 'wallet_id is nil' if wallet_id.nil? fail ArgumentError, 'verification_id is nil' if verification_id.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' path_template = 'api/{walletId}/verifications/{verificationId}/autoSelect' request_url = @base_url || self.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'walletId' => wallet_id,'verificationId' => verification_id}, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:put, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 || status_code == 401 || status_code == 403 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result end promise.execute end
Submit verification with automatic credential selection
Submit the verification with a credential that matches the requested information. If a credential is not available for a certain policy, that policy will not be included in the submitted verification.
@param wallet_id [String] The wallet identifier @param verification_id [String] The verification identifier @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRest::HttpOperationResponse] HTTP response information.
# File lib/generated/wallet/wallet_client.rb, line 1738 def submit_verification_auto_select_with_http_info(wallet_id, verification_id, custom_headers:nil) submit_verification_auto_select_async(wallet_id, verification_id, custom_headers:custom_headers).value! end
Submit verification using the provided policy parameters
@param wallet_id [String] The wallet identifier. @param body [VerificationDataPolicyCredentialParameters] The verification parameters. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
# File lib/generated/wallet/wallet_client.rb, line 2105 def submit_verification_for_parameters(wallet_id, body:nil, custom_headers:nil) response = submit_verification_for_parameters_async(wallet_id, body:body, custom_headers:custom_headers).value! nil end
Submit verification using the provided policy parameters
@param wallet_id [String] The wallet identifier. @param body [VerificationDataPolicyCredentialParameters] The verification parameters. @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/generated/wallet/wallet_client.rb, line 2136 def submit_verification_for_parameters_async(wallet_id, body:nil, custom_headers:nil) fail ArgumentError, 'wallet_id is nil' if wallet_id.nil? request_headers = {} request_headers['Content-Type'] = 'application/json; charset=utf-8' # Serialize Request request_mapper = Wallet::Models::VerificationDataPolicyCredentialParameters.mapper() request_content = self.serialize(request_mapper, body) request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil path_template = 'api/{walletId}/verifications/fromData' request_url = @base_url || self.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'walletId' => wallet_id}, body: request_content, headers: request_headers.merge(custom_headers || {}), base_url: request_url } promise = self.make_request_async(:put, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 || status_code == 401 || status_code == 403 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result end promise.execute end
Submit verification using the provided policy parameters
@param wallet_id [String] The wallet identifier. @param body [VerificationDataPolicyCredentialParameters] The verification parameters. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRest::HttpOperationResponse] HTTP response information.
# File lib/generated/wallet/wallet_client.rb, line 2121 def submit_verification_for_parameters_with_http_info(wallet_id, body:nil, custom_headers:nil) submit_verification_for_parameters_async(wallet_id, body:body, custom_headers:custom_headers).value! end
Submit verification with automatic credential selection from data
Submit the verification from data with automatic credential selection. Verification data can be in the form of a URL or base64 data.
@param wallet_id [String] The wallet identifier @param verification_data [String] The verification @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
# File lib/generated/wallet/wallet_client.rb, line 1910 def submit_verification_from_data_auto_select(wallet_id, verification_data, custom_headers:nil) response = submit_verification_from_data_auto_select_async(wallet_id, verification_data, custom_headers:custom_headers).value! nil end
Submit verification with automatic credential selection from data
Submit the verification from data with automatic credential selection. Verification data can be in the form of a URL or base64 data.
@param wallet_id [String] The wallet identifier @param verification_data [String] The verification @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [Concurrent::Promise] Promise object which holds the HTTP response.
# File lib/generated/wallet/wallet_client.rb, line 1945 def submit_verification_from_data_auto_select_async(wallet_id, verification_data, custom_headers:nil) fail ArgumentError, 'wallet_id is nil' if wallet_id.nil? fail ArgumentError, 'verification_data is nil' if verification_data.nil? request_headers = {} request_headers['Content-Type'] = 'multipart/form-data' # Set Form Data form_data = {} form_data['verificationData'] = verification_data unless verification_data.nil? path_template = 'api/{walletId}/verifications/fromData/autoSelect' request_url = @base_url || self.base_url options = { middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], path_params: {'walletId' => wallet_id}, headers: request_headers.merge(custom_headers || {}), body: URI.encode_www_form(form_data), base_url: request_url } promise = self.make_request_async(:put, path_template, options) promise = promise.then do |result| http_response = result.response status_code = http_response.status response_content = http_response.body unless status_code == 200 || status_code == 401 || status_code == 403 error_model = JSON.load(response_content) fail MsRest::HttpOperationError.new(result.request, http_response, error_model) end result end promise.execute end
Submit verification with automatic credential selection from data
Submit the verification from data with automatic credential selection. Verification data can be in the form of a URL or base64 data.
@param wallet_id [String] The wallet identifier @param verification_data [String] The verification @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRest::HttpOperationResponse] HTTP response information.
# File lib/generated/wallet/wallet_client.rb, line 1928 def submit_verification_from_data_auto_select_with_http_info(wallet_id, verification_data, custom_headers:nil) submit_verification_from_data_auto_select_async(wallet_id, verification_data, custom_headers:custom_headers).value! end
Submit verification using policy parameters
Submit the verification using the provided policy parameters.
@param wallet_id [String] The wallet identifier @param verification_id [String] The verification identifier @param body [Array<VerificationPolicyCredentialParameters>] The verification policy parameters @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.
@return [MsRest::HttpOperationResponse] HTTP response information.
# File lib/generated/wallet/wallet_client.rb, line 1526 def submit_verification_with_http_info(wallet_id, verification_id, body, custom_headers:nil) submit_verification_async(wallet_id, verification_id, body, custom_headers:custom_headers).value! end
Private Instance Methods
Adds telemetry information.
# File lib/generated/wallet/wallet_client.rb, line 2600 def add_telemetry sdk_information = 'wallet' sdk_information = "#{sdk_information}/1.1.5018" add_user_agent_information(sdk_information) end