Class: Azure::ApiManagement::Mgmt::V2018_01_01::TenantConfiguration

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/2018-01-01/generated/azure_mgmt_api_management/tenant_configuration.rb

Overview

ApiManagement Client

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ TenantConfiguration

Creates and initializes a new instance of the TenantConfiguration class.

Parameters:

  • client

    service class for accessing basic functionality.



17
18
19
# File 'lib/2018-01-01/generated/azure_mgmt_api_management/tenant_configuration.rb', line 17

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientApiManagementClient (readonly)

Returns reference to the ApiManagementClient.

Returns:



22
23
24
# File 'lib/2018-01-01/generated/azure_mgmt_api_management/tenant_configuration.rb', line 22

def client
  @client
end

Instance Method Details

#begin_deploy(resource_group_name, service_name, parameters, custom_headers: nil) ⇒ OperationResultContract

This operation applies changes from the specified Git branch to the configuration database. This is a long running operation and could take several minutes to complete.

parameters. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • service_name (String)

    The name of the API Management service.

  • parameters (DeployConfigurationParameters)

    Deploy Configuration

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

    A hash of custom headers that

Returns:

  • (OperationResultContract)

    operation results.



280
281
282
283
# File 'lib/2018-01-01/generated/azure_mgmt_api_management/tenant_configuration.rb', line 280

