Class: Azure::MixedReality::Mgmt::V2019_02_28_preview::SpatialAnchorsAccounts

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/spatial_anchors_accounts.rb

Overview

Mixed Reality Client

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ SpatialAnchorsAccounts

Creates and initializes a new instance of the SpatialAnchorsAccounts class.

Parameters:

  • client

    service class for accessing basic functionality.



17
18
19
# File 'lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/spatial_anchors_accounts.rb', line 17

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientMixedRealityClient (readonly)

Returns reference to the MixedRealityClient.

Returns:



22
23
24
# File 'lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/spatial_anchors_accounts.rb', line 22

def client
  @client
end

Instance Method Details

#create(resource_group_name, spatial_anchors_account_name, spatial_anchors_account, custom_headers: nil) ⇒ SpatialAnchorsAccount

Creating or Updating a Spatial Anchors Account.

Anchors Account. Account parameter. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • spatial_anchors_account_name (String)

    Name of an Mixed Reality Spatial

  • spatial_anchors_account (SpatialAnchorsAccount)

    Spatial Anchors

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (SpatialAnchorsAccount)

    operation results.



528
529
530
531
# File 'lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/spatial_anchors_accounts.rb', line 528

def create(resource_group_name, , , custom_headers:nil)
  response = create_async(resource_group_name, , , custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#create_async(resource_group_name, spatial_anchors_account_name, spatial_anchors_account, custom_headers: nil) ⇒ Concurrent::Promise

Creating or Updating a Spatial Anchors Account.

Anchors Account. Account parameter. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • spatial_anchors_account_name (String)

    Name of an Mixed Reality Spatial

  • spatial_anchors_account (SpatialAnchorsAccount)

    Spatial Anchors

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
# File 'lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/spatial_anchors_accounts.rb', line 563

def create_async(resource_group_name, , , custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'spatial_anchors_account_name is nil' if .nil?
  fail ArgumentError, "'spatial_anchors_account_name' should satisfy the constraint - 'MaxLength': '90'" if !.nil? && .length > 90
  fail ArgumentError, "'spatial_anchors_account_name' should satisfy the constraint - 'MinLength': '1'" if !.nil? && .length < 1
  fail ArgumentError, "'spatial_anchors_account_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !.nil? && .match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'spatial_anchors_account is nil' if .nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::MixedReality::Mgmt::V2019_02_28_preview::Models::SpatialAnchorsAccount.mapper()
  request_content = @client.serialize(request_mapper,  )
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{spatialAnchorsAccountName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'spatialAnchorsAccountName' => },
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:put, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 201
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::MixedReality::Mgmt::V2019_02_28_preview::Models::SpatialAnchorsAccount.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end
    # Deserialize Response
    if status_code == 201
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::MixedReality::Mgmt::V2019_02_28_preview::Models::SpatialAnchorsAccount.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#create_with_http_info(resource_group_name, spatial_anchors_account_name, spatial_anchors_account, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Creating or Updating a Spatial Anchors Account.

Anchors Account. Account parameter. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • spatial_anchors_account_name (String)

    Name of an Mixed Reality Spatial

  • spatial_anchors_account (SpatialAnchorsAccount)

    Spatial Anchors

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



546
547
548
# File 'lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/spatial_anchors_accounts.rb', line 546

def create_with_http_info(resource_group_name, , , custom_headers:nil)
  create_async(resource_group_name, , , custom_headers:custom_headers).value!
end

#delete(resource_group_name, spatial_anchors_account_name, custom_headers: nil) ⇒ Object

Delete a Spatial Anchors Account.

Anchors Account. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • spatial_anchors_account_name (String)

    Name of an Mixed Reality Spatial

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that



213
214
215
216
# File 'lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/spatial_anchors_accounts.rb', line 213

def delete(resource_group_name, , custom_headers:nil)
  response = delete_async(resource_group_name, , custom_headers:custom_headers).value!
  nil
end

#delete_async(resource_group_name, spatial_anchors_account_name, custom_headers: nil) ⇒ Concurrent::Promise

Delete a Spatial Anchors Account.

Anchors Account. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • spatial_anchors_account_name (String)

    Name of an Mixed Reality Spatial

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
# File 'lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/spatial_anchors_accounts.rb', line 244

def delete_async(resource_group_name, , custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'spatial_anchors_account_name is nil' if .nil?
  fail ArgumentError, "'spatial_anchors_account_name' should satisfy the constraint - 'MaxLength': '90'" if !.nil? && .length > 90
  fail ArgumentError, "'spatial_anchors_account_name' should satisfy the constraint - 'MinLength': '1'" if !.nil? && .length < 1
  fail ArgumentError, "'spatial_anchors_account_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !.nil? && .match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{spatialAnchorsAccountName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'spatialAnchorsAccountName' => },
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:delete, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 204
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?

    result
  end

  promise.execute
end

#delete_with_http_info(resource_group_name, spatial_anchors_account_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Delete a Spatial Anchors Account.

Anchors Account. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • spatial_anchors_account_name (String)

    Name of an Mixed Reality Spatial

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



229
230
231
# File 'lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/spatial_anchors_accounts.rb', line 229

def delete_with_http_info(resource_group_name, , custom_headers:nil)
  delete_async(resource_group_name, , custom_headers:custom_headers).value!
end

#get(resource_group_name, spatial_anchors_account_name, custom_headers: nil) ⇒ SpatialAnchorsAccount

Retrieve a Spatial Anchors Account.

Anchors Account. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • spatial_anchors_account_name (String)

    Name of an Mixed Reality Spatial

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (SpatialAnchorsAccount)

    operation results.



306
307
308
309
# File 'lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/spatial_anchors_accounts.rb', line 306

def get(resource_group_name, , custom_headers:nil)
  response = get_async(resource_group_name, , custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_async(resource_group_name, spatial_anchors_account_name, custom_headers: nil) ⇒ Concurrent::Promise

Retrieve a Spatial Anchors Account.

Anchors Account. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • spatial_anchors_account_name (String)

    Name of an Mixed Reality Spatial

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
# File 'lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/spatial_anchors_accounts.rb', line 337

def get_async(resource_group_name, , custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'spatial_anchors_account_name is nil' if .nil?
  fail ArgumentError, "'spatial_anchors_account_name' should satisfy the constraint - 'MaxLength': '90'" if !.nil? && .length > 90
  fail ArgumentError, "'spatial_anchors_account_name' should satisfy the constraint - 'MinLength': '1'" if !.nil? && .length < 1
  fail ArgumentError, "'spatial_anchors_account_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !.nil? && .match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{spatialAnchorsAccountName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'spatialAnchorsAccountName' => },
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::MixedReality::Mgmt::V2019_02_28_preview::Models::SpatialAnchorsAccount.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#get_keys(resource_group_name, spatial_anchors_account_name, custom_headers: nil) ⇒ SpatialAnchorsAccountKeys

Get Both of the 2 Keys of a Spatial Anchors Account

Anchors Account. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • spatial_anchors_account_name (String)

    Name of an Mixed Reality Spatial

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (SpatialAnchorsAccountKeys)

    operation results.



653
654
655
656
# File 'lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/spatial_anchors_accounts.rb', line 653

def get_keys(resource_group_name, , custom_headers:nil)
  response = get_keys_async(resource_group_name, , custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_keys_async(resource_group_name, spatial_anchors_account_name, custom_headers: nil) ⇒ Concurrent::Promise

Get Both of the 2 Keys of a Spatial Anchors Account

Anchors Account. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • spatial_anchors_account_name (String)

    Name of an Mixed Reality Spatial

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
# File 'lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/spatial_anchors_accounts.rb', line 684

def get_keys_async(resource_group_name, , custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'spatial_anchors_account_name is nil' if .nil?
  fail ArgumentError, "'spatial_anchors_account_name' should satisfy the constraint - 'MaxLength': '90'" if !.nil? && .length > 90
  fail ArgumentError, "'spatial_anchors_account_name' should satisfy the constraint - 'MinLength': '1'" if !.nil? && .length < 1
  fail ArgumentError, "'spatial_anchors_account_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !.nil? && .match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{spatialAnchorsAccountName}/keys'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'spatialAnchorsAccountName' => },
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::MixedReality::Mgmt::V2019_02_28_preview::Models::SpatialAnchorsAccountKeys.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#get_keys_with_http_info(resource_group_name, spatial_anchors_account_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get Both of the 2 Keys of a Spatial Anchors Account

Anchors Account. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • spatial_anchors_account_name (String)

    Name of an Mixed Reality Spatial

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



669
670
671
# File 'lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/spatial_anchors_accounts.rb', line 669

def get_keys_with_http_info(resource_group_name, , custom_headers:nil)
  get_keys_async(resource_group_name, , custom_headers:custom_headers).value!
end

#get_with_http_info(resource_group_name, spatial_anchors_account_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Retrieve a Spatial Anchors Account.

Anchors Account. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • spatial_anchors_account_name (String)

    Name of an Mixed Reality Spatial

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



322
323
324
# File 'lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/spatial_anchors_accounts.rb', line 322

def get_with_http_info(resource_group_name, , custom_headers:nil)
  get_async(resource_group_name, , custom_headers:custom_headers).value!
end

#list_by_resource_group(resource_group_name, custom_headers: nil) ⇒ Array<SpatialAnchorsAccount>

List Resources by Resource Group

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Array<SpatialAnchorsAccount>)

    operation results.



119
120
121
122
# File 'lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/spatial_anchors_accounts.rb', line 119

def list_by_resource_group(resource_group_name, custom_headers:nil)
  first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers:custom_headers)
  first_page.get_all_items
end

#list_by_resource_group_as_lazy(resource_group_name, custom_headers: nil) ⇒ SpatialAnchorsAccountList

List Resources by Resource Group

will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (SpatialAnchorsAccountList)

    which provide lazy access to pages of the



1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
# File 'lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/spatial_anchors_accounts.rb', line 1075

def list_by_resource_group_as_lazy(resource_group_name, custom_headers:nil)
  response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_by_resource_group_async(resource_group_name, custom_headers: nil) ⇒ Concurrent::Promise

List Resources by Resource Group

to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
# File 'lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/spatial_anchors_accounts.rb', line 146

def list_by_resource_group_async(resource_group_name, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::MixedReality::Mgmt::V2019_02_28_preview::Models::SpatialAnchorsAccountList.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_by_resource_group_next(next_page_link, custom_headers: nil) ⇒ SpatialAnchorsAccountList

List Resources by Resource Group

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (SpatialAnchorsAccountList)

    operation results.



965
966
967
968
# File 'lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/spatial_anchors_accounts.rb', line 965

def list_by_resource_group_next(next_page_link, custom_headers:nil)
  response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_by_resource_group_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise

List Resources by Resource Group

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
# File 'lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/spatial_anchors_accounts.rb', line 994

def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::MixedReality::Mgmt::V2019_02_28_preview::Models::SpatialAnchorsAccountList.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_by_resource_group_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

List Resources by Resource Group

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



980
981
982
# File 'lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/spatial_anchors_accounts.rb', line 980

def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
  list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_by_resource_group_with_http_info(resource_group_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

List Resources by Resource Group

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



133
134
135
# File 'lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/spatial_anchors_accounts.rb', line 133

def list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil)
  list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
end

#list_by_subscription(custom_headers: nil) ⇒ Array<SpatialAnchorsAccount>

List Spatial Anchors Accounts by Subscription

will be added to the HTTP request.

Parameters:

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (Array<SpatialAnchorsAccount>)

    operation results.



32
33
34
35
# File 'lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/spatial_anchors_accounts.rb', line 32

def list_by_subscription(custom_headers:nil)
  first_page = list_by_subscription_as_lazy(custom_headers:custom_headers)
  first_page.get_all_items
end

#list_by_subscription_as_lazy(custom_headers: nil) ⇒ SpatialAnchorsAccountList

List Spatial Anchors Accounts by Subscription

will be added to the HTTP request.

response.

Parameters:

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (SpatialAnchorsAccountList)

    which provide lazy access to pages of the



1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
# File 'lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/spatial_anchors_accounts.rb', line 1054

def list_by_subscription_as_lazy(custom_headers:nil)
  response = list_by_subscription_async(custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_by_subscription_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end

#list_by_subscription_async(custom_headers: nil) ⇒ Concurrent::Promise

List Spatial Anchors Accounts by Subscription

to the HTTP request.

Parameters:

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/spatial_anchors_accounts.rb', line 57

def list_by_subscription_async(custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.MixedReality/spatialAnchorsAccounts'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::MixedReality::Mgmt::V2019_02_28_preview::Models::SpatialAnchorsAccountList.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_by_subscription_next(next_page_link, custom_headers: nil) ⇒ SpatialAnchorsAccountList

List Spatial Anchors Accounts by Subscription

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (SpatialAnchorsAccountList)

    operation results.



875
876
877
878
# File 'lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/spatial_anchors_accounts.rb', line 875

def list_by_subscription_next(next_page_link, custom_headers:nil)
  response = list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_by_subscription_next_async(next_page_link, custom_headers: nil) ⇒ Concurrent::Promise

List Spatial Anchors Accounts by Subscription

to List operation. to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
# File 'lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/spatial_anchors_accounts.rb', line 904

def list_by_subscription_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
  path_template = '{nextLink}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      skip_encoding_path_params: {'nextLink' => next_page_link},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:get, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::MixedReality::Mgmt::V2019_02_28_preview::Models::SpatialAnchorsAccountList.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#list_by_subscription_next_with_http_info(next_page_link, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

List Spatial Anchors Accounts by Subscription

to List operation. will be added to the HTTP request.

Parameters:

  • next_page_link (String)

    The NextLink from the previous successful call

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



890
891
892
# File 'lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/spatial_anchors_accounts.rb', line 890

def list_by_subscription_next_with_http_info(next_page_link, custom_headers:nil)
  list_by_subscription_next_async(next_page_link, custom_headers:custom_headers).value!
end

#list_by_subscription_with_http_info(custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

List Spatial Anchors Accounts by Subscription

will be added to the HTTP request.

Parameters:

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



45
46
47
# File 'lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/spatial_anchors_accounts.rb', line 45

def list_by_subscription_with_http_info(custom_headers:nil)
  list_by_subscription_async(custom_headers:custom_headers).value!
end

#regenerate_keys(resource_group_name, spatial_anchors_account_name, spatial_anchors_account_key_regenerate, custom_headers: nil) ⇒ SpatialAnchorsAccountKeys

Regenerate 1 Key of a Spatial Anchors Account

Anchors Account.

SpatialAnchorsAccountKeyRegenerateRequest

Specifying which key to be

regenerated. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • spatial_anchors_account_name (String)

    Name of an Mixed Reality Spatial

  • spatial_anchors_account_key_regenerate
  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (SpatialAnchorsAccountKeys)

    operation results.



759
760
761
762
# File 'lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/spatial_anchors_accounts.rb', line 759

def regenerate_keys(resource_group_name, , , custom_headers:nil)
  response = regenerate_keys_async(resource_group_name, , , custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#regenerate_keys_async(resource_group_name, spatial_anchors_account_name, spatial_anchors_account_key_regenerate, custom_headers: nil) ⇒ Concurrent::Promise

Regenerate 1 Key of a Spatial Anchors Account

Anchors Account.

SpatialAnchorsAccountKeyRegenerateRequest

Specifying which key to be

regenerated. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • spatial_anchors_account_name (String)

    Name of an Mixed Reality Spatial

  • spatial_anchors_account_key_regenerate
  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
# File 'lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/spatial_anchors_accounts.rb', line 796

def regenerate_keys_async(resource_group_name, , , custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'spatial_anchors_account_name is nil' if .nil?
  fail ArgumentError, "'spatial_anchors_account_name' should satisfy the constraint - 'MaxLength': '90'" if !.nil? && .length > 90
  fail ArgumentError, "'spatial_anchors_account_name' should satisfy the constraint - 'MinLength': '1'" if !.nil? && .length < 1
  fail ArgumentError, "'spatial_anchors_account_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !.nil? && .match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'spatial_anchors_account_key_regenerate is nil' if .nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::MixedReality::Mgmt::V2019_02_28_preview::Models::SpatialAnchorsAccountKeyRegenerateRequest.mapper()
  request_content = @client.serialize(request_mapper,  )
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{spatialAnchorsAccountName}/keys'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'spatialAnchorsAccountName' => },
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:post, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::MixedReality::Mgmt::V2019_02_28_preview::Models::SpatialAnchorsAccountKeys.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#regenerate_keys_with_http_info(resource_group_name, spatial_anchors_account_name, spatial_anchors_account_key_regenerate, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Regenerate 1 Key of a Spatial Anchors Account

Anchors Account.

SpatialAnchorsAccountKeyRegenerateRequest

Specifying which key to be

regenerated. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • spatial_anchors_account_name (String)

    Name of an Mixed Reality Spatial

  • spatial_anchors_account_key_regenerate
  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



778
779
780
# File 'lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/spatial_anchors_accounts.rb', line 778

def regenerate_keys_with_http_info(resource_group_name, , , custom_headers:nil)
  regenerate_keys_async(resource_group_name, , , custom_headers:custom_headers).value!
end

#update(resource_group_name, spatial_anchors_account_name, spatial_anchors_account, custom_headers: nil) ⇒ SpatialAnchorsAccount

Updating a Spatial Anchors Account

Anchors Account. Account parameter. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • spatial_anchors_account_name (String)

    Name of an Mixed Reality Spatial

  • spatial_anchors_account (SpatialAnchorsAccount)

    Spatial Anchors

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (SpatialAnchorsAccount)

    operation results.



411
412
413
414
# File 'lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/spatial_anchors_accounts.rb', line 411

def update(resource_group_name, , , custom_headers:nil)
  response = update_async(resource_group_name, , , custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#update_async(resource_group_name, spatial_anchors_account_name, spatial_anchors_account, custom_headers: nil) ⇒ Concurrent::Promise

Updating a Spatial Anchors Account

Anchors Account. Account parameter. to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • spatial_anchors_account_name (String)

    Name of an Mixed Reality Spatial

  • spatial_anchors_account (SpatialAnchorsAccount)

    Spatial Anchors

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
# File 'lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/spatial_anchors_accounts.rb', line 446

def update_async(resource_group_name, , , custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'spatial_anchors_account_name is nil' if .nil?
  fail ArgumentError, "'spatial_anchors_account_name' should satisfy the constraint - 'MaxLength': '90'" if !.nil? && .length > 90
  fail ArgumentError, "'spatial_anchors_account_name' should satisfy the constraint - 'MinLength': '1'" if !.nil? && .length < 1
  fail ArgumentError, "'spatial_anchors_account_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+$'" if !.nil? && .match(Regexp.new('^^[-\w\._\(\)]+$$')).nil?
  fail ArgumentError, 'spatial_anchors_account is nil' if .nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


  request_headers = {}
  request_headers['Content-Type'] = 'application/json; charset=utf-8'

  # Set Headers
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
  request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?

  # Serialize Request
  request_mapper = Azure::MixedReality::Mgmt::V2019_02_28_preview::Models::SpatialAnchorsAccount.mapper()
  request_content = @client.serialize(request_mapper,  )
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{spatialAnchorsAccountName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'spatialAnchorsAccountName' => },
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(:patch, path_template, options)

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::MixedReality::Mgmt::V2019_02_28_preview::Models::SpatialAnchorsAccount.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end

#update_with_http_info(resource_group_name, spatial_anchors_account_name, spatial_anchors_account, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Updating a Spatial Anchors Account

Anchors Account. Account parameter. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    Name of an Azure resource group.

  • spatial_anchors_account_name (String)

    Name of an Mixed Reality Spatial

  • spatial_anchors_account (SpatialAnchorsAccount)

    Spatial Anchors

  • custom_headers (Hash{String => String}) (defaults to: nil)

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



429
430
431
# File 'lib/2019-02-28-preview/generated/azure_mgmt_mixedreality/spatial_anchors_accounts.rb', line 429

def update_with_http_info(resource_group_name, , , custom_headers:nil)
  update_async(resource_group_name, , , custom_headers:custom_headers).value!
end