trinsic_service_clients 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +7 -0
  3. data/LICENSE.txt +21 -0
  4. data/README.md +0 -0
  5. data/lib/trinsic_service_clients.rb +12 -0
  6. data/lib/trinsic_service_clients/credentials.rb +68 -0
  7. data/lib/trinsic_service_clients/credentials/credentials_client.rb +4702 -0
  8. data/lib/trinsic_service_clients/credentials/models/agent_endpoint.rb +77 -0
  9. data/lib/trinsic_service_clients/credentials/models/attribute_filter.rb +111 -0
  10. data/lib/trinsic_service_clients/credentials/models/attribute_value.rb +55 -0
  11. data/lib/trinsic_service_clients/credentials/models/basic_message_contract.rb +76 -0
  12. data/lib/trinsic_service_clients/credentials/models/basic_message_parameters.rb +54 -0
  13. data/lib/trinsic_service_clients/credentials/models/basic_message_record.rb +124 -0
  14. data/lib/trinsic_service_clients/credentials/models/connection_contract.rb +178 -0
  15. data/lib/trinsic_service_clients/credentials/models/connection_invitation_parameters.rb +71 -0
  16. data/lib/trinsic_service_clients/credentials/models/credential_contract.rb +152 -0
  17. data/lib/trinsic_service_clients/credentials/models/credential_definition_contract.rb +107 -0
  18. data/lib/trinsic_service_clients/credentials/models/credential_definition_from_schema_parameters.rb +97 -0
  19. data/lib/trinsic_service_clients/credentials/models/credential_definition_parameters.rb +55 -0
  20. data/lib/trinsic_service_clients/credentials/models/credential_offer_parameters.rb +90 -0
  21. data/lib/trinsic_service_clients/credentials/models/issuer_status_contract.rb +111 -0
  22. data/lib/trinsic_service_clients/credentials/models/network_contract.rb +77 -0
  23. data/lib/trinsic_service_clients/credentials/models/network_txn_agreement_contract.rb +73 -0
  24. data/lib/trinsic_service_clients/credentials/models/proof_attribute_contract.rb +108 -0
  25. data/lib/trinsic_service_clients/credentials/models/proof_attribute_info.rb +95 -0
  26. data/lib/trinsic_service_clients/credentials/models/proof_predicate_info.rb +117 -0
  27. data/lib/trinsic_service_clients/credentials/models/proof_proposal.rb +84 -0
  28. data/lib/trinsic_service_clients/credentials/models/proof_request.rb +118 -0
  29. data/lib/trinsic_service_clients/credentials/models/proposed_attribute.rb +110 -0
  30. data/lib/trinsic_service_clients/credentials/models/proposed_predicate.rb +110 -0
  31. data/lib/trinsic_service_clients/credentials/models/revocation_interval.rb +55 -0
  32. data/lib/trinsic_service_clients/credentials/models/schema_parameters.rb +73 -0
  33. data/lib/trinsic_service_clients/credentials/models/schema_record.rb +121 -0
  34. data/lib/trinsic_service_clients/credentials/models/tenant_contract.rb +91 -0
  35. data/lib/trinsic_service_clients/credentials/models/tenant_extended_information_contract.rb +123 -0
  36. data/lib/trinsic_service_clients/credentials/models/tenant_parameters.rb +90 -0
  37. data/lib/trinsic_service_clients/credentials/models/verification_contract.rb +188 -0
  38. data/lib/trinsic_service_clients/credentials/models/verification_definition_contract.rb +56 -0
  39. data/lib/trinsic_service_clients/credentials/models/verification_parameters.rb +54 -0
  40. data/lib/trinsic_service_clients/credentials/models/verification_policy_attribute_contract.rb +83 -0
  41. data/lib/trinsic_service_clients/credentials/models/verification_policy_contract.rb +118 -0
  42. data/lib/trinsic_service_clients/credentials/models/verification_policy_parameters.rb +107 -0
  43. data/lib/trinsic_service_clients/credentials/models/verification_policy_predicate_contract.rb +97 -0
  44. data/lib/trinsic_service_clients/credentials/models/verification_policy_restriction.rb +111 -0
  45. data/lib/trinsic_service_clients/credentials/models/verification_policy_restriction_attribute.rb +55 -0
  46. data/lib/trinsic_service_clients/credentials/models/verification_policy_revocation_requirement.rb +44 -0
  47. data/lib/trinsic_service_clients/credentials/models/verification_result.rb +64 -0
  48. data/lib/trinsic_service_clients/credentials/models/webhook_contract.rb +78 -0
  49. data/lib/trinsic_service_clients/credentials/models/webhook_parameters.rb +67 -0
  50. data/lib/trinsic_service_clients/credentials/module_definition.rb +6 -0
  51. data/lib/trinsic_service_clients/credentials/version.rb +8 -0
  52. data/lib/trinsic_service_clients/provider.rb +35 -0
  53. data/lib/trinsic_service_clients/provider/models/asset_contract.rb +43 -0
  54. data/lib/trinsic_service_clients/provider/models/cloud_wallet_analytics_contract.rb +43 -0
  55. data/lib/trinsic_service_clients/provider/models/network_contract.rb +77 -0
  56. data/lib/trinsic_service_clients/provider/models/tenant_contract.rb +91 -0
  57. data/lib/trinsic_service_clients/provider/models/tenant_extended_information_contract.rb +123 -0
  58. data/lib/trinsic_service_clients/provider/models/tenant_keys_contract.rb +55 -0
  59. data/lib/trinsic_service_clients/provider/models/tenant_parameters.rb +101 -0
  60. data/lib/trinsic_service_clients/provider/models/tenant_update_parameters.rb +54 -0
  61. data/lib/trinsic_service_clients/provider/models/usage_contract.rb +87 -0
  62. data/lib/trinsic_service_clients/provider/module_definition.rb +6 -0
  63. data/lib/trinsic_service_clients/provider/provider_client.rb +826 -0
  64. data/lib/trinsic_service_clients/provider/version.rb +8 -0
  65. data/lib/trinsic_service_clients/wallet.rb +44 -0
  66. data/lib/trinsic_service_clients/wallet/models/agent_endpoint.rb +77 -0
  67. data/lib/trinsic_service_clients/wallet/models/connection_contract.rb +178 -0
  68. data/lib/trinsic_service_clients/wallet/models/credential_contract.rb +152 -0
  69. data/lib/trinsic_service_clients/wallet/models/custodian_wallet_contract.rb +54 -0
  70. data/lib/trinsic_service_clients/wallet/models/proof_attribute_contract.rb +108 -0
  71. data/lib/trinsic_service_clients/wallet/models/proof_proposal.rb +84 -0
  72. data/lib/trinsic_service_clients/wallet/models/proposed_attribute.rb +110 -0
  73. data/lib/trinsic_service_clients/wallet/models/proposed_predicate.rb +110 -0
  74. data/lib/trinsic_service_clients/wallet/models/verification_contract.rb +188 -0
  75. data/lib/trinsic_service_clients/wallet/models/verification_policy_attribute_contract.rb +83 -0
  76. data/lib/trinsic_service_clients/wallet/models/verification_policy_credential_contract.rb +83 -0
  77. data/lib/trinsic_service_clients/wallet/models/verification_policy_credential_parameters.rb +66 -0
  78. data/lib/trinsic_service_clients/wallet/models/verification_policy_parameters.rb +107 -0
  79. data/lib/trinsic_service_clients/wallet/models/verification_policy_predicate_contract.rb +97 -0
  80. data/lib/trinsic_service_clients/wallet/models/verification_policy_restriction.rb +111 -0
  81. data/lib/trinsic_service_clients/wallet/models/verification_policy_restriction_attribute.rb +55 -0
  82. data/lib/trinsic_service_clients/wallet/models/verification_policy_revocation_reqirement.rb +44 -0
  83. data/lib/trinsic_service_clients/wallet/models/wallet_parameters.rb +58 -0
  84. data/lib/trinsic_service_clients/wallet/module_definition.rb +6 -0
  85. data/lib/trinsic_service_clients/wallet/version.rb +8 -0
  86. data/lib/trinsic_service_clients/wallet/wallet_client.rb +2045 -0
  87. data/trinsic_service_clients-0.0.0.gem +0 -0
  88. data/trinsic_service_clients.gemspec +13 -0
  89. metadata +129 -0