def begin_deploy(resource_group_name, service_name, parameters, custom_headers:nil)
  response = begin_deploy_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_deploy_async(resource_group_name, service_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise

This operation applies changes from the specified Git branch to the configuration database. This is a long running operation and could take several minutes to complete.

parameters. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • service_name (String)

    The name of the API Management service.

  • parameters (DeployConfigurationParameters)

    Deploy Configuration

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
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
# File 'lib/2018-01-01/generated/azure_mgmt_api_management/tenant_configuration.rb', line 317

def begin_deploy_async(resource_group_name, service_name, parameters, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'service_name is nil' if service_name.nil?
  fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50
  fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1
  fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil?
  fail ArgumentError, 'parameters is nil' if parameters.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  configuration_name = 'configuration'


  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::ApiManagement::Mgmt::V2018_01_01::Models::DeployConfigurationParameters.mapper()
  request_content = @client.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/deploy'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id,'configurationName' => configuration_name},
      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 == 202 || 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::ApiManagement::Mgmt::V2018_01_01::Models::OperationResultContract.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

#begin_deploy_with_http_info(resource_group_name, service_name, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

This operation applies changes from the specified Git branch to the configuration database. This is a long running operation and could take several minutes to complete.

parameters. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • service_name (String)

    The name of the API Management service.

  • parameters (DeployConfigurationParameters)

    Deploy Configuration

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



299
300
301
# File 'lib/2018-01-01/generated/azure_mgmt_api_management/tenant_configuration.rb', line 299

def begin_deploy_with_http_info(resource_group_name, service_name, parameters, custom_headers:nil)
  begin_deploy_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value!
end

#begin_save(resource_group_name, service_name, parameters, custom_headers: nil) ⇒ OperationResultContract

This operation creates a commit with the current configuration snapshot to the specified branch in the repository. This is a long running operation and could take several minutes to complete.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • service_name (String)

    The name of the API Management service.

  • parameters (SaveConfigurationParameter)

    Save Configuration parameters.

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

    A hash of custom headers that

Returns:

  • (OperationResultContract)

    operation results.



397
398
399
400
# File 'lib/2018-01-01/generated/azure_mgmt_api_management/tenant_configuration.rb', line 397

def begin_save(resource_group_name, service_name, parameters, custom_headers:nil)
  response = begin_save_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_save_async(resource_group_name, service_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise

This operation creates a commit with the current configuration snapshot to the specified branch in the repository. This is a long running operation and could take several minutes to complete.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • service_name (String)

    The name of the API Management service.

  • parameters (SaveConfigurationParameter)

    Save Configuration parameters.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



432
433
434
435
436
437
438
439
440
441
442
443
444
445
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
# File 'lib/2018-01-01/generated/azure_mgmt_api_management/tenant_configuration.rb', line 432

def begin_save_async(resource_group_name, service_name, parameters, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'service_name is nil' if service_name.nil?
  fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50
  fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1
  fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil?
  fail ArgumentError, 'parameters is nil' if parameters.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  configuration_name = 'configuration'


  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::ApiManagement::Mgmt::V2018_01_01::Models::SaveConfigurationParameter.mapper()
  request_content = @client.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/save'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id,'configurationName' => configuration_name},
      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 == 202 || 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::ApiManagement::Mgmt::V2018_01_01::Models::OperationResultContract.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

#begin_save_with_http_info(resource_group_name, service_name, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

This operation creates a commit with the current configuration snapshot to the specified branch in the repository. This is a long running operation and could take several minutes to complete.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • service_name (String)

    The name of the API Management service.

  • parameters (SaveConfigurationParameter)

    Save Configuration parameters.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



415
416
417
# File 'lib/2018-01-01/generated/azure_mgmt_api_management/tenant_configuration.rb', line 415

def begin_save_with_http_info(resource_group_name, service_name, parameters, custom_headers:nil)
  begin_save_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value!
end

#begin_validate(resource_group_name, service_name, parameters, custom_headers: nil) ⇒ OperationResultContract

This operation validates the changes in the specified Git branch. This is a long running operation and could take several minutes to complete.

parameters. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • service_name (String)

    The name of the API Management service.

  • parameters (DeployConfigurationParameters)

    Validate Configuration

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

    A hash of custom headers that

Returns:

  • (OperationResultContract)

    operation results.



512
513
514
515
# File 'lib/2018-01-01/generated/azure_mgmt_api_management/tenant_configuration.rb', line 512

def begin_validate(resource_group_name, service_name, parameters, custom_headers:nil)
  response = begin_validate_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#begin_validate_async(resource_group_name, service_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise

This operation validates the changes in the specified Git branch. This is a long running operation and could take several minutes to complete.

parameters. to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • service_name (String)

    The name of the API Management service.

  • parameters (DeployConfigurationParameters)

    Validate Configuration

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
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
# File 'lib/2018-01-01/generated/azure_mgmt_api_management/tenant_configuration.rb', line 547

def begin_validate_async(resource_group_name, service_name, parameters, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'service_name is nil' if service_name.nil?
  fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50
  fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1
  fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil?
  fail ArgumentError, 'parameters is nil' if parameters.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  configuration_name = 'configuration'


  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::ApiManagement::Mgmt::V2018_01_01::Models::DeployConfigurationParameters.mapper()
  request_content = @client.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/validate'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id,'configurationName' => configuration_name},
      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 == 202 || 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::ApiManagement::Mgmt::V2018_01_01::Models::OperationResultContract.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

#begin_validate_with_http_info(resource_group_name, service_name, parameters, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

This operation validates the changes in the specified Git branch. This is a long running operation and could take several minutes to complete.

parameters. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • service_name (String)

    The name of the API Management service.

  • parameters (DeployConfigurationParameters)

    Validate Configuration

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



530
531
532
# File 'lib/2018-01-01/generated/azure_mgmt_api_management/tenant_configuration.rb', line 530

def begin_validate_with_http_info(resource_group_name, service_name, parameters, custom_headers:nil)
  begin_validate_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value!
end

#deploy(resource_group_name, service_name, parameters, custom_headers: nil) ⇒ OperationResultContract

This operation applies changes from the specified Git branch to the configuration database. This is a long running operation and could take several minutes to complete.

parameters. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • service_name (String)

    The name of the API Management service.

  • parameters (DeployConfigurationParameters)

    Deploy Configuration

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

    A hash of custom headers that

Returns:

  • (OperationResultContract)

    operation results.



38
39
40
41
# File 'lib/2018-01-01/generated/azure_mgmt_api_management/tenant_configuration.rb', line 38

def deploy(resource_group_name, service_name, parameters, custom_headers:nil)
  response = deploy_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#deploy_async(resource_group_name, service_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise

parameters. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • service_name (String)

    The name of the API Management service.

  • parameters (DeployConfigurationParameters)

    Deploy Configuration

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/2018-01-01/generated/azure_mgmt_api_management/tenant_configuration.rb', line 54

def deploy_async(resource_group_name, service_name, parameters, custom_headers:nil)
  # Send request
  promise = begin_deploy_async(resource_group_name, service_name, parameters, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01::Models::OperationResultContract.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response)
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#get_sync_state(resource_group_name, service_name, custom_headers: nil) ⇒ TenantConfigurationSyncStateContract

Gets the status of the most recent synchronization between the configuration database and the Git repository.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • service_name (String)

    The name of the API Management service.

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

    A hash of custom headers that

Returns:

  • (TenantConfigurationSyncStateContract)

    operation results.



176
177
178
179
# File 'lib/2018-01-01/generated/azure_mgmt_api_management/tenant_configuration.rb', line 176

def get_sync_state(resource_group_name, service_name, custom_headers:nil)
  response = get_sync_state_async(resource_group_name, service_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#get_sync_state_async(resource_group_name, service_name, custom_headers: nil) ⇒ Concurrent::Promise

Gets the status of the most recent synchronization between the configuration database and the Git repository.

to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • service_name (String)

    The name of the API Management service.

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
# File 'lib/2018-01-01/generated/azure_mgmt_api_management/tenant_configuration.rb', line 207

def get_sync_state_async(resource_group_name, service_name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'service_name is nil' if service_name.nil?
  fail ArgumentError, "'service_name' should satisfy the constraint - 'MaxLength': '50'" if !service_name.nil? && service_name.length > 50
  fail ArgumentError, "'service_name' should satisfy the constraint - 'MinLength': '1'" if !service_name.nil? && service_name.length < 1
  fail ArgumentError, "'service_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'" if !service_name.nil? && service_name.match(Regexp.new('^^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  configuration_name = 'configuration'


  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.ApiManagement/service/{serviceName}/tenant/{configurationName}/syncState'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'serviceName' => service_name,'subscriptionId' => @client.subscription_id,'configurationName' => configuration_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 MsRestAzure::AzureOperationError.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::ApiManagement::Mgmt::V2018_01_01::Models::TenantConfigurationSyncStateContract.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_sync_state_with_http_info(resource_group_name, service_name, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Gets the status of the most recent synchronization between the configuration database and the Git repository.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • service_name (String)

    The name of the API Management service.

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



192
193
194
# File 'lib/2018-01-01/generated/azure_mgmt_api_management/tenant_configuration.rb', line 192

def get_sync_state_with_http_info(resource_group_name, service_name, custom_headers:nil)
  get_sync_state_async(resource_group_name, service_name, custom_headers:custom_headers).value!
end

#save(resource_group_name, service_name, parameters, custom_headers: nil) ⇒ OperationResultContract

This operation creates a commit with the current configuration snapshot to the specified branch in the repository. This is a long running operation and could take several minutes to complete.

will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • service_name (String)

    The name of the API Management service.

  • parameters (SaveConfigurationParameter)

    Save Configuration parameters.

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

    A hash of custom headers that

Returns:

  • (OperationResultContract)

    operation results.



85
86
87
88
# File 'lib/2018-01-01/generated/azure_mgmt_api_management/tenant_configuration.rb', line 85

def save(resource_group_name, service_name, parameters, custom_headers:nil)
  response = save_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#save_async(resource_group_name, service_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise

will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • service_name (String)

    The name of the API Management service.

  • parameters (SaveConfigurationParameter)

    Save Configuration parameters.

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'lib/2018-01-01/generated/azure_mgmt_api_management/tenant_configuration.rb', line 100

def save_async(resource_group_name, service_name, parameters, custom_headers:nil)
  # Send request
  promise = begin_save_async(resource_group_name, service_name, parameters, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01::Models::OperationResultContract.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response)
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end

#validate(resource_group_name, service_name, parameters, custom_headers: nil) ⇒ OperationResultContract

This operation validates the changes in the specified Git branch. This is a long running operation and could take several minutes to complete.

parameters. will be added to the HTTP request.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • service_name (String)

    The name of the API Management service.

  • parameters (DeployConfigurationParameters)

    Validate Configuration

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

    A hash of custom headers that

Returns:

  • (OperationResultContract)

    operation results.



131
132
133
134
# File 'lib/2018-01-01/generated/azure_mgmt_api_management/tenant_configuration.rb', line 131

def validate(resource_group_name, service_name, parameters, custom_headers:nil)
  response = validate_async(resource_group_name, service_name, parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#validate_async(resource_group_name, service_name, parameters, custom_headers: nil) ⇒ Concurrent::Promise

parameters. will be added to the HTTP request.

response.

Parameters:

  • resource_group_name (String)

    The name of the resource group.

  • service_name (String)

    The name of the API Management service.

  • parameters (DeployConfigurationParameters)

    Validate Configuration

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

    A hash of custom headers that

Returns:

  • (Concurrent::Promise)

    promise which provides async access to http



147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# File 'lib/2018-01-01/generated/azure_mgmt_api_management/tenant_configuration.rb', line 147

def validate_async(resource_group_name, service_name, parameters, custom_headers:nil)
  # Send request
  promise = begin_validate_async(resource_group_name, service_name, parameters, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::ApiManagement::Mgmt::V2018_01_01::Models::OperationResultContract.mapper()
      parsed_response = @client.deserialize(result_mapper, parsed_response)
    end

    # Waiting for response.
    @client.get_long_running_operation_result(response, deserialize_method)
  end

  promise
end