azure_mgmt_mixedreality 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE.txt +21 -0
- data/lib/2019-02-28-preview/generated/azure_mgmt_mixedreality.rb +45 -0
- data/lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/mixed_reality_client.rb +240 -0
- data/lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/models/azure_entity_resource.rb +75 -0
- data/lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/models/check_name_availability_request.rb +58 -0
- data/lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/models/check_name_availability_response.rb +70 -0
- data/lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/models/error_response.rb +84 -0
- data/lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/models/name_availability.rb +16 -0
- data/lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/models/name_unavailable_reason.rb +16 -0
- data/lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/models/operation.rb +58 -0
- data/lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/models/operation_display.rb +80 -0
- data/lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/models/operation_list.rb +101 -0
- data/lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/models/proxy_resource.rb +63 -0
- data/lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/models/resource.rb +83 -0
- data/lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/models/spatial_anchors_account.rb +112 -0
- data/lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/models/spatial_anchors_account_key_regenerate_request.rb +48 -0
- data/lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/models/spatial_anchors_account_keys.rb +59 -0
- data/lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/models/spatial_anchors_account_list.rb +101 -0
- data/lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/models/tracked_resource.rb +92 -0
- data/lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/module_definition.rb +9 -0
- data/lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/operations.rb +214 -0
- data/lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/spatial_anchors_accounts.rb +1067 -0
- data/lib/azure_mgmt_mixedreality.rb +6 -0
- data/lib/module_definition.rb +8 -0
- data/lib/profiles/latest/mixedreality_latest_profile_client.rb +40 -0
- data/lib/profiles/latest/mixedreality_module_definition.rb +8 -0
- data/lib/profiles/latest/modules/mixedreality_profile_module.rb +127 -0
- data/lib/version.rb +7 -0
- metadata +147 -0
@@ -0,0 +1,9 @@
|
|
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 Azure end
|
7
|
+
module Azure::MixedReality end
|
8
|
+
module Azure::MixedReality::Mgmt end
|
9
|
+
module Azure::MixedReality::Mgmt::V2019_02_28_preview end
|
@@ -0,0 +1,214 @@
|
|
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 Azure::MixedReality::Mgmt::V2019_02_28_preview
|
7
|
+
#
|
8
|
+
# Mixed Reality Client
|
9
|
+
#
|
10
|
+
class Operations
|
11
|
+
include MsRestAzure
|
12
|
+
|
13
|
+
#
|
14
|
+
# Creates and initializes a new instance of the Operations class.
|
15
|
+
# @param client service class for accessing basic functionality.
|
16
|
+
#
|
17
|
+
def initialize(client)
|
18
|
+
@client = client
|
19
|
+
end
|
20
|
+
|
21
|
+
# @return [MixedRealityClient] reference to the MixedRealityClient
|
22
|
+
attr_reader :client
|
23
|
+
|
24
|
+
#
|
25
|
+
# Exposing Available Operations
|
26
|
+
#
|
27
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
28
|
+
# will be added to the HTTP request.
|
29
|
+
#
|
30
|
+
# @return [Array<Operation>] operation results.
|
31
|
+
#
|
32
|
+
def list(custom_headers:nil)
|
33
|
+
first_page = list_as_lazy(custom_headers:custom_headers)
|
34
|
+
first_page.get_all_items
|
35
|
+
end
|
36
|
+
|
37
|
+
#
|
38
|
+
# Exposing Available Operations
|
39
|
+
#
|
40
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
41
|
+
# will be added to the HTTP request.
|
42
|
+
#
|
43
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
44
|
+
#
|
45
|
+
def list_with_http_info(custom_headers:nil)
|
46
|
+
list_async(custom_headers:custom_headers).value!
|
47
|
+
end
|
48
|
+
|
49
|
+
#
|
50
|
+
# Exposing Available Operations
|
51
|
+
#
|
52
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
53
|
+
# to the HTTP request.
|
54
|
+
#
|
55
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
56
|
+
#
|
57
|
+
def list_async(custom_headers:nil)
|
58
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
59
|
+
|
60
|
+
|
61
|
+
request_headers = {}
|
62
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
63
|
+
|
64
|
+
# Set Headers
|
65
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
66
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
67
|
+
path_template = 'providers/Microsoft.MixedReality/operations'
|
68
|
+
|
69
|
+
request_url = @base_url || @client.base_url
|
70
|
+
|
71
|
+
options = {
|
72
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
73
|
+
query_params: {'api-version' => @client.api_version},
|
74
|
+
headers: request_headers.merge(custom_headers || {}),
|
75
|
+
base_url: request_url
|
76
|
+
}
|
77
|
+
promise = @client.make_request_async(:get, path_template, options)
|
78
|
+
|
79
|
+
promise = promise.then do |result|
|
80
|
+
http_response = result.response
|
81
|
+
status_code = http_response.status
|
82
|
+
response_content = http_response.body
|
83
|
+
unless status_code == 200
|
84
|
+
error_model = JSON.load(response_content)
|
85
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
86
|
+
end
|
87
|
+
|
88
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
89
|
+
# Deserialize Response
|
90
|
+
if status_code == 200
|
91
|
+
begin
|
92
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
93
|
+
result_mapper = Azure::MixedReality::Mgmt::V2019_02_28_preview::Models::OperationList.mapper()
|
94
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
95
|
+
rescue Exception => e
|
96
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
result
|
101
|
+
end
|
102
|
+
|
103
|
+
promise.execute
|
104
|
+
end
|
105
|
+
|
106
|
+
#
|
107
|
+
# Exposing Available Operations
|
108
|
+
#
|
109
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
110
|
+
# to List operation.
|
111
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
112
|
+
# will be added to the HTTP request.
|
113
|
+
#
|
114
|
+
# @return [OperationList] operation results.
|
115
|
+
#
|
116
|
+
def list_next(next_page_link, custom_headers:nil)
|
117
|
+
response = list_next_async(next_page_link, custom_headers:custom_headers).value!
|
118
|
+
response.body unless response.nil?
|
119
|
+
end
|
120
|
+
|
121
|
+
#
|
122
|
+
# Exposing Available Operations
|
123
|
+
#
|
124
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
125
|
+
# to List operation.
|
126
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
127
|
+
# will be added to the HTTP request.
|
128
|
+
#
|
129
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
130
|
+
#
|
131
|
+
def list_next_with_http_info(next_page_link, custom_headers:nil)
|
132
|
+
list_next_async(next_page_link, custom_headers:custom_headers).value!
|
133
|
+
end
|
134
|
+
|
135
|
+
#
|
136
|
+
# Exposing Available Operations
|
137
|
+
#
|
138
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
139
|
+
# to List operation.
|
140
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
141
|
+
# to the HTTP request.
|
142
|
+
#
|
143
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
144
|
+
#
|
145
|
+
def list_next_async(next_page_link, custom_headers:nil)
|
146
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
147
|
+
|
148
|
+
|
149
|
+
request_headers = {}
|
150
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
151
|
+
|
152
|
+
# Set Headers
|
153
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
154
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
155
|
+
path_template = '{nextLink}'
|
156
|
+
|
157
|
+
request_url = @base_url || @client.base_url
|
158
|
+
|
159
|
+
options = {
|
160
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
161
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
162
|
+
headers: request_headers.merge(custom_headers || {}),
|
163
|
+
base_url: request_url
|
164
|
+
}
|
165
|
+
promise = @client.make_request_async(:get, path_template, options)
|
166
|
+
|
167
|
+
promise = promise.then do |result|
|
168
|
+
http_response = result.response
|
169
|
+
status_code = http_response.status
|
170
|
+
response_content = http_response.body
|
171
|
+
unless status_code == 200
|
172
|
+
error_model = JSON.load(response_content)
|
173
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
174
|
+
end
|
175
|
+
|
176
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
177
|
+
# Deserialize Response
|
178
|
+
if status_code == 200
|
179
|
+
begin
|
180
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
181
|
+
result_mapper = Azure::MixedReality::Mgmt::V2019_02_28_preview::Models::OperationList.mapper()
|
182
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
183
|
+
rescue Exception => e
|
184
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
185
|
+
end
|
186
|
+
end
|
187
|
+
|
188
|
+
result
|
189
|
+
end
|
190
|
+
|
191
|
+
promise.execute
|
192
|
+
end
|
193
|
+
|
194
|
+
#
|
195
|
+
# Exposing Available Operations
|
196
|
+
#
|
197
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
198
|
+
# will be added to the HTTP request.
|
199
|
+
#
|
200
|
+
# @return [OperationList] which provide lazy access to pages of the response.
|
201
|
+
#
|
202
|
+
def list_as_lazy(custom_headers:nil)
|
203
|
+
response = list_async(custom_headers:custom_headers).value!
|
204
|
+
unless response.nil?
|
205
|
+
page = response.body
|
206
|
+
page.next_method = Proc.new do |next_page_link|
|
207
|
+
list_next_async(next_page_link, custom_headers:custom_headers)
|
208
|
+
end
|
209
|
+
page
|
210
|
+
end
|
211
|
+
end
|
212
|
+
|
213
|
+
end
|
214
|
+
end
|
@@ -0,0 +1,1067 @@
|
|
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 Azure::MixedReality::Mgmt::V2019_02_28_preview
|
7
|
+
#
|
8
|
+
# Mixed Reality Client
|
9
|
+
#
|
10
|
+
class SpatialAnchorsAccounts
|
11
|
+
include MsRestAzure
|
12
|
+
|
13
|
+
#
|
14
|
+
# Creates and initializes a new instance of the SpatialAnchorsAccounts class.
|
15
|
+
# @param client service class for accessing basic functionality.
|
16
|
+
#
|
17
|
+
def initialize(client)
|
18
|
+
@client = client
|
19
|
+
end
|
20
|
+
|
21
|
+
# @return [MixedRealityClient] reference to the MixedRealityClient
|
22
|
+
attr_reader :client
|
23
|
+
|
24
|
+
#
|
25
|
+
# List Spatial Anchors Accounts by Subscription
|
26
|
+
#
|
27
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
28
|
+
# will be added to the HTTP request.
|
29
|
+
#
|
30
|
+
# @return [Array<SpatialAnchorsAccount>] operation results.
|
31
|
+
#
|
32
|
+
def list_by_subscription(custom_headers:nil)
|
33
|
+
first_page = list_by_subscription_as_lazy(custom_headers:custom_headers)
|
34
|
+
first_page.get_all_items
|
35
|
+
end
|
36
|
+
|
37
|
+
#
|
38
|
+
# List Spatial Anchors Accounts by Subscription
|
39
|
+
#
|
40
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
41
|
+
# will be added to the HTTP request.
|
42
|
+
#
|
43
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
44
|
+
#
|
45
|
+
def list_by_subscription_with_http_info(custom_headers:nil)
|
46
|
+
list_by_subscription_async(custom_headers:custom_headers).value!
|
47
|
+
end
|
48
|
+
|
49
|
+
#
|
50
|
+
# List Spatial Anchors Accounts by Subscription
|
51
|
+
#
|
52
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
53
|
+
# to the HTTP request.
|
54
|
+
#
|
55
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
56
|
+
#
|
57
|
+
def list_by_subscription_async(custom_headers:nil)
|
58
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
59
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
60
|
+
|
61
|
+
|
62
|
+
request_headers = {}
|
63
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
64
|
+
|
65
|
+
# Set Headers
|
66
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
67
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
68
|
+
path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.MixedReality/spatialAnchorsAccounts'
|
69
|
+
|
70
|
+
request_url = @base_url || @client.base_url
|
71
|
+
|
72
|
+
options = {
|
73
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
74
|
+
path_params: {'subscriptionId' => @client.subscription_id},
|
75
|
+
query_params: {'api-version' => @client.api_version},
|
76
|
+
headers: request_headers.merge(custom_headers || {}),
|
77
|
+
base_url: request_url
|
78
|
+
}
|
79
|
+
promise = @client.make_request_async(:get, path_template, options)
|
80
|
+
|
81
|
+
promise = promise.then do |result|
|
82
|
+
http_response = result.response
|
83
|
+
status_code = http_response.status
|
84
|
+
response_content = http_response.body
|
85
|
+
unless status_code == 200
|
86
|
+
error_model = JSON.load(response_content)
|
87
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
88
|
+
end
|
89
|
+
|
90
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
91
|
+
# Deserialize Response
|
92
|
+
if status_code == 200
|
93
|
+
begin
|
94
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
95
|
+
result_mapper = Azure::MixedReality::Mgmt::V2019_02_28_preview::Models::SpatialAnchorsAccountList.mapper()
|
96
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
97
|
+
rescue Exception => e
|
98
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
result
|
103
|
+
end
|
104
|
+
|
105
|
+
promise.execute
|
106
|
+
end
|
107
|
+
|
108
|
+
#
|
109
|
+
# List Resources by Resource Group
|
110
|
+
#
|
111
|
+
# @param resource_group_name [String] Name of an Azure resource group.
|
112
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
113
|
+
# will be added to the HTTP request.
|
114
|
+
#
|
115
|
+
# @return [Array<SpatialAnchorsAccount>] operation results.
|
116
|
+
#
|
117
|
+
def list_by_resource_group(resource_group_name, custom_headers:nil)
|
118
|
+
first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers:custom_headers)
|
119
|
+
first_page.get_all_items
|
120
|
+
end
|
121
|
+
|
122
|
+
#
|
123
|
+
# List Resources by Resource Group
|
124
|
+
#
|
125
|
+
# @param resource_group_name [String] Name of an Azure resource group.
|
126
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
127
|
+
# will be added to the HTTP request.
|
128
|
+
#
|
129
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
130
|
+
#
|
131
|
+
def list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil)
|
132
|
+
list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
|
133
|
+
end
|
134
|
+
|
135
|
+
#
|
136
|
+
# List Resources by Resource Group
|
137
|
+
#
|
138
|
+
# @param resource_group_name [String] Name of an Azure resource group.
|
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 list_by_resource_group_async(resource_group_name, custom_headers:nil)
|
145
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
146
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
147
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
|
148
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
149
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
|
150
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
151
|
+
|
152
|
+
|
153
|
+
request_headers = {}
|
154
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
155
|
+
|
156
|
+
# Set Headers
|
157
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
158
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
159
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts'
|
160
|
+
|
161
|
+
request_url = @base_url || @client.base_url
|
162
|
+
|
163
|
+
options = {
|
164
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
165
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
|
166
|
+
query_params: {'api-version' => @client.api_version},
|
167
|
+
headers: request_headers.merge(custom_headers || {}),
|
168
|
+
base_url: request_url
|
169
|
+
}
|
170
|
+
promise = @client.make_request_async(:get, path_template, options)
|
171
|
+
|
172
|
+
promise = promise.then do |result|
|
173
|
+
http_response = result.response
|
174
|
+
status_code = http_response.status
|
175
|
+
response_content = http_response.body
|
176
|
+
unless status_code == 200
|
177
|
+
error_model = JSON.load(response_content)
|
178
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
179
|
+
end
|
180
|
+
|
181
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
182
|
+
# Deserialize Response
|
183
|
+
if status_code == 200
|
184
|
+
begin
|
185
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
186
|
+
result_mapper = Azure::MixedReality::Mgmt::V2019_02_28_preview::Models::SpatialAnchorsAccountList.mapper()
|
187
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
188
|
+
rescue Exception => e
|
189
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
190
|
+
end
|
191
|
+
end
|
192
|
+
|
193
|
+
result
|
194
|
+
end
|
195
|
+
|
196
|
+
promise.execute
|
197
|
+
end
|
198
|
+
|
199
|
+
#
|
200
|
+
# Delete a Spatial Anchors Account.
|
201
|
+
#
|
202
|
+
# @param resource_group_name [String] Name of an Azure resource group.
|
203
|
+
# @param spatial_anchors_account_name [String] Name of an Mixed Reality Spatial
|
204
|
+
# Anchors Account.
|
205
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
206
|
+
# will be added to the HTTP request.
|
207
|
+
#
|
208
|
+
#
|
209
|
+
def delete(resource_group_name, spatial_anchors_account_name, custom_headers:nil)
|
210
|
+
response = delete_async(resource_group_name, spatial_anchors_account_name, custom_headers:custom_headers).value!
|
211
|
+
nil
|
212
|
+
end
|
213
|
+
|
214
|
+
#
|
215
|
+
# Delete a Spatial Anchors Account.
|
216
|
+
#
|
217
|
+
# @param resource_group_name [String] Name of an Azure resource group.
|
218
|
+
# @param spatial_anchors_account_name [String] Name of an Mixed Reality Spatial
|
219
|
+
# Anchors Account.
|
220
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
221
|
+
# will be added to the HTTP request.
|
222
|
+
#
|
223
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
224
|
+
#
|
225
|
+
def delete_with_http_info(resource_group_name, spatial_anchors_account_name, custom_headers:nil)
|
226
|
+
delete_async(resource_group_name, spatial_anchors_account_name, custom_headers:custom_headers).value!
|
227
|
+
end
|
228
|
+
|
229
|
+
#
|
230
|
+
# Delete a Spatial Anchors Account.
|
231
|
+
#
|
232
|
+
# @param resource_group_name [String] Name of an Azure resource group.
|
233
|
+
# @param spatial_anchors_account_name [String] Name of an Mixed Reality Spatial
|
234
|
+
# Anchors Account.
|
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 delete_async(resource_group_name, spatial_anchors_account_name, custom_headers:nil)
|
241
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
242
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
243
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
|
244
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
245
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
|
246
|
+
fail ArgumentError, 'spatial_anchors_account_name is nil' if spatial_anchors_account_name.nil?
|
247
|
+
fail ArgumentError, "'spatial_anchors_account_name' should satisfy the constraint - 'MaxLength': '90'" if !spatial_anchors_account_name.nil? && spatial_anchors_account_name.length > 90
|
248
|
+
fail ArgumentError, "'spatial_anchors_account_name' should satisfy the constraint - 'MinLength': '1'" if !spatial_anchors_account_name.nil? && spatial_anchors_account_name.length < 1
|
249
|
+
fail ArgumentError, "'spatial_anchors_account_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !spatial_anchors_account_name.nil? && spatial_anchors_account_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
|
250
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
251
|
+
|
252
|
+
|
253
|
+
request_headers = {}
|
254
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
255
|
+
|
256
|
+
# Set Headers
|
257
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
258
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
259
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{spatialAnchorsAccountName}'
|
260
|
+
|
261
|
+
request_url = @base_url || @client.base_url
|
262
|
+
|
263
|
+
options = {
|
264
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
265
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'spatialAnchorsAccountName' => spatial_anchors_account_name},
|
266
|
+
query_params: {'api-version' => @client.api_version},
|
267
|
+
headers: request_headers.merge(custom_headers || {}),
|
268
|
+
base_url: request_url
|
269
|
+
}
|
270
|
+
promise = @client.make_request_async(:delete, path_template, options)
|
271
|
+
|
272
|
+
promise = promise.then do |result|
|
273
|
+
http_response = result.response
|
274
|
+
status_code = http_response.status
|
275
|
+
response_content = http_response.body
|
276
|
+
unless status_code == 200 || status_code == 204
|
277
|
+
error_model = JSON.load(response_content)
|
278
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
279
|
+
end
|
280
|
+
|
281
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
282
|
+
|
283
|
+
result
|
284
|
+
end
|
285
|
+
|
286
|
+
promise.execute
|
287
|
+
end
|
288
|
+
|
289
|
+
#
|
290
|
+
# Retrieve a Spatial Anchors Account.
|
291
|
+
#
|
292
|
+
# @param resource_group_name [String] Name of an Azure resource group.
|
293
|
+
# @param spatial_anchors_account_name [String] Name of an Mixed Reality Spatial
|
294
|
+
# Anchors Account.
|
295
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
296
|
+
# will be added to the HTTP request.
|
297
|
+
#
|
298
|
+
# @return [SpatialAnchorsAccount] operation results.
|
299
|
+
#
|
300
|
+
def get(resource_group_name, spatial_anchors_account_name, custom_headers:nil)
|
301
|
+
response = get_async(resource_group_name, spatial_anchors_account_name, custom_headers:custom_headers).value!
|
302
|
+
response.body unless response.nil?
|
303
|
+
end
|
304
|
+
|
305
|
+
#
|
306
|
+
# Retrieve a Spatial Anchors Account.
|
307
|
+
#
|
308
|
+
# @param resource_group_name [String] Name of an Azure resource group.
|
309
|
+
# @param spatial_anchors_account_name [String] Name of an Mixed Reality Spatial
|
310
|
+
# Anchors Account.
|
311
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
312
|
+
# will be added to the HTTP request.
|
313
|
+
#
|
314
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
315
|
+
#
|
316
|
+
def get_with_http_info(resource_group_name, spatial_anchors_account_name, custom_headers:nil)
|
317
|
+
get_async(resource_group_name, spatial_anchors_account_name, custom_headers:custom_headers).value!
|
318
|
+
end
|
319
|
+
|
320
|
+
#
|
321
|
+
# Retrieve a Spatial Anchors Account.
|
322
|
+
#
|
323
|
+
# @param resource_group_name [String] Name of an Azure resource group.
|
324
|
+
# @param spatial_anchors_account_name [String] Name of an Mixed Reality Spatial
|
325
|
+
# Anchors Account.
|
326
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
327
|
+
# to the HTTP request.
|
328
|
+
#
|
329
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
330
|
+
#
|
331
|
+
def get_async(resource_group_name, spatial_anchors_account_name, custom_headers:nil)
|
332
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
333
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
334
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
|
335
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
336
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
|
337
|
+
fail ArgumentError, 'spatial_anchors_account_name is nil' if spatial_anchors_account_name.nil?
|
338
|
+
fail ArgumentError, "'spatial_anchors_account_name' should satisfy the constraint - 'MaxLength': '90'" if !spatial_anchors_account_name.nil? && spatial_anchors_account_name.length > 90
|
339
|
+
fail ArgumentError, "'spatial_anchors_account_name' should satisfy the constraint - 'MinLength': '1'" if !spatial_anchors_account_name.nil? && spatial_anchors_account_name.length < 1
|
340
|
+
fail ArgumentError, "'spatial_anchors_account_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !spatial_anchors_account_name.nil? && spatial_anchors_account_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
|
341
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
342
|
+
|
343
|
+
|
344
|
+
request_headers = {}
|
345
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
346
|
+
|
347
|
+
# Set Headers
|
348
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
349
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
350
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{spatialAnchorsAccountName}'
|
351
|
+
|
352
|
+
request_url = @base_url || @client.base_url
|
353
|
+
|
354
|
+
options = {
|
355
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
356
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'spatialAnchorsAccountName' => spatial_anchors_account_name},
|
357
|
+
query_params: {'api-version' => @client.api_version},
|
358
|
+
headers: request_headers.merge(custom_headers || {}),
|
359
|
+
base_url: request_url
|
360
|
+
}
|
361
|
+
promise = @client.make_request_async(:get, path_template, options)
|
362
|
+
|
363
|
+
promise = promise.then do |result|
|
364
|
+
http_response = result.response
|
365
|
+
status_code = http_response.status
|
366
|
+
response_content = http_response.body
|
367
|
+
unless status_code == 200
|
368
|
+
error_model = JSON.load(response_content)
|
369
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
370
|
+
end
|
371
|
+
|
372
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
373
|
+
# Deserialize Response
|
374
|
+
if status_code == 200
|
375
|
+
begin
|
376
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
377
|
+
result_mapper = Azure::MixedReality::Mgmt::V2019_02_28_preview::Models::SpatialAnchorsAccount.mapper()
|
378
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
379
|
+
rescue Exception => e
|
380
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
381
|
+
end
|
382
|
+
end
|
383
|
+
|
384
|
+
result
|
385
|
+
end
|
386
|
+
|
387
|
+
promise.execute
|
388
|
+
end
|
389
|
+
|
390
|
+
#
|
391
|
+
# Updating a Spatial Anchors Account
|
392
|
+
#
|
393
|
+
# @param resource_group_name [String] Name of an Azure resource group.
|
394
|
+
# @param spatial_anchors_account_name [String] Name of an Mixed Reality Spatial
|
395
|
+
# Anchors Account.
|
396
|
+
# @param spatial_anchors_account [SpatialAnchorsAccount] Spatial Anchors
|
397
|
+
# Account parameter.
|
398
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
399
|
+
# will be added to the HTTP request.
|
400
|
+
#
|
401
|
+
# @return [SpatialAnchorsAccount] operation results.
|
402
|
+
#
|
403
|
+
def update(resource_group_name, spatial_anchors_account_name, spatial_anchors_account, custom_headers:nil)
|
404
|
+
response = update_async(resource_group_name, spatial_anchors_account_name, spatial_anchors_account, custom_headers:custom_headers).value!
|
405
|
+
response.body unless response.nil?
|
406
|
+
end
|
407
|
+
|
408
|
+
#
|
409
|
+
# Updating a Spatial Anchors Account
|
410
|
+
#
|
411
|
+
# @param resource_group_name [String] Name of an Azure resource group.
|
412
|
+
# @param spatial_anchors_account_name [String] Name of an Mixed Reality Spatial
|
413
|
+
# Anchors Account.
|
414
|
+
# @param spatial_anchors_account [SpatialAnchorsAccount] Spatial Anchors
|
415
|
+
# Account parameter.
|
416
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
417
|
+
# will be added to the HTTP request.
|
418
|
+
#
|
419
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
420
|
+
#
|
421
|
+
def update_with_http_info(resource_group_name, spatial_anchors_account_name, spatial_anchors_account, custom_headers:nil)
|
422
|
+
update_async(resource_group_name, spatial_anchors_account_name, spatial_anchors_account, custom_headers:custom_headers).value!
|
423
|
+
end
|
424
|
+
|
425
|
+
#
|
426
|
+
# Updating a Spatial Anchors Account
|
427
|
+
#
|
428
|
+
# @param resource_group_name [String] Name of an Azure resource group.
|
429
|
+
# @param spatial_anchors_account_name [String] Name of an Mixed Reality Spatial
|
430
|
+
# Anchors Account.
|
431
|
+
# @param spatial_anchors_account [SpatialAnchorsAccount] Spatial Anchors
|
432
|
+
# Account parameter.
|
433
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
434
|
+
# to the HTTP request.
|
435
|
+
#
|
436
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
437
|
+
#
|
438
|
+
def update_async(resource_group_name, spatial_anchors_account_name, spatial_anchors_account, custom_headers:nil)
|
439
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
440
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
441
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
|
442
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
443
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
|
444
|
+
fail ArgumentError, 'spatial_anchors_account_name is nil' if spatial_anchors_account_name.nil?
|
445
|
+
fail ArgumentError, "'spatial_anchors_account_name' should satisfy the constraint - 'MaxLength': '90'" if !spatial_anchors_account_name.nil? && spatial_anchors_account_name.length > 90
|
446
|
+
fail ArgumentError, "'spatial_anchors_account_name' should satisfy the constraint - 'MinLength': '1'" if !spatial_anchors_account_name.nil? && spatial_anchors_account_name.length < 1
|
447
|
+
fail ArgumentError, "'spatial_anchors_account_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !spatial_anchors_account_name.nil? && spatial_anchors_account_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
|
448
|
+
fail ArgumentError, 'spatial_anchors_account is nil' if spatial_anchors_account.nil?
|
449
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
450
|
+
|
451
|
+
|
452
|
+
request_headers = {}
|
453
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
454
|
+
|
455
|
+
# Set Headers
|
456
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
457
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
458
|
+
|
459
|
+
# Serialize Request
|
460
|
+
request_mapper = Azure::MixedReality::Mgmt::V2019_02_28_preview::Models::SpatialAnchorsAccount.mapper()
|
461
|
+
request_content = @client.serialize(request_mapper, spatial_anchors_account)
|
462
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
463
|
+
|
464
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{spatialAnchorsAccountName}'
|
465
|
+
|
466
|
+
request_url = @base_url || @client.base_url
|
467
|
+
|
468
|
+
options = {
|
469
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
470
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'spatialAnchorsAccountName' => spatial_anchors_account_name},
|
471
|
+
query_params: {'api-version' => @client.api_version},
|
472
|
+
body: request_content,
|
473
|
+
headers: request_headers.merge(custom_headers || {}),
|
474
|
+
base_url: request_url
|
475
|
+
}
|
476
|
+
promise = @client.make_request_async(:patch, path_template, options)
|
477
|
+
|
478
|
+
promise = promise.then do |result|
|
479
|
+
http_response = result.response
|
480
|
+
status_code = http_response.status
|
481
|
+
response_content = http_response.body
|
482
|
+
unless status_code == 200
|
483
|
+
error_model = JSON.load(response_content)
|
484
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
485
|
+
end
|
486
|
+
|
487
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
488
|
+
# Deserialize Response
|
489
|
+
if status_code == 200
|
490
|
+
begin
|
491
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
492
|
+
result_mapper = Azure::MixedReality::Mgmt::V2019_02_28_preview::Models::SpatialAnchorsAccount.mapper()
|
493
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
494
|
+
rescue Exception => e
|
495
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
496
|
+
end
|
497
|
+
end
|
498
|
+
|
499
|
+
result
|
500
|
+
end
|
501
|
+
|
502
|
+
promise.execute
|
503
|
+
end
|
504
|
+
|
505
|
+
#
|
506
|
+
# Creating or Updating a Spatial Anchors Account.
|
507
|
+
#
|
508
|
+
# @param resource_group_name [String] Name of an Azure resource group.
|
509
|
+
# @param spatial_anchors_account_name [String] Name of an Mixed Reality Spatial
|
510
|
+
# Anchors Account.
|
511
|
+
# @param spatial_anchors_account [SpatialAnchorsAccount] Spatial Anchors
|
512
|
+
# Account parameter.
|
513
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
514
|
+
# will be added to the HTTP request.
|
515
|
+
#
|
516
|
+
# @return [SpatialAnchorsAccount] operation results.
|
517
|
+
#
|
518
|
+
def create(resource_group_name, spatial_anchors_account_name, spatial_anchors_account, custom_headers:nil)
|
519
|
+
response = create_async(resource_group_name, spatial_anchors_account_name, spatial_anchors_account, custom_headers:custom_headers).value!
|
520
|
+
response.body unless response.nil?
|
521
|
+
end
|
522
|
+
|
523
|
+
#
|
524
|
+
# Creating or Updating a Spatial Anchors Account.
|
525
|
+
#
|
526
|
+
# @param resource_group_name [String] Name of an Azure resource group.
|
527
|
+
# @param spatial_anchors_account_name [String] Name of an Mixed Reality Spatial
|
528
|
+
# Anchors Account.
|
529
|
+
# @param spatial_anchors_account [SpatialAnchorsAccount] Spatial Anchors
|
530
|
+
# Account parameter.
|
531
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
532
|
+
# will be added to the HTTP request.
|
533
|
+
#
|
534
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
535
|
+
#
|
536
|
+
def create_with_http_info(resource_group_name, spatial_anchors_account_name, spatial_anchors_account, custom_headers:nil)
|
537
|
+
create_async(resource_group_name, spatial_anchors_account_name, spatial_anchors_account, custom_headers:custom_headers).value!
|
538
|
+
end
|
539
|
+
|
540
|
+
#
|
541
|
+
# Creating or Updating a Spatial Anchors Account.
|
542
|
+
#
|
543
|
+
# @param resource_group_name [String] Name of an Azure resource group.
|
544
|
+
# @param spatial_anchors_account_name [String] Name of an Mixed Reality Spatial
|
545
|
+
# Anchors Account.
|
546
|
+
# @param spatial_anchors_account [SpatialAnchorsAccount] Spatial Anchors
|
547
|
+
# Account parameter.
|
548
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
549
|
+
# to the HTTP request.
|
550
|
+
#
|
551
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
552
|
+
#
|
553
|
+
def create_async(resource_group_name, spatial_anchors_account_name, spatial_anchors_account, custom_headers:nil)
|
554
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
555
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
556
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
|
557
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
558
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
|
559
|
+
fail ArgumentError, 'spatial_anchors_account_name is nil' if spatial_anchors_account_name.nil?
|
560
|
+
fail ArgumentError, "'spatial_anchors_account_name' should satisfy the constraint - 'MaxLength': '90'" if !spatial_anchors_account_name.nil? && spatial_anchors_account_name.length > 90
|
561
|
+
fail ArgumentError, "'spatial_anchors_account_name' should satisfy the constraint - 'MinLength': '1'" if !spatial_anchors_account_name.nil? && spatial_anchors_account_name.length < 1
|
562
|
+
fail ArgumentError, "'spatial_anchors_account_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !spatial_anchors_account_name.nil? && spatial_anchors_account_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
|
563
|
+
fail ArgumentError, 'spatial_anchors_account is nil' if spatial_anchors_account.nil?
|
564
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
565
|
+
|
566
|
+
|
567
|
+
request_headers = {}
|
568
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
569
|
+
|
570
|
+
# Set Headers
|
571
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
572
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
573
|
+
|
574
|
+
# Serialize Request
|
575
|
+
request_mapper = Azure::MixedReality::Mgmt::V2019_02_28_preview::Models::SpatialAnchorsAccount.mapper()
|
576
|
+
request_content = @client.serialize(request_mapper, spatial_anchors_account)
|
577
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
578
|
+
|
579
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{spatialAnchorsAccountName}'
|
580
|
+
|
581
|
+
request_url = @base_url || @client.base_url
|
582
|
+
|
583
|
+
options = {
|
584
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
585
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'spatialAnchorsAccountName' => spatial_anchors_account_name},
|
586
|
+
query_params: {'api-version' => @client.api_version},
|
587
|
+
body: request_content,
|
588
|
+
headers: request_headers.merge(custom_headers || {}),
|
589
|
+
base_url: request_url
|
590
|
+
}
|
591
|
+
promise = @client.make_request_async(:put, path_template, options)
|
592
|
+
|
593
|
+
promise = promise.then do |result|
|
594
|
+
http_response = result.response
|
595
|
+
status_code = http_response.status
|
596
|
+
response_content = http_response.body
|
597
|
+
unless status_code == 200 || status_code == 201
|
598
|
+
error_model = JSON.load(response_content)
|
599
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
600
|
+
end
|
601
|
+
|
602
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
603
|
+
# Deserialize Response
|
604
|
+
if status_code == 200
|
605
|
+
begin
|
606
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
607
|
+
result_mapper = Azure::MixedReality::Mgmt::V2019_02_28_preview::Models::SpatialAnchorsAccount.mapper()
|
608
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
609
|
+
rescue Exception => e
|
610
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
611
|
+
end
|
612
|
+
end
|
613
|
+
# Deserialize Response
|
614
|
+
if status_code == 201
|
615
|
+
begin
|
616
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
617
|
+
result_mapper = Azure::MixedReality::Mgmt::V2019_02_28_preview::Models::SpatialAnchorsAccount.mapper()
|
618
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
619
|
+
rescue Exception => e
|
620
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
621
|
+
end
|
622
|
+
end
|
623
|
+
|
624
|
+
result
|
625
|
+
end
|
626
|
+
|
627
|
+
promise.execute
|
628
|
+
end
|
629
|
+
|
630
|
+
#
|
631
|
+
# Get Both of the 2 Keys of a Spatial Anchors Account
|
632
|
+
#
|
633
|
+
# @param resource_group_name [String] Name of an Azure resource group.
|
634
|
+
# @param spatial_anchors_account_name [String] Name of an Mixed Reality Spatial
|
635
|
+
# Anchors Account.
|
636
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
637
|
+
# will be added to the HTTP request.
|
638
|
+
#
|
639
|
+
# @return [SpatialAnchorsAccountKeys] operation results.
|
640
|
+
#
|
641
|
+
def get_keys(resource_group_name, spatial_anchors_account_name, custom_headers:nil)
|
642
|
+
response = get_keys_async(resource_group_name, spatial_anchors_account_name, custom_headers:custom_headers).value!
|
643
|
+
response.body unless response.nil?
|
644
|
+
end
|
645
|
+
|
646
|
+
#
|
647
|
+
# Get Both of the 2 Keys of a Spatial Anchors Account
|
648
|
+
#
|
649
|
+
# @param resource_group_name [String] Name of an Azure resource group.
|
650
|
+
# @param spatial_anchors_account_name [String] Name of an Mixed Reality Spatial
|
651
|
+
# Anchors Account.
|
652
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
653
|
+
# will be added to the HTTP request.
|
654
|
+
#
|
655
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
656
|
+
#
|
657
|
+
def get_keys_with_http_info(resource_group_name, spatial_anchors_account_name, custom_headers:nil)
|
658
|
+
get_keys_async(resource_group_name, spatial_anchors_account_name, custom_headers:custom_headers).value!
|
659
|
+
end
|
660
|
+
|
661
|
+
#
|
662
|
+
# Get Both of the 2 Keys of a Spatial Anchors Account
|
663
|
+
#
|
664
|
+
# @param resource_group_name [String] Name of an Azure resource group.
|
665
|
+
# @param spatial_anchors_account_name [String] Name of an Mixed Reality Spatial
|
666
|
+
# Anchors Account.
|
667
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
668
|
+
# to the HTTP request.
|
669
|
+
#
|
670
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
671
|
+
#
|
672
|
+
def get_keys_async(resource_group_name, spatial_anchors_account_name, custom_headers:nil)
|
673
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
674
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
675
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
|
676
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
677
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
|
678
|
+
fail ArgumentError, 'spatial_anchors_account_name is nil' if spatial_anchors_account_name.nil?
|
679
|
+
fail ArgumentError, "'spatial_anchors_account_name' should satisfy the constraint - 'MaxLength': '90'" if !spatial_anchors_account_name.nil? && spatial_anchors_account_name.length > 90
|
680
|
+
fail ArgumentError, "'spatial_anchors_account_name' should satisfy the constraint - 'MinLength': '1'" if !spatial_anchors_account_name.nil? && spatial_anchors_account_name.length < 1
|
681
|
+
fail ArgumentError, "'spatial_anchors_account_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !spatial_anchors_account_name.nil? && spatial_anchors_account_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
|
682
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
683
|
+
|
684
|
+
|
685
|
+
request_headers = {}
|
686
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
687
|
+
|
688
|
+
# Set Headers
|
689
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
690
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
691
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{spatialAnchorsAccountName}/keys'
|
692
|
+
|
693
|
+
request_url = @base_url || @client.base_url
|
694
|
+
|
695
|
+
options = {
|
696
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
697
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'spatialAnchorsAccountName' => spatial_anchors_account_name},
|
698
|
+
query_params: {'api-version' => @client.api_version},
|
699
|
+
headers: request_headers.merge(custom_headers || {}),
|
700
|
+
base_url: request_url
|
701
|
+
}
|
702
|
+
promise = @client.make_request_async(:get, path_template, options)
|
703
|
+
|
704
|
+
promise = promise.then do |result|
|
705
|
+
http_response = result.response
|
706
|
+
status_code = http_response.status
|
707
|
+
response_content = http_response.body
|
708
|
+
unless status_code == 200
|
709
|
+
error_model = JSON.load(response_content)
|
710
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
711
|
+
end
|
712
|
+
|
713
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
714
|
+
# Deserialize Response
|
715
|
+
if status_code == 200
|
716
|
+
begin
|
717
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
718
|
+
result_mapper = Azure::MixedReality::Mgmt::V2019_02_28_preview::Models::SpatialAnchorsAccountKeys.mapper()
|
719
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
720
|
+
rescue Exception => e
|
721
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
722
|
+
end
|
723
|
+
end
|
724
|
+
|
725
|
+
result
|
726
|
+
end
|
727
|
+
|
728
|
+
promise.execute
|
729
|
+
end
|
730
|
+
|
731
|
+
#
|
732
|
+
# Regenerate 1 Key of a Spatial Anchors Account
|
733
|
+
#
|
734
|
+
# @param resource_group_name [String] Name of an Azure resource group.
|
735
|
+
# @param spatial_anchors_account_name [String] Name of an Mixed Reality Spatial
|
736
|
+
# Anchors Account.
|
737
|
+
# @param spatial_anchors_account_key_regenerate
|
738
|
+
# [SpatialAnchorsAccountKeyRegenerateRequest] Specifying which key to be
|
739
|
+
# regenerated.
|
740
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
741
|
+
# will be added to the HTTP request.
|
742
|
+
#
|
743
|
+
# @return [SpatialAnchorsAccountKeys] operation results.
|
744
|
+
#
|
745
|
+
def regenerate_keys(resource_group_name, spatial_anchors_account_name, spatial_anchors_account_key_regenerate, custom_headers:nil)
|
746
|
+
response = regenerate_keys_async(resource_group_name, spatial_anchors_account_name, spatial_anchors_account_key_regenerate, custom_headers:custom_headers).value!
|
747
|
+
response.body unless response.nil?
|
748
|
+
end
|
749
|
+
|
750
|
+
#
|
751
|
+
# Regenerate 1 Key of a Spatial Anchors Account
|
752
|
+
#
|
753
|
+
# @param resource_group_name [String] Name of an Azure resource group.
|
754
|
+
# @param spatial_anchors_account_name [String] Name of an Mixed Reality Spatial
|
755
|
+
# Anchors Account.
|
756
|
+
# @param spatial_anchors_account_key_regenerate
|
757
|
+
# [SpatialAnchorsAccountKeyRegenerateRequest] Specifying which key to be
|
758
|
+
# regenerated.
|
759
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
760
|
+
# will be added to the HTTP request.
|
761
|
+
#
|
762
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
763
|
+
#
|
764
|
+
def regenerate_keys_with_http_info(resource_group_name, spatial_anchors_account_name, spatial_anchors_account_key_regenerate, custom_headers:nil)
|
765
|
+
regenerate_keys_async(resource_group_name, spatial_anchors_account_name, spatial_anchors_account_key_regenerate, custom_headers:custom_headers).value!
|
766
|
+
end
|
767
|
+
|
768
|
+
#
|
769
|
+
# Regenerate 1 Key of a Spatial Anchors Account
|
770
|
+
#
|
771
|
+
# @param resource_group_name [String] Name of an Azure resource group.
|
772
|
+
# @param spatial_anchors_account_name [String] Name of an Mixed Reality Spatial
|
773
|
+
# Anchors Account.
|
774
|
+
# @param spatial_anchors_account_key_regenerate
|
775
|
+
# [SpatialAnchorsAccountKeyRegenerateRequest] Specifying which key to be
|
776
|
+
# regenerated.
|
777
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
778
|
+
# to the HTTP request.
|
779
|
+
#
|
780
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
781
|
+
#
|
782
|
+
def regenerate_keys_async(resource_group_name, spatial_anchors_account_name, spatial_anchors_account_key_regenerate, custom_headers:nil)
|
783
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
784
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
785
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
|
786
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
|
787
|
+
fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
|
788
|
+
fail ArgumentError, 'spatial_anchors_account_name is nil' if spatial_anchors_account_name.nil?
|
789
|
+
fail ArgumentError, "'spatial_anchors_account_name' should satisfy the constraint - 'MaxLength': '90'" if !spatial_anchors_account_name.nil? && spatial_anchors_account_name.length > 90
|
790
|
+
fail ArgumentError, "'spatial_anchors_account_name' should satisfy the constraint - 'MinLength': '1'" if !spatial_anchors_account_name.nil? && spatial_anchors_account_name.length < 1
|
791
|
+
fail ArgumentError, "'spatial_anchors_account_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !spatial_anchors_account_name.nil? && spatial_anchors_account_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
|
792
|
+
fail ArgumentError, 'spatial_anchors_account_key_regenerate is nil' if spatial_anchors_account_key_regenerate.nil?
|
793
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
794
|
+
|
795
|
+
|
796
|
+
request_headers = {}
|
797
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
798
|
+
|
799
|
+
# Set Headers
|
800
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
801
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
802
|
+
|
803
|
+
# Serialize Request
|
804
|
+
request_mapper = Azure::MixedReality::Mgmt::V2019_02_28_preview::Models::SpatialAnchorsAccountKeyRegenerateRequest.mapper()
|
805
|
+
request_content = @client.serialize(request_mapper, spatial_anchors_account_key_regenerate)
|
806
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
807
|
+
|
808
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{spatialAnchorsAccountName}/keys'
|
809
|
+
|
810
|
+
request_url = @base_url || @client.base_url
|
811
|
+
|
812
|
+
options = {
|
813
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
814
|
+
path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'spatialAnchorsAccountName' => spatial_anchors_account_name},
|
815
|
+
query_params: {'api-version' => @client.api_version},
|
816
|
+
body: request_content,
|
817
|
+
headers: request_headers.merge(custom_headers || {}),
|
818
|
+
base_url: request_url
|
819
|
+
}
|
820
|
+
promise = @client.make_request_async(:post, path_template, options)
|
821
|
+
|
822
|
+
promise = promise.then do |result|
|
823
|
+
http_response = result.response
|
824
|
+
status_code = http_response.status
|
825
|
+
response_content = http_response.body
|
826
|
+
unless status_code == 200
|
827
|
+
error_model = JSON.load(response_content)
|
828
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
829
|
+
end
|
830
|
+
|
831
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
832
|
+
# Deserialize Response
|
833
|
+
if status_code == 200
|
834
|
+
begin
|
835
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
836
|
+
result_mapper = Azure::MixedReality::Mgmt::V2019_02_28_preview::Models::SpatialAnchorsAccountKeys.mapper()
|
837
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
838
|
+
rescue Exception => e
|
839
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
840
|
+
end
|
841
|
+
end
|
842
|
+
|
843
|
+
result
|
844
|
+
end
|
845
|
+
|
846
|
+
promise.execute
|
847
|
+
end
|
848
|
+
|
849
|
+
#
|
850
|
+
# List Spatial Anchors Accounts by Subscription
|
851
|
+
#
|
852
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
853
|
+
# to List operation.
|
854
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
855
|
+
# will be added to the HTTP request.
|
856
|
+
#
|
857
|
+
# @return [SpatialAnchorsAccountList] operation results.
|
858
|
+
#
|
859
|
+
def list_by_subscription_next(next_page_link, custom_headers:nil)
|
860
|
+
response = list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
|
861
|
+
response.body unless response.nil?
|
862
|
+
end
|
863
|
+
|
864
|
+
#
|
865
|
+
# List Spatial Anchors Accounts by Subscription
|
866
|
+
#
|
867
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
868
|
+
# to List operation.
|
869
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
870
|
+
# will be added to the HTTP request.
|
871
|
+
#
|
872
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
873
|
+
#
|
874
|
+
def list_by_subscription_next_with_http_info(next_page_link, custom_headers:nil)
|
875
|
+
list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
|
876
|
+
end
|
877
|
+
|
878
|
+
#
|
879
|
+
# List Spatial Anchors Accounts by Subscription
|
880
|
+
#
|
881
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
882
|
+
# to List operation.
|
883
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
884
|
+
# to the HTTP request.
|
885
|
+
#
|
886
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
887
|
+
#
|
888
|
+
def list_by_subscription_next_async(next_page_link, custom_headers:nil)
|
889
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
890
|
+
|
891
|
+
|
892
|
+
request_headers = {}
|
893
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
894
|
+
|
895
|
+
# Set Headers
|
896
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
897
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
898
|
+
path_template = '{nextLink}'
|
899
|
+
|
900
|
+
request_url = @base_url || @client.base_url
|
901
|
+
|
902
|
+
options = {
|
903
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
904
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
905
|
+
headers: request_headers.merge(custom_headers || {}),
|
906
|
+
base_url: request_url
|
907
|
+
}
|
908
|
+
promise = @client.make_request_async(:get, path_template, options)
|
909
|
+
|
910
|
+
promise = promise.then do |result|
|
911
|
+
http_response = result.response
|
912
|
+
status_code = http_response.status
|
913
|
+
response_content = http_response.body
|
914
|
+
unless status_code == 200
|
915
|
+
error_model = JSON.load(response_content)
|
916
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
917
|
+
end
|
918
|
+
|
919
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
920
|
+
# Deserialize Response
|
921
|
+
if status_code == 200
|
922
|
+
begin
|
923
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
924
|
+
result_mapper = Azure::MixedReality::Mgmt::V2019_02_28_preview::Models::SpatialAnchorsAccountList.mapper()
|
925
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
926
|
+
rescue Exception => e
|
927
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
928
|
+
end
|
929
|
+
end
|
930
|
+
|
931
|
+
result
|
932
|
+
end
|
933
|
+
|
934
|
+
promise.execute
|
935
|
+
end
|
936
|
+
|
937
|
+
#
|
938
|
+
# List Resources by Resource Group
|
939
|
+
#
|
940
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
941
|
+
# to List operation.
|
942
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
943
|
+
# will be added to the HTTP request.
|
944
|
+
#
|
945
|
+
# @return [SpatialAnchorsAccountList] operation results.
|
946
|
+
#
|
947
|
+
def list_by_resource_group_next(next_page_link, custom_headers:nil)
|
948
|
+
response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
|
949
|
+
response.body unless response.nil?
|
950
|
+
end
|
951
|
+
|
952
|
+
#
|
953
|
+
# List Resources by Resource Group
|
954
|
+
#
|
955
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
956
|
+
# to List operation.
|
957
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
958
|
+
# will be added to the HTTP request.
|
959
|
+
#
|
960
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
961
|
+
#
|
962
|
+
def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
|
963
|
+
list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
|
964
|
+
end
|
965
|
+
|
966
|
+
#
|
967
|
+
# List Resources by Resource Group
|
968
|
+
#
|
969
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
970
|
+
# to List operation.
|
971
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
972
|
+
# to the HTTP request.
|
973
|
+
#
|
974
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
975
|
+
#
|
976
|
+
def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
|
977
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
978
|
+
|
979
|
+
|
980
|
+
request_headers = {}
|
981
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
982
|
+
|
983
|
+
# Set Headers
|
984
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
985
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
986
|
+
path_template = '{nextLink}'
|
987
|
+
|
988
|
+
request_url = @base_url || @client.base_url
|
989
|
+
|
990
|
+
options = {
|
991
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
992
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
993
|
+
headers: request_headers.merge(custom_headers || {}),
|
994
|
+
base_url: request_url
|
995
|
+
}
|
996
|
+
promise = @client.make_request_async(:get, path_template, options)
|
997
|
+
|
998
|
+
promise = promise.then do |result|
|
999
|
+
http_response = result.response
|
1000
|
+
status_code = http_response.status
|
1001
|
+
response_content = http_response.body
|
1002
|
+
unless status_code == 200
|
1003
|
+
error_model = JSON.load(response_content)
|
1004
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
1005
|
+
end
|
1006
|
+
|
1007
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
1008
|
+
# Deserialize Response
|
1009
|
+
if status_code == 200
|
1010
|
+
begin
|
1011
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
1012
|
+
result_mapper = Azure::MixedReality::Mgmt::V2019_02_28_preview::Models::SpatialAnchorsAccountList.mapper()
|
1013
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
1014
|
+
rescue Exception => e
|
1015
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
1016
|
+
end
|
1017
|
+
end
|
1018
|
+
|
1019
|
+
result
|
1020
|
+
end
|
1021
|
+
|
1022
|
+
promise.execute
|
1023
|
+
end
|
1024
|
+
|
1025
|
+
#
|
1026
|
+
# List Spatial Anchors Accounts by Subscription
|
1027
|
+
#
|
1028
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1029
|
+
# will be added to the HTTP request.
|
1030
|
+
#
|
1031
|
+
# @return [SpatialAnchorsAccountList] which provide lazy access to pages of the
|
1032
|
+
# response.
|
1033
|
+
#
|
1034
|
+
def list_by_subscription_as_lazy(custom_headers:nil)
|
1035
|
+
response = list_by_subscription_async(custom_headers:custom_headers).value!
|
1036
|
+
unless response.nil?
|
1037
|
+
page = response.body
|
1038
|
+
page.next_method = Proc.new do |next_page_link|
|
1039
|
+
list_by_subscription_next_async(next_page_link, custom_headers:custom_headers)
|
1040
|
+
end
|
1041
|
+
page
|
1042
|
+
end
|
1043
|
+
end
|
1044
|
+
|
1045
|
+
#
|
1046
|
+
# List Resources by Resource Group
|
1047
|
+
#
|
1048
|
+
# @param resource_group_name [String] Name of an Azure resource group.
|
1049
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1050
|
+
# will be added to the HTTP request.
|
1051
|
+
#
|
1052
|
+
# @return [SpatialAnchorsAccountList] which provide lazy access to pages of the
|
1053
|
+
# response.
|
1054
|
+
#
|
1055
|
+
def list_by_resource_group_as_lazy(resource_group_name, custom_headers:nil)
|
1056
|
+
response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
|
1057
|
+
unless response.nil?
|
1058
|
+
page = response.body
|
1059
|
+
page.next_method = Proc.new do |next_page_link|
|
1060
|
+
list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
|
1061
|
+
end
|
1062
|
+
page
|
1063
|
+
end
|
1064
|
+
end
|
1065
|
+
|
1066
|
+
end
|
1067
|
+
end
|