@@ -0,0 +1,97 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Wallet
7
+ module Models
8
+ #
9
+ # Model object.
10
+ #
11
+ #
12
+ class VerificationPolicyPredicateContract
13
+ # @return [String]
14
+ attr_accessor :policy_name
15
+
16
+ # @return [String]
17
+ attr_accessor :attribute_name
18
+
19
+ # @return [String]
20
+ attr_accessor :predicate_type
21
+
22
+ # @return [Integer]
23
+ attr_accessor :predicate_value
24
+
25
+ # @return [Array<VerificationPolicyRestriction>]
26
+ attr_accessor :restrictions
27
+
28
+
29
+ #
30
+ # Mapper for VerificationPolicyPredicateContract class as Ruby Hash.
31
+ # This will be used for serialization/deserialization.
32
+ #
33
+ def self.mapper()
34
+ {
35
+ client_side_validation: true,
36
+ required: false,
37
+ serialized_name: 'VerificationPolicyPredicateContract',
38
+ type: {
39
+ name: 'Composite',
40
+ class_name: 'VerificationPolicyPredicateContract',
41
+ model_properties: {
42
+ policy_name: {
43
+ client_side_validation: true,
44
+ required: true,
45
+ serialized_name: 'policyName',
46
+ type: {
47
+ name: 'String'
48
+ }
49
+ },
50
+ attribute_name: {
51
+ client_side_validation: true,
52
+ required: true,
53
+ serialized_name: 'attributeName',
54
+ type: {
55
+ name: 'String'
56
+ }
57
+ },
58
+ predicate_type: {
59
+ client_side_validation: true,
60
+ required: true,
61
+ serialized_name: 'predicateType',
62
+ type: {
63
+ name: 'String'
64
+ }
65
+ },
66
+ predicate_value: {
67
+ client_side_validation: true,
68
+ required: true,
69
+ serialized_name: 'predicateValue',
70
+ type: {
71
+ name: 'Number'
72
+ }
73
+ },
74
+ restrictions: {
75
+ client_side_validation: true,
76
+ required: false,
77
+ serialized_name: 'restrictions',
78
+ type: {
79
+ name: 'Sequence',
80
+ element: {
81
+ client_side_validation: true,
82
+ required: false,
83
+ serialized_name: 'VerificationPolicyRestrictionElementType',
84
+ type: {
85
+ name: 'Composite',
86
+ class_name: 'VerificationPolicyRestriction'
87
+ }
88
+ }
89
+ }
90
+ }
91
+ }
92
+ }
93
+ }
94
+ end
95
+ end
96
+ end
97
+ end
@@ -0,0 +1,111 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Wallet
7
+ module Models
8
+ #
9
+ # Model object.
10
+ #
11
+ #
12
+ class VerificationPolicyRestriction
13
+ # @return [String]
14
+ attr_accessor :schema_id
15
+
16
+ # @return [String]
17
+ attr_accessor :schema_issuer_did
18
+
19
+ # @return [String]
20
+ attr_accessor :schema_name
21
+
22
+ # @return [String]
23
+ attr_accessor :schema_version
24
+
25
+ # @return [String]
26
+ attr_accessor :issuer_did
27
+
28
+ # @return [String]
29
+ attr_accessor :credential_definition_id
30
+
31
+ # @return [VerificationPolicyRestrictionAttribute]
32
+ attr_accessor :value
33
+
34
+
35
+ #
36
+ # Mapper for VerificationPolicyRestriction class as Ruby Hash.
37
+ # This will be used for serialization/deserialization.
38
+ #
39
+ def self.mapper()
40
+ {
41
+ client_side_validation: true,
42
+ required: false,
43
+ serialized_name: 'VerificationPolicyRestriction',
44
+ type: {
45
+ name: 'Composite',
46
+ class_name: 'VerificationPolicyRestriction',
47
+ model_properties: {
48
+ schema_id: {
49
+ client_side_validation: true,
50
+ required: false,
51
+ serialized_name: 'schemaId',
52
+ type: {
53
+ name: 'String'
54
+ }
55
+ },
56
+ schema_issuer_did: {
57
+ client_side_validation: true,
58
+ required: false,
59
+ serialized_name: 'schemaIssuerDid',
60
+ type: {
61
+ name: 'String'
62
+ }
63
+ },
64
+ schema_name: {
65
+ client_side_validation: true,
66
+ required: false,
67
+ serialized_name: 'schemaName',
68
+ type: {
69
+ name: 'String'
70
+ }
71
+ },
72
+ schema_version: {
73
+ client_side_validation: true,
74
+ required: false,
75
+ serialized_name: 'schemaVersion',
76
+ type: {
77
+ name: 'String'
78
+ }
79
+ },
80
+ issuer_did: {
81
+ client_side_validation: true,
82
+ required: false,
83
+ serialized_name: 'issuerDid',
84
+ type: {
85
+ name: 'String'
86
+ }
87
+ },
88
+ credential_definition_id: {
89
+ client_side_validation: true,
90
+ required: false,
91
+ serialized_name: 'credentialDefinitionId',
92
+ type: {
93
+ name: 'String'
94
+ }
95
+ },
96
+ value: {
97
+ client_side_validation: true,
98
+ required: false,
99
+ serialized_name: 'value',
100
+ type: {
101
+ name: 'Composite',
102
+ class_name: 'VerificationPolicyRestrictionAttribute'
103
+ }
104
+ }
105
+ }
106
+ }
107
+ }
108
+ end
109
+ end
110
+ end
111
+ end
@@ -0,0 +1,55 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Wallet
7
+ module Models
8
+ #
9
+ # Model object.
10
+ #
11
+ #
12
+ class VerificationPolicyRestrictionAttribute
13
+ # @return [String]
14
+ attr_accessor :attribute_name
15
+
16
+ # @return [String]
17
+ attr_accessor :attribute_value
18
+
19
+
20
+ #
21
+ # Mapper for VerificationPolicyRestrictionAttribute class as Ruby Hash.
22
+ # This will be used for serialization/deserialization.
23
+ #
24
+ def self.mapper()
25
+ {
26
+ client_side_validation: true,
27
+ required: false,
28
+ serialized_name: 'VerificationPolicyRestrictionAttribute',
29
+ type: {
30
+ name: 'Composite',
31
+ class_name: 'VerificationPolicyRestrictionAttribute',
32
+ model_properties: {
33
+ attribute_name: {
34
+ client_side_validation: true,
35
+ required: false,
36
+ serialized_name: 'attributeName',
37
+ type: {
38
+ name: 'String'
39
+ }
40
+ },
41
+ attribute_value: {
42
+ client_side_validation: true,
43
+ required: false,
44
+ serialized_name: 'attributeValue',
45
+ type: {
46
+ name: 'String'
47
+ }
48
+ }
49
+ }
50
+ }
51
+ }
52
+ end
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,44 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Wallet
7
+ module Models
8
+ #
9
+ # Model object.
10
+ #
11
+ #
12
+ class VerificationPolicyRevocationReqirement
13
+ # @return [DateTime]
14
+ attr_accessor :valid_at
15
+
16
+
17
+ #
18
+ # Mapper for VerificationPolicyRevocationReqirement class as Ruby Hash.
19
+ # This will be used for serialization/deserialization.
20
+ #
21
+ def self.mapper()
22
+ {
23
+ client_side_validation: true,
24
+ required: false,
25
+ serialized_name: 'VerificationPolicyRevocationReqirement',
26
+ type: {
27
+ name: 'Composite',
28
+ class_name: 'VerificationPolicyRevocationReqirement',
29
+ model_properties: {
30
+ valid_at: {
31
+ client_side_validation: true,
32
+ required: false,
33
+ serialized_name: 'validAt',
34
+ type: {
35
+ name: 'DateTime'
36
+ }
37
+ }
38
+ }
39
+ }
40
+ }
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,58 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Wallet
7
+ module Models
8
+ #
9
+ # Wallet parameters
10
+ #
11
+ class WalletParameters
12
+ # @return [String] The wallet identifier
13
+ # <remarks>
14
+ # This property can be null. If not set, a unique identifier will be
15
+ # generated
16
+ # </remarks>
17
+ attr_accessor :wallet_id
18
+
19
+ # @return [String] The owner name
20
+ attr_accessor :owner_name
21
+
22
+
23
+ #
24
+ # Mapper for WalletParameters class as Ruby Hash.
25
+ # This will be used for serialization/deserialization.
26
+ #
27
+ def self.mapper()
28
+ {
29
+ client_side_validation: true,
30
+ required: false,
31
+ serialized_name: 'WalletParameters',
32
+ type: {
33
+ name: 'Composite',
34
+ class_name: 'WalletParameters',
35
+ model_properties: {
36
+ wallet_id: {
37
+ client_side_validation: true,
38
+ required: false,
39
+ serialized_name: 'walletId',
40
+ type: {
41
+ name: 'String'
42
+ }
43
+ },
44
+ owner_name: {
45
+ client_side_validation: true,
46
+ required: false,
47
+ serialized_name: 'ownerName',
48
+ type: {
49
+ name: 'String'
50
+ }
51
+ }
52
+ }
53
+ }
54
+ }
55
+ end
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,6 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Wallet end
@@ -0,0 +1,8 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Wallet
7
+ VERSION = '1.1.4000'
8
+ end
@@ -0,0 +1,2045 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Wallet
7
+ #
8
+ # A service client - single point of access to the REST API.
9
+ #
10
+ class WalletClient < MsRest::ServiceClient
11
+ include MsRest::Serialization
12
+
13
+ # @return [String] the base URI of the service.
14
+ attr_accessor :base_url
15
+
16
+ # @return Subscription credentials which uniquely identify client
17
+ # subscription.
18
+ attr_accessor :credentials
19
+
20
+ #
21
+ # Creates initializes a new instance of the WalletClient class.
22
+ # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
23
+ # @param base_url [String] the base URI of the service.
24
+ # @param options [Array] filters to be applied to the HTTP requests.
25
+ #
26
+ def initialize(credentials = nil, base_url = nil, options = nil)
27
+ super(credentials, options)
28
+ @base_url = base_url || 'https://api.trinsic.id/wallet/v1'
29
+
30
+ fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
31
+ @credentials = credentials
32
+
33
+ add_telemetry
34
+ end
35
+
36
+ #
37
+ # Makes a request and returns the body of the response.
38
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
39
+ # @param path [String] the path, relative to {base_url}.
40
+ # @param options [Hash{String=>String}] specifying any request options like :body.
41
+ # @return [Hash{String=>String}] containing the body of the response.
42
+ # Example:
43
+ #
44
+ # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
45
+ # path = "/path"
46
+ # options = {
47
+ # body: request_content,
48
+ # query_params: {'api-version' => '2016-02-01'}
49
+ # }
50
+ # result = @client.make_request(:put, path, options)
51
+ #
52
+ def make_request(method, path, options = {})
53
+ result = make_request_with_http_info(method, path, options)
54
+ result.body unless result.nil?
55
+ end
56
+
57
+ #
58
+ # Makes a request and returns the operation response.
59
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
60
+ # @param path [String] the path, relative to {base_url}.
61
+ # @param options [Hash{String=>String}] specifying any request options like :body.
62
+ # @return [MsRest::HttpOperationResponse] Operation response containing the request, response and status.
63
+ #
64
+ def make_request_with_http_info(method, path, options = {})
65
+ result = make_request_async(method, path, options).value!
66
+ result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
67
+ result
68
+ end
69
+
70
+ #
71
+ # Makes a request asynchronously.
72
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
73
+ # @param path [String] the path, relative to {base_url}.
74
+ # @param options [Hash{String=>String}] specifying any request options like :body.
75
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
76
+ #
77
+ def make_request_async(method, path, options = {})
78
+ fail ArgumentError, 'method is nil' if method.nil?
79
+ fail ArgumentError, 'path is nil' if path.nil?
80
+
81
+ request_url = options[:base_url] || @base_url
82
+ if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
83
+ @request_headers['Content-Type'] = options[:headers]['Content-Type']
84
+ end
85
+
86
+ request_headers = @request_headers
87
+ options.merge!({headers: request_headers.merge(options[:headers] || {})})
88
+ options.merge!({credentials: @credentials}) unless @credentials.nil?
89
+
90
+ super(request_url, method, path, options)
91
+ end
92
+
93
+ #
94
+ # Accept connection invitation
95
+ #
96
+ # Accept a connection invitation in the specified wallet.
97
+ # The invitation can be in a form of URL or invitation JSON encoded as base64
98
+ # data.
99
+ #
100
+ # @param wallet_id [String] The wallet identifier
101
+ # @param invitation [String]
102
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
103
+ # will be added to the HTTP request.
104
+ #
105
+ # @return [ConnectionContract] operation results.
106
+ #
107
+ def accept_invitation(wallet_id, invitation, custom_headers:nil)
108
+ response = accept_invitation_async(wallet_id, invitation, custom_headers:custom_headers).value!
109
+ response.body unless response.nil?
110
+ end
111
+
112
+ #
113
+ # Accept connection invitation
114
+ #
115
+ # Accept a connection invitation in the specified wallet.
116
+ # The invitation can be in a form of URL or invitation JSON encoded as base64
117
+ # data.
118
+ #
119
+ # @param wallet_id [String] The wallet identifier
120
+ # @param invitation [String]
121
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
122
+ # will be added to the HTTP request.
123
+ #
124
+ # @return [MsRest::HttpOperationResponse] HTTP response information.
125
+ #
126
+ def accept_invitation_with_http_info(wallet_id, invitation, custom_headers:nil)
127
+ accept_invitation_async(wallet_id, invitation, custom_headers:custom_headers).value!
128
+ end
129
+
130
+ #
131
+ # Accept connection invitation
132
+ #
133
+ # Accept a connection invitation in the specified wallet.
134
+ # The invitation can be in a form of URL or invitation JSON encoded as base64
135
+ # data.
136
+ #
137
+ # @param wallet_id [String] The wallet identifier
138
+ # @param invitation [String]
139
+ # @param [Hash{String => String}] A hash of custom headers that will be added
140
+ # to the HTTP request.
141
+ #
142
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
143
+ #
144
+ def accept_invitation_async(wallet_id, invitation, custom_headers:nil)
145
+ fail ArgumentError, 'wallet_id is nil' if wallet_id.nil?
146
+ fail ArgumentError, 'invitation is nil' if invitation.nil?
147
+
148
+
149
+ request_headers = {}
150
+ request_headers['Content-Type'] = 'multipart/form-data'
151
+
152
+ # Set Form Data
153
+ form_data = {}
154
+ form_data['invitation'] = invitation unless invitation.nil?
155
+
156
+ path_template = 'api/{walletId}/connections/invitation'
157
+
158
+ request_url = @base_url || self.base_url
159
+
160
+ options = {
161
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
162
+ path_params: {'walletId' => wallet_id},
163
+ headers: request_headers.merge(custom_headers || {}),
164
+ body: URI.encode_www_form(form_data),
165
+ base_url: request_url
166
+ }
167
+ promise = self.make_request_async(:post, path_template, options)
168
+
169
+ promise = promise.then do |result|
170
+ http_response = result.response
171
+ status_code = http_response.status
172
+ response_content = http_response.body
173
+ unless status_code == 200 || status_code == 401 || status_code == 403
174
+ error_model = JSON.load(response_content)
175
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
176
+ end
177
+
178
+ # Deserialize Response
179
+ if status_code == 200
180
+ begin
181
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
182
+ result_mapper = Wallet::Models::ConnectionContract.mapper()
183
+ result.body = self.deserialize(result_mapper, parsed_response)
184
+ rescue Exception => e
185
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
186
+ end
187
+ end
188
+
189
+ result
190
+ end
191
+
192
+ promise.execute
193
+ end
194
+
195
+ #
196
+ # Get connection
197
+ #
198
+ # Get the specified connection in the specified wallet.
199
+ #
200
+ # @param wallet_id [String] The wallet identifier
201
+ # @param connection_id [String] The connection identifier
202
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
203
+ # will be added to the HTTP request.
204
+ #
205
+ # @return [ConnectionContract] operation results.
206
+ #
207
+ def get_connection(wallet_id, connection_id, custom_headers:nil)
208
+ response = get_connection_async(wallet_id, connection_id, custom_headers:custom_headers).value!
209
+ response.body unless response.nil?
210
+ end
211
+
212
+ #
213
+ # Get connection
214
+ #
215
+ # Get the specified connection in the specified wallet.
216
+ #
217
+ # @param wallet_id [String] The wallet identifier
218
+ # @param connection_id [String] The connection identifier
219
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
220
+ # will be added to the HTTP request.
221
+ #
222
+ # @return [MsRest::HttpOperationResponse] HTTP response information.
223
+ #
224
+ def get_connection_with_http_info(wallet_id, connection_id, custom_headers:nil)
225
+ get_connection_async(wallet_id, connection_id, custom_headers:custom_headers).value!
226
+ end
227
+
228
+ #
229
+ # Get connection
230
+ #
231
+ # Get the specified connection in the specified wallet.
232
+ #
233
+ # @param wallet_id [String] The wallet identifier
234
+ # @param connection_id [String] The connection identifier
235
+ # @param [Hash{String => String}] A hash of custom headers that will be added
236
+ # to the HTTP request.
237
+ #
238
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
239
+ #
240
+ def get_connection_async(wallet_id, connection_id, custom_headers:nil)
241
+ fail ArgumentError, 'wallet_id is nil' if wallet_id.nil?
242
+ fail ArgumentError, 'connection_id is nil' if connection_id.nil?
243
+
244
+
245
+ request_headers = {}
246
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
247
+ path_template = 'api/{walletId}/connections/{connectionId}'
248
+
249
+ request_url = @base_url || self.base_url
250
+
251
+ options = {
252
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
253
+ path_params: {'walletId' => wallet_id,'connectionId' => connection_id},
254
+ headers: request_headers.merge(custom_headers || {}),
255
+ base_url: request_url
256
+ }
257
+ promise = self.make_request_async(:get, path_template, options)
258
+
259
+ promise = promise.then do |result|
260
+ http_response = result.response
261
+ status_code = http_response.status
262
+ response_content = http_response.body
263
+ unless status_code == 200 || status_code == 401 || status_code == 403
264
+ error_model = JSON.load(response_content)
265
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
266
+ end
267
+
268
+ # Deserialize Response
269
+ if status_code == 200
270
+ begin
271
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
272
+ result_mapper = Wallet::Models::ConnectionContract.mapper()
273
+ result.body = self.deserialize(result_mapper, parsed_response)
274
+ rescue Exception => e
275
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
276
+ end
277
+ end
278
+
279
+ result
280
+ end
281
+
282
+ promise.execute
283
+ end
284
+
285
+ #
286
+ # List all connections
287
+ #
288
+ # List all connections in the specified wallet in the "Connected" state.
289
+ #
290
+ # @param wallet_id [String] The wallet identifier
291
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
292
+ # will be added to the HTTP request.
293
+ #
294
+ # @return [Array] operation results.
295
+ #
296
+ def list_connections(wallet_id, custom_headers:nil)
297
+ response = list_connections_async(wallet_id, custom_headers:custom_headers).value!
298
+ response.body unless response.nil?
299
+ end
300
+
301
+ #
302
+ # List all connections
303
+ #
304
+ # List all connections in the specified wallet in the "Connected" state.
305
+ #
306
+ # @param wallet_id [String] The wallet identifier
307
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
308
+ # will be added to the HTTP request.
309
+ #
310
+ # @return [MsRest::HttpOperationResponse] HTTP response information.
311
+ #
312
+ def list_connections_with_http_info(wallet_id, custom_headers:nil)
313
+ list_connections_async(wallet_id, custom_headers:custom_headers).value!
314
+ end
315
+
316
+ #
317
+ # List all connections
318
+ #
319
+ # List all connections in the specified wallet in the "Connected" state.
320
+ #
321
+ # @param wallet_id [String] The wallet identifier
322
+ # @param [Hash{String => String}] A hash of custom headers that will be added
323
+ # to the HTTP request.
324
+ #
325
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
326
+ #
327
+ def list_connections_async(wallet_id, custom_headers:nil)
328
+ fail ArgumentError, 'wallet_id is nil' if wallet_id.nil?
329
+
330
+
331
+ request_headers = {}
332
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
333
+ path_template = 'api/{walletId}/connections'
334
+
335
+ request_url = @base_url || self.base_url
336
+
337
+ options = {
338
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
339
+ path_params: {'walletId' => wallet_id},
340
+ headers: request_headers.merge(custom_headers || {}),
341
+ base_url: request_url
342
+ }
343
+ promise = self.make_request_async(:get, path_template, options)
344
+
345
+ promise = promise.then do |result|
346
+ http_response = result.response
347
+ status_code = http_response.status
348
+ response_content = http_response.body
349
+ unless status_code == 200 || status_code == 401 || status_code == 403
350
+ error_model = JSON.load(response_content)
351
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
352
+ end
353
+
354
+ # Deserialize Response
355
+ if status_code == 200
356
+ begin
357
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
358
+ result_mapper = {
359
+ client_side_validation: true,
360
+ required: false,
361
+ serialized_name: 'parsed_response',
362
+ type: {
363
+ name: 'Sequence',
364
+ element: {
365
+ client_side_validation: true,
366
+ required: false,
367
+ serialized_name: 'ConnectionContractElementType',
368
+ type: {
369
+ name: 'Composite',
370
+ class_name: 'ConnectionContract'
371
+ }
372
+ }
373
+ }
374
+ }
375
+ result.body = self.deserialize(result_mapper, parsed_response)
376
+ rescue Exception => e
377
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
378
+ end
379
+ end
380
+
381
+ result
382
+ end
383
+
384
+ promise.execute
385
+ end
386
+
387
+ #
388
+ # List connection invitations
389
+ #
390
+ # List all connection invitations in the specified wallet.
391
+ #
392
+ # @param wallet_id [String] The wallet identifier
393
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
394
+ # will be added to the HTTP request.
395
+ #
396
+ # @return [Array] operation results.
397
+ #
398
+ def list_invitations(wallet_id, custom_headers:nil)
399
+ response = list_invitations_async(wallet_id, custom_headers:custom_headers).value!
400
+ response.body unless response.nil?
401
+ end
402
+
403
+ #
404
+ # List connection invitations
405
+ #
406
+ # List all connection invitations in the specified wallet.
407
+ #
408
+ # @param wallet_id [String] The wallet identifier
409
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
410
+ # will be added to the HTTP request.
411
+ #
412
+ # @return [MsRest::HttpOperationResponse] HTTP response information.
413
+ #
414
+ def list_invitations_with_http_info(wallet_id, custom_headers:nil)
415
+ list_invitations_async(wallet_id, custom_headers:custom_headers).value!
416
+ end
417
+
418
+ #
419
+ # List connection invitations
420
+ #
421
+ # List all connection invitations in the specified wallet.
422
+ #
423
+ # @param wallet_id [String] The wallet identifier
424
+ # @param [Hash{String => String}] A hash of custom headers that will be added
425
+ # to the HTTP request.
426
+ #
427
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
428
+ #
429
+ def list_invitations_async(wallet_id, custom_headers:nil)
430
+ fail ArgumentError, 'wallet_id is nil' if wallet_id.nil?
431
+
432
+
433
+ request_headers = {}
434
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
435
+ path_template = 'api/{walletId}/connections/invitations'
436
+
437
+ request_url = @base_url || self.base_url
438
+
439
+ options = {
440
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
441
+ path_params: {'walletId' => wallet_id},
442
+ headers: request_headers.merge(custom_headers || {}),
443
+ base_url: request_url
444
+ }
445
+ promise = self.make_request_async(:get, path_template, options)
446
+
447
+ promise = promise.then do |result|
448
+ http_response = result.response
449
+ status_code = http_response.status
450
+ response_content = http_response.body
451
+ unless status_code == 200 || status_code == 401 || status_code == 403
452
+ error_model = JSON.load(response_content)
453
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
454
+ end
455
+
456
+ # Deserialize Response
457
+ if status_code == 200
458
+ begin
459
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
460
+ result_mapper = {
461
+ client_side_validation: true,
462
+ required: false,
463
+ serialized_name: 'parsed_response',
464
+ type: {
465
+ name: 'Sequence',
466
+ element: {
467
+ client_side_validation: true,
468
+ required: false,
469
+ serialized_name: 'ConnectionContractElementType',
470
+ type: {
471
+ name: 'Composite',
472
+ class_name: 'ConnectionContract'
473
+ }
474
+ }
475
+ }
476
+ }
477
+ result.body = self.deserialize(result_mapper, parsed_response)
478
+ rescue Exception => e
479
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
480
+ end
481
+ end
482
+
483
+ result
484
+ end
485
+
486
+ promise.execute
487
+ end
488
+
489
+ #
490
+ # List all credentials for connection
491
+ #
492
+ # List all credentials in the specified wallet associated with the specified
493
+ # connection.
494
+ #
495
+ # @param wallet_id [String] The wallet identifier
496
+ # @param connection_id [String] The connection identifier
497
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
498
+ # will be added to the HTTP request.
499
+ #
500
+ # @return [Array] operation results.
501
+ #
502
+ def list_credentials_for_connection_id(wallet_id, connection_id, custom_headers:nil)
503
+ response = list_credentials_for_connection_id_async(wallet_id, connection_id, custom_headers:custom_headers).value!
504
+ response.body unless response.nil?
505
+ end
506
+
507
+ #
508
+ # List all credentials for connection
509
+ #
510
+ # List all credentials in the specified wallet associated with the specified
511
+ # connection.
512
+ #
513
+ # @param wallet_id [String] The wallet identifier
514
+ # @param connection_id [String] The connection identifier
515
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
516
+ # will be added to the HTTP request.
517
+ #
518
+ # @return [MsRest::HttpOperationResponse] HTTP response information.
519
+ #
520
+ def list_credentials_for_connection_id_with_http_info(wallet_id, connection_id, custom_headers:nil)
521
+ list_credentials_for_connection_id_async(wallet_id, connection_id, custom_headers:custom_headers).value!
522
+ end
523
+
524
+ #
525
+ # List all credentials for connection
526
+ #
527
+ # List all credentials in the specified wallet associated with the specified
528
+ # connection.
529
+ #
530
+ # @param wallet_id [String] The wallet identifier
531
+ # @param connection_id [String] The connection identifier
532
+ # @param [Hash{String => String}] A hash of custom headers that will be added
533
+ # to the HTTP request.
534
+ #
535
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
536
+ #
537
+ def list_credentials_for_connection_id_async(wallet_id, connection_id, custom_headers:nil)
538
+ fail ArgumentError, 'wallet_id is nil' if wallet_id.nil?
539
+ fail ArgumentError, 'connection_id is nil' if connection_id.nil?
540
+
541
+
542
+ request_headers = {}
543
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
544
+ path_template = 'api/{walletId}/credentials/connection/{connectionId}'
545
+
546
+ request_url = @base_url || self.base_url
547
+
548
+ options = {
549
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
550
+ path_params: {'walletId' => wallet_id,'connectionId' => connection_id},
551
+ headers: request_headers.merge(custom_headers || {}),
552
+ base_url: request_url
553
+ }
554
+ promise = self.make_request_async(:get, path_template, options)
555
+
556
+ promise = promise.then do |result|
557
+ http_response = result.response
558
+ status_code = http_response.status
559
+ response_content = http_response.body
560
+ unless status_code == 200 || status_code == 401 || status_code == 403
561
+ error_model = JSON.load(response_content)
562
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
563
+ end
564
+
565
+ # Deserialize Response
566
+ if status_code == 200
567
+ begin
568
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
569
+ result_mapper = {
570
+ client_side_validation: true,
571
+ required: false,
572
+ serialized_name: 'parsed_response',
573
+ type: {
574
+ name: 'Sequence',
575
+ element: {
576
+ client_side_validation: true,
577
+ required: false,
578
+ serialized_name: 'CredentialContractElementType',
579
+ type: {
580
+ name: 'Composite',
581
+ class_name: 'CredentialContract'
582
+ }
583
+ }
584
+ }
585
+ }
586
+ result.body = self.deserialize(result_mapper, parsed_response)
587
+ rescue Exception => e
588
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
589
+ end
590
+ end
591
+
592
+ result
593
+ end
594
+
595
+ promise.execute
596
+ end
597
+
598
+ #
599
+ # List all credentials
600
+ #
601
+ # List all credentials in the specified wallet
602
+ #
603
+ # @param wallet_id [String]
604
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
605
+ # will be added to the HTTP request.
606
+ #
607
+ # @return [Array] operation results.
608
+ #
609
+ def list_credentials(wallet_id, custom_headers:nil)
610
+ response = list_credentials_async(wallet_id, custom_headers:custom_headers).value!
611
+ response.body unless response.nil?
612
+ end
613
+
614
+ #
615
+ # List all credentials
616
+ #
617
+ # List all credentials in the specified wallet
618
+ #
619
+ # @param wallet_id [String]
620
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
621
+ # will be added to the HTTP request.
622
+ #
623
+ # @return [MsRest::HttpOperationResponse] HTTP response information.
624
+ #
625
+ def list_credentials_with_http_info(wallet_id, custom_headers:nil)
626
+ list_credentials_async(wallet_id, custom_headers:custom_headers).value!
627
+ end
628
+
629
+ #
630
+ # List all credentials
631
+ #
632
+ # List all credentials in the specified wallet
633
+ #
634
+ # @param wallet_id [String]
635
+ # @param [Hash{String => String}] A hash of custom headers that will be added
636
+ # to the HTTP request.
637
+ #
638
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
639
+ #
640
+ def list_credentials_async(wallet_id, custom_headers:nil)
641
+ fail ArgumentError, 'wallet_id is nil' if wallet_id.nil?
642
+
643
+
644
+ request_headers = {}
645
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
646
+ path_template = 'api/{walletId}/credentials'
647
+
648
+ request_url = @base_url || self.base_url
649
+
650
+ options = {
651
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
652
+ path_params: {'walletId' => wallet_id},
653
+ headers: request_headers.merge(custom_headers || {}),
654
+ base_url: request_url
655
+ }
656
+ promise = self.make_request_async(:get, path_template, options)
657
+
658
+ promise = promise.then do |result|
659
+ http_response = result.response
660
+ status_code = http_response.status
661
+ response_content = http_response.body
662
+ unless status_code == 200 || status_code == 401 || status_code == 403
663
+ error_model = JSON.load(response_content)
664
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
665
+ end
666
+
667
+ # Deserialize Response
668
+ if status_code == 200
669
+ begin
670
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
671
+ result_mapper = {
672
+ client_side_validation: true,
673
+ required: false,
674
+ serialized_name: 'parsed_response',
675
+ type: {
676
+ name: 'Sequence',
677
+ element: {
678
+ client_side_validation: true,
679
+ required: false,
680
+ serialized_name: 'CredentialContractElementType',
681
+ type: {
682
+ name: 'Composite',
683
+ class_name: 'CredentialContract'
684
+ }
685
+ }
686
+ }
687
+ }
688
+ result.body = self.deserialize(result_mapper, parsed_response)
689
+ rescue Exception => e
690
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
691
+ end
692
+ end
693
+
694
+ result
695
+ end
696
+
697
+ promise.execute
698
+ end
699
+
700
+ #
701
+ # Get credential
702
+ #
703
+ # Get the specified credential in the specified wallet.
704
+ #
705
+ # @param wallet_id [String] The wallet identifier
706
+ # @param credential_id [String] The credential identifier
707
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
708
+ # will be added to the HTTP request.
709
+ #
710
+ # @return [CredentialContract] operation results.
711
+ #
712
+ def get_credential(wallet_id, credential_id, custom_headers:nil)
713
+ response = get_credential_async(wallet_id, credential_id, custom_headers:custom_headers).value!
714
+ response.body unless response.nil?
715
+ end
716
+
717
+ #
718
+ # Get credential
719
+ #
720
+ # Get the specified credential in the specified wallet.
721
+ #
722
+ # @param wallet_id [String] The wallet identifier
723
+ # @param credential_id [String] The credential identifier
724
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
725
+ # will be added to the HTTP request.
726
+ #
727
+ # @return [MsRest::HttpOperationResponse] HTTP response information.
728
+ #
729
+ def get_credential_with_http_info(wallet_id, credential_id, custom_headers:nil)
730
+ get_credential_async(wallet_id, credential_id, custom_headers:custom_headers).value!
731
+ end
732
+
733
+ #
734
+ # Get credential
735
+ #
736
+ # Get the specified credential in the specified wallet.
737
+ #
738
+ # @param wallet_id [String] The wallet identifier
739
+ # @param credential_id [String] The credential identifier
740
+ # @param [Hash{String => String}] A hash of custom headers that will be added
741
+ # to the HTTP request.
742
+ #
743
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
744
+ #
745
+ def get_credential_async(wallet_id, credential_id, custom_headers:nil)
746
+ fail ArgumentError, 'wallet_id is nil' if wallet_id.nil?
747
+ fail ArgumentError, 'credential_id is nil' if credential_id.nil?
748
+
749
+
750
+ request_headers = {}
751
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
752
+ path_template = 'api/{walletId}/credentials/{credentialId}'
753
+
754
+ request_url = @base_url || self.base_url
755
+
756
+ options = {
757
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
758
+ path_params: {'walletId' => wallet_id,'credentialId' => credential_id},
759
+ headers: request_headers.merge(custom_headers || {}),
760
+ base_url: request_url
761
+ }
762
+ promise = self.make_request_async(:get, path_template, options)
763
+
764
+ promise = promise.then do |result|
765
+ http_response = result.response
766
+ status_code = http_response.status
767
+ response_content = http_response.body
768
+ unless status_code == 200 || status_code == 401 || status_code == 403
769
+ error_model = JSON.load(response_content)
770
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
771
+ end
772
+
773
+ # Deserialize Response
774
+ if status_code == 200
775
+ begin
776
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
777
+ result_mapper = Wallet::Models::CredentialContract.mapper()
778
+ result.body = self.deserialize(result_mapper, parsed_response)
779
+ rescue Exception => e
780
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
781
+ end
782
+ end
783
+
784
+ result
785
+ end
786
+
787
+ promise.execute
788
+ end
789
+
790
+ #
791
+ # Accept credential offer
792
+ #
793
+ # Accept the specified credential offer in the specified wallet.
794
+ #
795
+ # @param wallet_id [String] The wallet identifier
796
+ # @param credential_id [String] The credential identifier
797
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
798
+ # will be added to the HTTP request.
799
+ #
800
+ #
801
+ def accept_credential_offer(wallet_id, credential_id, custom_headers:nil)
802
+ response = accept_credential_offer_async(wallet_id, credential_id, custom_headers:custom_headers).value!
803
+ nil
804
+ end
805
+
806
+ #
807
+ # Accept credential offer
808
+ #
809
+ # Accept the specified credential offer in the specified wallet.
810
+ #
811
+ # @param wallet_id [String] The wallet identifier
812
+ # @param credential_id [String] The credential identifier
813
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
814
+ # will be added to the HTTP request.
815
+ #
816
+ # @return [MsRest::HttpOperationResponse] HTTP response information.
817
+ #
818
+ def accept_credential_offer_with_http_info(wallet_id, credential_id, custom_headers:nil)
819
+ accept_credential_offer_async(wallet_id, credential_id, custom_headers:custom_headers).value!
820
+ end
821
+
822
+ #
823
+ # Accept credential offer
824
+ #
825
+ # Accept the specified credential offer in the specified wallet.
826
+ #
827
+ # @param wallet_id [String] The wallet identifier
828
+ # @param credential_id [String] The credential identifier
829
+ # @param [Hash{String => String}] A hash of custom headers that will be added
830
+ # to the HTTP request.
831
+ #
832
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
833
+ #
834
+ def accept_credential_offer_async(wallet_id, credential_id, custom_headers:nil)
835
+ fail ArgumentError, 'wallet_id is nil' if wallet_id.nil?
836
+ fail ArgumentError, 'credential_id is nil' if credential_id.nil?
837
+
838
+
839
+ request_headers = {}
840
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
841
+ path_template = 'api/{walletId}/credentials/{credentialId}'
842
+
843
+ request_url = @base_url || self.base_url
844
+
845
+ options = {
846
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
847
+ path_params: {'walletId' => wallet_id,'credentialId' => credential_id},
848
+ headers: request_headers.merge(custom_headers || {}),
849
+ base_url: request_url
850
+ }
851
+ promise = self.make_request_async(:post, path_template, options)
852
+
853
+ promise = promise.then do |result|
854
+ http_response = result.response
855
+ status_code = http_response.status
856
+ response_content = http_response.body
857
+ unless status_code == 200 || status_code == 401 || status_code == 403
858
+ error_model = JSON.load(response_content)
859
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
860
+ end
861
+
862
+
863
+ result
864
+ end
865
+
866
+ promise.execute
867
+ end
868
+
869
+ #
870
+ # Accept credential offer from URL or data
871
+ #
872
+ # Accept a credential offer using the provided URL or data.
873
+ # The credential field can be in the form of a URL or JSON encoded as base64
874
+ # data.
875
+ # This endpoint is used to accept connectionless credential issuance.
876
+ #
877
+ # @param wallet_id [String] The wallet identifier
878
+ # @param credential_data [String]
879
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
880
+ # will be added to the HTTP request.
881
+ #
882
+ # @return [CredentialContract] operation results.
883
+ #
884
+ def accept_credential(wallet_id, credential_data, custom_headers:nil)
885
+ response = accept_credential_async(wallet_id, credential_data, custom_headers:custom_headers).value!
886
+ response.body unless response.nil?
887
+ end
888
+
889
+ #
890
+ # Accept credential offer from URL or data
891
+ #
892
+ # Accept a credential offer using the provided URL or data.
893
+ # The credential field can be in the form of a URL or JSON encoded as base64
894
+ # data.
895
+ # This endpoint is used to accept connectionless credential issuance.
896
+ #
897
+ # @param wallet_id [String] The wallet identifier
898
+ # @param credential_data [String]
899
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
900
+ # will be added to the HTTP request.
901
+ #
902
+ # @return [MsRest::HttpOperationResponse] HTTP response information.
903
+ #
904
+ def accept_credential_with_http_info(wallet_id, credential_data, custom_headers:nil)
905
+ accept_credential_async(wallet_id, credential_data, custom_headers:custom_headers).value!
906
+ end
907
+
908
+ #
909
+ # Accept credential offer from URL or data
910
+ #
911
+ # Accept a credential offer using the provided URL or data.
912
+ # The credential field can be in the form of a URL or JSON encoded as base64
913
+ # data.
914
+ # This endpoint is used to accept connectionless credential issuance.
915
+ #
916
+ # @param wallet_id [String] The wallet identifier
917
+ # @param credential_data [String]
918
+ # @param [Hash{String => String}] A hash of custom headers that will be added
919
+ # to the HTTP request.
920
+ #
921
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
922
+ #
923
+ def accept_credential_async(wallet_id, credential_data, custom_headers:nil)
924
+ fail ArgumentError, 'wallet_id is nil' if wallet_id.nil?
925
+ fail ArgumentError, 'credential_data is nil' if credential_data.nil?
926
+
927
+
928
+ request_headers = {}
929
+ request_headers['Content-Type'] = 'multipart/form-data'
930
+
931
+ # Set Form Data
932
+ form_data = {}
933
+ form_data['credentialData'] = credential_data unless credential_data.nil?
934
+
935
+ path_template = 'api/{walletId}/credentials/fromData'
936
+
937
+ request_url = @base_url || self.base_url
938
+
939
+ options = {
940
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
941
+ path_params: {'walletId' => wallet_id},
942
+ headers: request_headers.merge(custom_headers || {}),
943
+ body: URI.encode_www_form(form_data),
944
+ base_url: request_url
945
+ }
946
+ promise = self.make_request_async(:put, path_template, options)
947
+
948
+ promise = promise.then do |result|
949
+ http_response = result.response
950
+ status_code = http_response.status
951
+ response_content = http_response.body
952
+ unless status_code == 200 || status_code == 401 || status_code == 403
953
+ error_model = JSON.load(response_content)
954
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
955
+ end
956
+
957
+ # Deserialize Response
958
+ if status_code == 200
959
+ begin
960
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
961
+ result_mapper = Wallet::Models::CredentialContract.mapper()
962
+ result.body = self.deserialize(result_mapper, parsed_response)
963
+ rescue Exception => e
964
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
965
+ end
966
+ end
967
+
968
+ result
969
+ end
970
+
971
+ promise.execute
972
+ end
973
+
974
+ #
975
+ # List all verifications for connection
976
+ #
977
+ # List all available verifications in the specified wallet for the specified
978
+ # connection.
979
+ #
980
+ # @param wallet_id [String] The wallet identifier
981
+ # @param connection_id [String] The connection identifier
982
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
983
+ # will be added to the HTTP request.
984
+ #
985
+ # @return [Array] operation results.
986
+ #
987
+ def list_verifications_for_connection(wallet_id, connection_id, custom_headers:nil)
988
+ response = list_verifications_for_connection_async(wallet_id, connection_id, custom_headers:custom_headers).value!
989
+ response.body unless response.nil?
990
+ end
991
+
992
+ #
993
+ # List all verifications for connection
994
+ #
995
+ # List all available verifications in the specified wallet for the specified
996
+ # connection.
997
+ #
998
+ # @param wallet_id [String] The wallet identifier
999
+ # @param connection_id [String] The connection identifier
1000
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1001
+ # will be added to the HTTP request.
1002
+ #
1003
+ # @return [MsRest::HttpOperationResponse] HTTP response information.
1004
+ #
1005
+ def list_verifications_for_connection_with_http_info(wallet_id, connection_id, custom_headers:nil)
1006
+ list_verifications_for_connection_async(wallet_id, connection_id, custom_headers:custom_headers).value!
1007
+ end
1008
+
1009
+ #
1010
+ # List all verifications for connection
1011
+ #
1012
+ # List all available verifications in the specified wallet for the specified
1013
+ # connection.
1014
+ #
1015
+ # @param wallet_id [String] The wallet identifier
1016
+ # @param connection_id [String] The connection identifier
1017
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1018
+ # to the HTTP request.
1019
+ #
1020
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1021
+ #
1022
+ def list_verifications_for_connection_async(wallet_id, connection_id, custom_headers:nil)
1023
+ fail ArgumentError, 'wallet_id is nil' if wallet_id.nil?
1024
+ fail ArgumentError, 'connection_id is nil' if connection_id.nil?
1025
+
1026
+
1027
+ request_headers = {}
1028
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1029
+ path_template = 'api/{walletId}/verifications/connection/{connectionId}'
1030
+
1031
+ request_url = @base_url || self.base_url
1032
+
1033
+ options = {
1034
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1035
+ path_params: {'walletId' => wallet_id,'connectionId' => connection_id},
1036
+ headers: request_headers.merge(custom_headers || {}),
1037
+ base_url: request_url
1038
+ }
1039
+ promise = self.make_request_async(:get, path_template, options)
1040
+
1041
+ promise = promise.then do |result|
1042
+ http_response = result.response
1043
+ status_code = http_response.status
1044
+ response_content = http_response.body
1045
+ unless status_code == 200 || status_code == 401 || status_code == 403
1046
+ error_model = JSON.load(response_content)
1047
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1048
+ end
1049
+
1050
+ # Deserialize Response
1051
+ if status_code == 200
1052
+ begin
1053
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1054
+ result_mapper = {
1055
+ client_side_validation: true,
1056
+ required: false,
1057
+ serialized_name: 'parsed_response',
1058
+ type: {
1059
+ name: 'Sequence',
1060
+ element: {
1061
+ client_side_validation: true,
1062
+ required: false,
1063
+ serialized_name: 'VerificationContractElementType',
1064
+ type: {
1065
+ name: 'Composite',
1066
+ class_name: 'VerificationContract'
1067
+ }
1068
+ }
1069
+ }
1070
+ }
1071
+ result.body = self.deserialize(result_mapper, parsed_response)
1072
+ rescue Exception => e
1073
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1074
+ end
1075
+ end
1076
+
1077
+ result
1078
+ end
1079
+
1080
+ promise.execute
1081
+ end
1082
+
1083
+ #
1084
+ # List all verifications
1085
+ #
1086
+ # List all available verifications in the specified wallet.
1087
+ #
1088
+ # @param wallet_id [String] The wallet identifier
1089
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1090
+ # will be added to the HTTP request.
1091
+ #
1092
+ # @return [Array] operation results.
1093
+ #
1094
+ def list_verifications(wallet_id, custom_headers:nil)
1095
+ response = list_verifications_async(wallet_id, custom_headers:custom_headers).value!
1096
+ response.body unless response.nil?
1097
+ end
1098
+
1099
+ #
1100
+ # List all verifications
1101
+ #
1102
+ # List all available verifications in the specified wallet.
1103
+ #
1104
+ # @param wallet_id [String] The wallet identifier
1105
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1106
+ # will be added to the HTTP request.
1107
+ #
1108
+ # @return [MsRest::HttpOperationResponse] HTTP response information.
1109
+ #
1110
+ def list_verifications_with_http_info(wallet_id, custom_headers:nil)
1111
+ list_verifications_async(wallet_id, custom_headers:custom_headers).value!
1112
+ end
1113
+
1114
+ #
1115
+ # List all verifications
1116
+ #
1117
+ # List all available verifications in the specified wallet.
1118
+ #
1119
+ # @param wallet_id [String] The wallet identifier
1120
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1121
+ # to the HTTP request.
1122
+ #
1123
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1124
+ #
1125
+ def list_verifications_async(wallet_id, custom_headers:nil)
1126
+ fail ArgumentError, 'wallet_id is nil' if wallet_id.nil?
1127
+
1128
+
1129
+ request_headers = {}
1130
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1131
+ path_template = 'api/{walletId}/verifications'
1132
+
1133
+ request_url = @base_url || self.base_url
1134
+
1135
+ options = {
1136
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1137
+ path_params: {'walletId' => wallet_id},
1138
+ headers: request_headers.merge(custom_headers || {}),
1139
+ base_url: request_url
1140
+ }
1141
+ promise = self.make_request_async(:get, path_template, options)
1142
+
1143
+ promise = promise.then do |result|
1144
+ http_response = result.response
1145
+ status_code = http_response.status
1146
+ response_content = http_response.body
1147
+ unless status_code == 200 || status_code == 401 || status_code == 403
1148
+ error_model = JSON.load(response_content)
1149
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1150
+ end
1151
+
1152
+ # Deserialize Response
1153
+ if status_code == 200
1154
+ begin
1155
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1156
+ result_mapper = {
1157
+ client_side_validation: true,
1158
+ required: false,
1159
+ serialized_name: 'parsed_response',
1160
+ type: {
1161
+ name: 'Sequence',
1162
+ element: {
1163
+ client_side_validation: true,
1164
+ required: false,
1165
+ serialized_name: 'VerificationContractElementType',
1166
+ type: {
1167
+ name: 'Composite',
1168
+ class_name: 'VerificationContract'
1169
+ }
1170
+ }
1171
+ }
1172
+ }
1173
+ result.body = self.deserialize(result_mapper, parsed_response)
1174
+ rescue Exception => e
1175
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1176
+ end
1177
+ end
1178
+
1179
+ result
1180
+ end
1181
+
1182
+ promise.execute
1183
+ end
1184
+
1185
+ #
1186
+ # Get verification
1187
+ #
1188
+ # Get the specified verification in the specified wallet.
1189
+ #
1190
+ # @param wallet_id [String] The wallet identifier
1191
+ # @param verification_id [String] The verification identifier
1192
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1193
+ # will be added to the HTTP request.
1194
+ #
1195
+ # @return [VerificationContract] operation results.
1196
+ #
1197
+ def get_verification(wallet_id, verification_id, custom_headers:nil)
1198
+ response = get_verification_async(wallet_id, verification_id, custom_headers:custom_headers).value!
1199
+ response.body unless response.nil?
1200
+ end
1201
+
1202
+ #
1203
+ # Get verification
1204
+ #
1205
+ # Get the specified verification in the specified wallet.
1206
+ #
1207
+ # @param wallet_id [String] The wallet identifier
1208
+ # @param verification_id [String] The verification identifier
1209
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1210
+ # will be added to the HTTP request.
1211
+ #
1212
+ # @return [MsRest::HttpOperationResponse] HTTP response information.
1213
+ #
1214
+ def get_verification_with_http_info(wallet_id, verification_id, custom_headers:nil)
1215
+ get_verification_async(wallet_id, verification_id, custom_headers:custom_headers).value!
1216
+ end
1217
+
1218
+ #
1219
+ # Get verification
1220
+ #
1221
+ # Get the specified verification in the specified wallet.
1222
+ #
1223
+ # @param wallet_id [String] The wallet identifier
1224
+ # @param verification_id [String] The verification identifier
1225
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1226
+ # to the HTTP request.
1227
+ #
1228
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1229
+ #
1230
+ def get_verification_async(wallet_id, verification_id, custom_headers:nil)
1231
+ fail ArgumentError, 'wallet_id is nil' if wallet_id.nil?
1232
+ fail ArgumentError, 'verification_id is nil' if verification_id.nil?
1233
+
1234
+
1235
+ request_headers = {}
1236
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1237
+ path_template = 'api/{walletId}/verifications/{verificationId}'
1238
+
1239
+ request_url = @base_url || self.base_url
1240
+
1241
+ options = {
1242
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1243
+ path_params: {'walletId' => wallet_id,'verificationId' => verification_id},
1244
+ headers: request_headers.merge(custom_headers || {}),
1245
+ base_url: request_url
1246
+ }
1247
+ promise = self.make_request_async(:get, path_template, options)
1248
+
1249
+ promise = promise.then do |result|
1250
+ http_response = result.response
1251
+ status_code = http_response.status
1252
+ response_content = http_response.body
1253
+ unless status_code == 200 || status_code == 401 || status_code == 403
1254
+ error_model = JSON.load(response_content)
1255
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1256
+ end
1257
+
1258
+ # Deserialize Response
1259
+ if status_code == 200
1260
+ begin
1261
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1262
+ result_mapper = Wallet::Models::VerificationContract.mapper()
1263
+ result.body = self.deserialize(result_mapper, parsed_response)
1264
+ rescue Exception => e
1265
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1266
+ end
1267
+ end
1268
+
1269
+ result
1270
+ end
1271
+
1272
+ promise.execute
1273
+ end
1274
+
1275
+ #
1276
+ # Submit verification using policy parameters
1277
+ #
1278
+ # Submit the verification using the provided policy parameters.
1279
+ #
1280
+ # @param wallet_id [String] The wallet identifier
1281
+ # @param verification_id [String] The verification identifier
1282
+ # @param body [Array<VerificationPolicyCredentialParameters>] The verification
1283
+ # policy parameters
1284
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1285
+ # will be added to the HTTP request.
1286
+ #
1287
+ #
1288
+ def submit_verification(wallet_id, verification_id, body, custom_headers:nil)
1289
+ response = submit_verification_async(wallet_id, verification_id, body, custom_headers:custom_headers).value!
1290
+ nil
1291
+ end
1292
+
1293
+ #
1294
+ # Submit verification using policy parameters
1295
+ #
1296
+ # Submit the verification using the provided policy parameters.
1297
+ #
1298
+ # @param wallet_id [String] The wallet identifier
1299
+ # @param verification_id [String] The verification identifier
1300
+ # @param body [Array<VerificationPolicyCredentialParameters>] The verification
1301
+ # policy parameters
1302
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1303
+ # will be added to the HTTP request.
1304
+ #
1305
+ # @return [MsRest::HttpOperationResponse] HTTP response information.
1306
+ #
1307
+ def submit_verification_with_http_info(wallet_id, verification_id, body, custom_headers:nil)
1308
+ submit_verification_async(wallet_id, verification_id, body, custom_headers:custom_headers).value!
1309
+ end
1310
+
1311
+ #
1312
+ # Submit verification using policy parameters
1313
+ #
1314
+ # Submit the verification using the provided policy parameters.
1315
+ #
1316
+ # @param wallet_id [String] The wallet identifier
1317
+ # @param verification_id [String] The verification identifier
1318
+ # @param body [Array<VerificationPolicyCredentialParameters>] The verification
1319
+ # policy parameters
1320
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1321
+ # to the HTTP request.
1322
+ #
1323
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1324
+ #
1325
+ def submit_verification_async(wallet_id, verification_id, body, custom_headers:nil)
1326
+ fail ArgumentError, 'wallet_id is nil' if wallet_id.nil?
1327
+ fail ArgumentError, 'verification_id is nil' if verification_id.nil?
1328
+ fail ArgumentError, 'body is nil' if body.nil?
1329
+
1330
+
1331
+ request_headers = {}
1332
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1333
+
1334
+ # Serialize Request
1335
+ request_mapper = {
1336
+ client_side_validation: true,
1337
+ required: true,
1338
+ serialized_name: 'body',
1339
+ type: {
1340
+ name: 'Sequence',
1341
+ element: {
1342
+ client_side_validation: true,
1343
+ required: false,
1344
+ serialized_name: 'VerificationPolicyCredentialParametersElementType',
1345
+ type: {
1346
+ name: 'Composite',
1347
+ class_name: 'VerificationPolicyCredentialParameters'
1348
+ }
1349
+ }
1350
+ }
1351
+ }
1352
+ request_content = self.serialize(request_mapper, body)
1353
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1354
+
1355
+ path_template = 'api/{walletId}/verifications/{verificationId}'
1356
+
1357
+ request_url = @base_url || self.base_url
1358
+
1359
+ options = {
1360
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1361
+ path_params: {'walletId' => wallet_id,'verificationId' => verification_id},
1362
+ body: request_content,
1363
+ headers: request_headers.merge(custom_headers || {}),
1364
+ base_url: request_url
1365
+ }
1366
+ promise = self.make_request_async(:put, path_template, options)
1367
+
1368
+ promise = promise.then do |result|
1369
+ http_response = result.response
1370
+ status_code = http_response.status
1371
+ response_content = http_response.body
1372
+ unless status_code == 200 || status_code == 401 || status_code == 403
1373
+ error_model = JSON.load(response_content)
1374
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1375
+ end
1376
+
1377
+
1378
+ result
1379
+ end
1380
+
1381
+ promise.execute
1382
+ end
1383
+
1384
+ #
1385
+ # Create verification proposal
1386
+ #
1387
+ # Create a verification proposal from the specified policy
1388
+ #
1389
+ # @param wallet_id [String] The wallet identifier
1390
+ # @param connection_id [String] The connection identifier
1391
+ # @param body [VerificationPolicyParameters] The proposal policy
1392
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1393
+ # will be added to the HTTP request.
1394
+ #
1395
+ # @return [VerificationContract] operation results.
1396
+ #
1397
+ def propose_verification(wallet_id, connection_id, body, custom_headers:nil)
1398
+ response = propose_verification_async(wallet_id, connection_id, body, custom_headers:custom_headers).value!
1399
+ response.body unless response.nil?
1400
+ end
1401
+
1402
+ #
1403
+ # Create verification proposal
1404
+ #
1405
+ # Create a verification proposal from the specified policy
1406
+ #
1407
+ # @param wallet_id [String] The wallet identifier
1408
+ # @param connection_id [String] The connection identifier
1409
+ # @param body [VerificationPolicyParameters] The proposal policy
1410
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1411
+ # will be added to the HTTP request.
1412
+ #
1413
+ # @return [MsRest::HttpOperationResponse] HTTP response information.
1414
+ #
1415
+ def propose_verification_with_http_info(wallet_id, connection_id, body, custom_headers:nil)
1416
+ propose_verification_async(wallet_id, connection_id, body, custom_headers:custom_headers).value!
1417
+ end
1418
+
1419
+ #
1420
+ # Create verification proposal
1421
+ #
1422
+ # Create a verification proposal from the specified policy
1423
+ #
1424
+ # @param wallet_id [String] The wallet identifier
1425
+ # @param connection_id [String] The connection identifier
1426
+ # @param body [VerificationPolicyParameters] The proposal policy
1427
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1428
+ # to the HTTP request.
1429
+ #
1430
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1431
+ #
1432
+ def propose_verification_async(wallet_id, connection_id, body, custom_headers:nil)
1433
+ fail ArgumentError, 'wallet_id is nil' if wallet_id.nil?
1434
+ fail ArgumentError, 'connection_id is nil' if connection_id.nil?
1435
+ fail ArgumentError, 'body is nil' if body.nil?
1436
+
1437
+
1438
+ request_headers = {}
1439
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1440
+
1441
+ # Serialize Request
1442
+ request_mapper = Wallet::Models::VerificationPolicyParameters.mapper()
1443
+ request_content = self.serialize(request_mapper, body)
1444
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1445
+
1446
+ path_template = 'api/{walletId}/verifications/propose/{connectionId}'
1447
+
1448
+ request_url = @base_url || self.base_url
1449
+
1450
+ options = {
1451
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1452
+ path_params: {'walletId' => wallet_id,'connectionId' => connection_id},
1453
+ body: request_content,
1454
+ headers: request_headers.merge(custom_headers || {}),
1455
+ base_url: request_url
1456
+ }
1457
+ promise = self.make_request_async(:put, path_template, options)
1458
+
1459
+ promise = promise.then do |result|
1460
+ http_response = result.response
1461
+ status_code = http_response.status
1462
+ response_content = http_response.body
1463
+ unless status_code == 200 || status_code == 401 || status_code == 403
1464
+ error_model = JSON.load(response_content)
1465
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1466
+ end
1467
+
1468
+ # Deserialize Response
1469
+ if status_code == 200
1470
+ begin
1471
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1472
+ result_mapper = Wallet::Models::VerificationContract.mapper()
1473
+ result.body = self.deserialize(result_mapper, parsed_response)
1474
+ rescue Exception => e
1475
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1476
+ end
1477
+ end
1478
+
1479
+ result
1480
+ end
1481
+
1482
+ promise.execute
1483
+ end
1484
+
1485
+ #
1486
+ # Submit verification with automatic credential selection
1487
+ #
1488
+ # Submit the verification with a credential that matches the requested
1489
+ # information.
1490
+ # If a credential is not available for a certain policy, that policy will not
1491
+ # be included in the submitted verification.
1492
+ #
1493
+ # @param wallet_id [String] The wallet identifier
1494
+ # @param verification_id [String] The verification identifier
1495
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1496
+ # will be added to the HTTP request.
1497
+ #
1498
+ #
1499
+ def submit_verification_auto_select(wallet_id, verification_id, custom_headers:nil)
1500
+ response = submit_verification_auto_select_async(wallet_id, verification_id, custom_headers:custom_headers).value!
1501
+ nil
1502
+ end
1503
+
1504
+ #
1505
+ # Submit verification with automatic credential selection
1506
+ #
1507
+ # Submit the verification with a credential that matches the requested
1508
+ # information.
1509
+ # If a credential is not available for a certain policy, that policy will not
1510
+ # be included in the submitted verification.
1511
+ #
1512
+ # @param wallet_id [String] The wallet identifier
1513
+ # @param verification_id [String] The verification identifier
1514
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1515
+ # will be added to the HTTP request.
1516
+ #
1517
+ # @return [MsRest::HttpOperationResponse] HTTP response information.
1518
+ #
1519
+ def submit_verification_auto_select_with_http_info(wallet_id, verification_id, custom_headers:nil)
1520
+ submit_verification_auto_select_async(wallet_id, verification_id, custom_headers:custom_headers).value!
1521
+ end
1522
+
1523
+ #
1524
+ # Submit verification with automatic credential selection
1525
+ #
1526
+ # Submit the verification with a credential that matches the requested
1527
+ # information.
1528
+ # If a credential is not available for a certain policy, that policy will not
1529
+ # be included in the submitted verification.
1530
+ #
1531
+ # @param wallet_id [String] The wallet identifier
1532
+ # @param verification_id [String] The verification identifier
1533
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1534
+ # to the HTTP request.
1535
+ #
1536
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1537
+ #
1538
+ def submit_verification_auto_select_async(wallet_id, verification_id, custom_headers:nil)
1539
+ fail ArgumentError, 'wallet_id is nil' if wallet_id.nil?
1540
+ fail ArgumentError, 'verification_id is nil' if verification_id.nil?
1541
+
1542
+
1543
+ request_headers = {}
1544
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1545
+ path_template = 'api/{walletId}/verifications/{verificationId}/autoSelect'
1546
+
1547
+ request_url = @base_url || self.base_url
1548
+
1549
+ options = {
1550
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1551
+ path_params: {'walletId' => wallet_id,'verificationId' => verification_id},
1552
+ headers: request_headers.merge(custom_headers || {}),
1553
+ base_url: request_url
1554
+ }
1555
+ promise = self.make_request_async(:put, path_template, options)
1556
+
1557
+ promise = promise.then do |result|
1558
+ http_response = result.response
1559
+ status_code = http_response.status
1560
+ response_content = http_response.body
1561
+ unless status_code == 200 || status_code == 401 || status_code == 403
1562
+ error_model = JSON.load(response_content)
1563
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1564
+ end
1565
+
1566
+
1567
+ result
1568
+ end
1569
+
1570
+ promise.execute
1571
+ end
1572
+
1573
+ #
1574
+ # List all credentials for verification
1575
+ #
1576
+ # List all available credentials that satisfy the verification request.
1577
+ #
1578
+ # @param wallet_id [String] The wallet identifier
1579
+ # @param verification_id [String] The verification identifier
1580
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1581
+ # will be added to the HTTP request.
1582
+ #
1583
+ # @return [Array] operation results.
1584
+ #
1585
+ def get_available_credentials_for_verification(wallet_id, verification_id, custom_headers:nil)
1586
+ response = get_available_credentials_for_verification_async(wallet_id, verification_id, custom_headers:custom_headers).value!
1587
+ response.body unless response.nil?
1588
+ end
1589
+
1590
+ #
1591
+ # List all credentials for verification
1592
+ #
1593
+ # List all available credentials that satisfy the verification request.
1594
+ #
1595
+ # @param wallet_id [String] The wallet identifier
1596
+ # @param verification_id [String] The verification identifier
1597
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1598
+ # will be added to the HTTP request.
1599
+ #
1600
+ # @return [MsRest::HttpOperationResponse] HTTP response information.
1601
+ #
1602
+ def get_available_credentials_for_verification_with_http_info(wallet_id, verification_id, custom_headers:nil)
1603
+ get_available_credentials_for_verification_async(wallet_id, verification_id, custom_headers:custom_headers).value!
1604
+ end
1605
+
1606
+ #
1607
+ # List all credentials for verification
1608
+ #
1609
+ # List all available credentials that satisfy the verification request.
1610
+ #
1611
+ # @param wallet_id [String] The wallet identifier
1612
+ # @param verification_id [String] The verification identifier
1613
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1614
+ # to the HTTP request.
1615
+ #
1616
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1617
+ #
1618
+ def get_available_credentials_for_verification_async(wallet_id, verification_id, custom_headers:nil)
1619
+ fail ArgumentError, 'wallet_id is nil' if wallet_id.nil?
1620
+ fail ArgumentError, 'verification_id is nil' if verification_id.nil?
1621
+
1622
+
1623
+ request_headers = {}
1624
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1625
+ path_template = 'api/{walletId}/verifications/{verificationId}/availableCredentials'
1626
+
1627
+ request_url = @base_url || self.base_url
1628
+
1629
+ options = {
1630
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1631
+ path_params: {'walletId' => wallet_id,'verificationId' => verification_id},
1632
+ headers: request_headers.merge(custom_headers || {}),
1633
+ base_url: request_url
1634
+ }
1635
+ promise = self.make_request_async(:get, path_template, options)
1636
+
1637
+ promise = promise.then do |result|
1638
+ http_response = result.response
1639
+ status_code = http_response.status
1640
+ response_content = http_response.body
1641
+ unless status_code == 200 || status_code == 401 || status_code == 403
1642
+ error_model = JSON.load(response_content)
1643
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1644
+ end
1645
+
1646
+ # Deserialize Response
1647
+ if status_code == 200
1648
+ begin
1649
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1650
+ result_mapper = {
1651
+ client_side_validation: true,
1652
+ required: false,
1653
+ serialized_name: 'parsed_response',
1654
+ type: {
1655
+ name: 'Sequence',
1656
+ element: {
1657
+ client_side_validation: true,
1658
+ required: false,
1659
+ serialized_name: 'VerificationPolicyCredentialContractElementType',
1660
+ type: {
1661
+ name: 'Composite',
1662
+ class_name: 'VerificationPolicyCredentialContract'
1663
+ }
1664
+ }
1665
+ }
1666
+ }
1667
+ result.body = self.deserialize(result_mapper, parsed_response)
1668
+ rescue Exception => e
1669
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1670
+ end
1671
+ end
1672
+
1673
+ result
1674
+ end
1675
+
1676
+ promise.execute
1677
+ end
1678
+
1679
+ #
1680
+ # Submit verification with automatic credential selection from data
1681
+ #
1682
+ # Submit the verification from data with automatic credential selection.
1683
+ # Verification data can be in the form of a URL or base64 data.
1684
+ #
1685
+ # @param wallet_id [String] The wallet identifier
1686
+ # @param verification_data [String]
1687
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1688
+ # will be added to the HTTP request.
1689
+ #
1690
+ #
1691
+ def submit_verification_from_data_auto_select(wallet_id, verification_data, custom_headers:nil)
1692
+ response = submit_verification_from_data_auto_select_async(wallet_id, verification_data, custom_headers:custom_headers).value!
1693
+ nil
1694
+ end
1695
+
1696
+ #
1697
+ # Submit verification with automatic credential selection from data
1698
+ #
1699
+ # Submit the verification from data with automatic credential selection.
1700
+ # Verification data can be in the form of a URL or base64 data.
1701
+ #
1702
+ # @param wallet_id [String] The wallet identifier
1703
+ # @param verification_data [String]
1704
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1705
+ # will be added to the HTTP request.
1706
+ #
1707
+ # @return [MsRest::HttpOperationResponse] HTTP response information.
1708
+ #
1709
+ def submit_verification_from_data_auto_select_with_http_info(wallet_id, verification_data, custom_headers:nil)
1710
+ submit_verification_from_data_auto_select_async(wallet_id, verification_data, custom_headers:custom_headers).value!
1711
+ end
1712
+
1713
+ #
1714
+ # Submit verification with automatic credential selection from data
1715
+ #
1716
+ # Submit the verification from data with automatic credential selection.
1717
+ # Verification data can be in the form of a URL or base64 data.
1718
+ #
1719
+ # @param wallet_id [String] The wallet identifier
1720
+ # @param verification_data [String]
1721
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1722
+ # to the HTTP request.
1723
+ #
1724
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1725
+ #
1726
+ def submit_verification_from_data_auto_select_async(wallet_id, verification_data, custom_headers:nil)
1727
+ fail ArgumentError, 'wallet_id is nil' if wallet_id.nil?
1728
+ fail ArgumentError, 'verification_data is nil' if verification_data.nil?
1729
+
1730
+
1731
+ request_headers = {}
1732
+ request_headers['Content-Type'] = 'multipart/form-data'
1733
+
1734
+ # Set Form Data
1735
+ form_data = {}
1736
+ form_data['verificationData'] = verification_data unless verification_data.nil?
1737
+
1738
+ path_template = 'api/{walletId}/verifications/fromData/autoSelect'
1739
+
1740
+ request_url = @base_url || self.base_url
1741
+
1742
+ options = {
1743
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1744
+ path_params: {'walletId' => wallet_id},
1745
+ headers: request_headers.merge(custom_headers || {}),
1746
+ body: URI.encode_www_form(form_data),
1747
+ base_url: request_url
1748
+ }
1749
+ promise = self.make_request_async(:put, path_template, options)
1750
+
1751
+ promise = promise.then do |result|
1752
+ http_response = result.response
1753
+ status_code = http_response.status
1754
+ response_content = http_response.body
1755
+ unless status_code == 200 || status_code == 401 || status_code == 403
1756
+ error_model = JSON.load(response_content)
1757
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1758
+ end
1759
+
1760
+
1761
+ result
1762
+ end
1763
+
1764
+ promise.execute
1765
+ end
1766
+
1767
+ #
1768
+ # List all wallets
1769
+ #
1770
+ # List all custodian wallets for the current authorization context.
1771
+ #
1772
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1773
+ # will be added to the HTTP request.
1774
+ #
1775
+ # @return [Array] operation results.
1776
+ #
1777
+ def list_wallets(custom_headers:nil)
1778
+ response = list_wallets_async(custom_headers:custom_headers).value!
1779
+ response.body unless response.nil?
1780
+ end
1781
+
1782
+ #
1783
+ # List all wallets
1784
+ #
1785
+ # List all custodian wallets for the current authorization context.
1786
+ #
1787
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1788
+ # will be added to the HTTP request.
1789
+ #
1790
+ # @return [MsRest::HttpOperationResponse] HTTP response information.
1791
+ #
1792
+ def list_wallets_with_http_info(custom_headers:nil)
1793
+ list_wallets_async(custom_headers:custom_headers).value!
1794
+ end
1795
+
1796
+ #
1797
+ # List all wallets
1798
+ #
1799
+ # List all custodian wallets for the current authorization context.
1800
+ #
1801
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1802
+ # to the HTTP request.
1803
+ #
1804
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1805
+ #
1806
+ def list_wallets_async(custom_headers:nil)
1807
+
1808
+
1809
+ request_headers = {}
1810
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1811
+ path_template = 'api/wallets'
1812
+
1813
+ request_url = @base_url || self.base_url
1814
+
1815
+ options = {
1816
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1817
+ headers: request_headers.merge(custom_headers || {}),
1818
+ base_url: request_url
1819
+ }
1820
+ promise = self.make_request_async(:get, path_template, options)
1821
+
1822
+ promise = promise.then do |result|
1823
+ http_response = result.response
1824
+ status_code = http_response.status
1825
+ response_content = http_response.body
1826
+ unless status_code == 200 || status_code == 401 || status_code == 403
1827
+ error_model = JSON.load(response_content)
1828
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1829
+ end
1830
+
1831
+ # Deserialize Response
1832
+ if status_code == 200
1833
+ begin
1834
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1835
+ result_mapper = {
1836
+ client_side_validation: true,
1837
+ required: false,
1838
+ serialized_name: 'parsed_response',
1839
+ type: {
1840
+ name: 'Sequence',
1841
+ element: {
1842
+ client_side_validation: true,
1843
+ required: false,
1844
+ serialized_name: 'CustodianWalletContractElementType',
1845
+ type: {
1846
+ name: 'Composite',
1847
+ class_name: 'CustodianWalletContract'
1848
+ }
1849
+ }
1850
+ }
1851
+ }
1852
+ result.body = self.deserialize(result_mapper, parsed_response)
1853
+ rescue Exception => e
1854
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1855
+ end
1856
+ end
1857
+
1858
+ result
1859
+ end
1860
+
1861
+ promise.execute
1862
+ end
1863
+
1864
+ #
1865
+ # Create wallet
1866
+ #
1867
+ # Create a new custodian wallet.
1868
+ #
1869
+ # @param body [WalletParameters] The wallet parameters
1870
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1871
+ # will be added to the HTTP request.
1872
+ #
1873
+ # @return [CustodianWalletContract] operation results.
1874
+ #
1875
+ def create_wallet(body, custom_headers:nil)
1876
+ response = create_wallet_async(body, custom_headers:custom_headers).value!
1877
+ response.body unless response.nil?
1878
+ end
1879
+
1880
+ #
1881
+ # Create wallet
1882
+ #
1883
+ # Create a new custodian wallet.
1884
+ #
1885
+ # @param body [WalletParameters] The wallet parameters
1886
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1887
+ # will be added to the HTTP request.
1888
+ #
1889
+ # @return [MsRest::HttpOperationResponse] HTTP response information.
1890
+ #
1891
+ def create_wallet_with_http_info(body, custom_headers:nil)
1892
+ create_wallet_async(body, custom_headers:custom_headers).value!
1893
+ end
1894
+
1895
+ #
1896
+ # Create wallet
1897
+ #
1898
+ # Create a new custodian wallet.
1899
+ #
1900
+ # @param body [WalletParameters] The wallet parameters
1901
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1902
+ # to the HTTP request.
1903
+ #
1904
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1905
+ #
1906
+ def create_wallet_async(body, custom_headers:nil)
1907
+ fail ArgumentError, 'body is nil' if body.nil?
1908
+
1909
+
1910
+ request_headers = {}
1911
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1912
+
1913
+ # Serialize Request
1914
+ request_mapper = Wallet::Models::WalletParameters.mapper()
1915
+ request_content = self.serialize(request_mapper, body)
1916
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
1917
+
1918
+ path_template = 'api/wallets'
1919
+
1920
+ request_url = @base_url || self.base_url
1921
+
1922
+ options = {
1923
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1924
+ body: request_content,
1925
+ headers: request_headers.merge(custom_headers || {}),
1926
+ base_url: request_url
1927
+ }
1928
+ promise = self.make_request_async(:post, path_template, options)
1929
+
1930
+ promise = promise.then do |result|
1931
+ http_response = result.response
1932
+ status_code = http_response.status
1933
+ response_content = http_response.body
1934
+ unless status_code == 200 || status_code == 401 || status_code == 403
1935
+ error_model = JSON.load(response_content)
1936
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1937
+ end
1938
+
1939
+ # Deserialize Response
1940
+ if status_code == 200
1941
+ begin
1942
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1943
+ result_mapper = Wallet::Models::CustodianWalletContract.mapper()
1944
+ result.body = self.deserialize(result_mapper, parsed_response)
1945
+ rescue Exception => e
1946
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1947
+ end
1948
+ end
1949
+
1950
+ result
1951
+ end
1952
+
1953
+ promise.execute
1954
+ end
1955
+
1956
+ #
1957
+ # Delete wallet by query
1958
+ #
1959
+ # Permanently delete all connections, credentials and verification records for
1960
+ # the specified wallet.
1961
+ #
1962
+ # @param wallet_id [String] The wallet identifier
1963
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1964
+ # will be added to the HTTP request.
1965
+ #
1966
+ #
1967
+ def delete_wallet_by_query(wallet_id, custom_headers:nil)
1968
+ response = delete_wallet_by_query_async(wallet_id, custom_headers:custom_headers).value!
1969
+ nil
1970
+ end
1971
+
1972
+ #
1973
+ # Delete wallet by query
1974
+ #
1975
+ # Permanently delete all connections, credentials and verification records for
1976
+ # the specified wallet.
1977
+ #
1978
+ # @param wallet_id [String] The wallet identifier
1979
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1980
+ # will be added to the HTTP request.
1981
+ #
1982
+ # @return [MsRest::HttpOperationResponse] HTTP response information.
1983
+ #
1984
+ def delete_wallet_by_query_with_http_info(wallet_id, custom_headers:nil)
1985
+ delete_wallet_by_query_async(wallet_id, custom_headers:custom_headers).value!
1986
+ end
1987
+
1988
+ #
1989
+ # Delete wallet by query
1990
+ #
1991
+ # Permanently delete all connections, credentials and verification records for
1992
+ # the specified wallet.
1993
+ #
1994
+ # @param wallet_id [String] The wallet identifier
1995
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1996
+ # to the HTTP request.
1997
+ #
1998
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1999
+ #
2000
+ def delete_wallet_by_query_async(wallet_id, custom_headers:nil)
2001
+ fail ArgumentError, 'wallet_id is nil' if wallet_id.nil?
2002
+
2003
+
2004
+ request_headers = {}
2005
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2006
+ path_template = 'api/wallets'
2007
+
2008
+ request_url = @base_url || self.base_url
2009
+
2010
+ options = {
2011
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2012
+ query_params: {'walletId' => wallet_id},
2013
+ headers: request_headers.merge(custom_headers || {}),
2014
+ base_url: request_url
2015
+ }
2016
+ promise = self.make_request_async(:delete, path_template, options)
2017
+
2018
+ promise = promise.then do |result|
2019
+ http_response = result.response
2020
+ status_code = http_response.status
2021
+ response_content = http_response.body
2022
+ unless status_code == 200 || status_code == 401 || status_code == 403
2023
+ error_model = JSON.load(response_content)
2024
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
2025
+ end
2026
+
2027
+
2028
+ result
2029
+ end
2030
+
2031
+ promise.execute
2032
+ end
2033
+
2034
+
2035
+ private
2036
+ #
2037
+ # Adds telemetry information.
2038
+ #
2039
+ def add_telemetry
2040
+ sdk_information = 'wallet'
2041
+ sdk_information = "#{sdk_information}/1.1.4000"
2042
+ add_user_agent_information(sdk_information)
2043
+ end
2044
+ end
2045
+ end