Class: Azure::Web::Mgmt::V2016_06_01::CustomApis

Inherits:
Object
  • Object
show all
Includes:
MsRestAzure
Defined in:
lib/2016-06-01/generated/azure_mgmt_web/custom_apis.rb

Overview

CustomApis

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ CustomApis

Creates and initializes a new instance of the CustomApis class.

Parameters:

  • client

    service class for accessing basic functionality.



17
18
19
# File 'lib/2016-06-01/generated/azure_mgmt_web/custom_apis.rb', line 17

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientLogicAppsManagementClient (readonly)

Returns reference to the LogicAppsManagementClient.

Returns:



22
23
24
# File 'lib/2016-06-01/generated/azure_mgmt_web/custom_apis.rb', line 22

def client
  @client
end

Instance Method Details

#create_or_update(subscription_id, resource_group_name, api_name, custom_api, api_version, custom_headers: nil) ⇒ CustomApiDefinition

Replaces an existing custom API

Creates or updates an existing custom API

will be added to the HTTP request.

Parameters:

  • subscription_id (String)

    Subscription Id

  • resource_group_name (String)

    The resource group

  • api_name (String)

    API name

  • custom_api (CustomApiDefinition)

    The custom API

  • api_version (String)

    API Version

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

    A hash of custom headers that

Returns:

  • (CustomApiDefinition)

    operation results.



360
361
362
363
# File 'lib/2016-06-01/generated/azure_mgmt_web/custom_apis.rb', line 360

def create_or_update(subscription_id, resource_group_name, api_name, custom_api, api_version, custom_headers:nil)
  response = create_or_update_async(subscription_id, resource_group_name, api_name, custom_api, api_version, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#create_or_update_async(subscription_id, resource_group_name, api_name, custom_api, api_version, custom_headers: nil) ⇒ Concurrent::Promise

Replaces an existing custom API

Creates or updates an existing custom API

to the HTTP request.

Parameters:

  • subscription_id (String)

    Subscription Id

  • resource_group_name (String)

    The resource group

  • api_name (String)

    API name

  • custom_api (CustomApiDefinition)

    The custom API

  • api_version (String)

    API Version

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
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
# File 'lib/2016-06-01/generated/azure_mgmt_web/custom_apis.rb', line 399

def create_or_update_async(subscription_id, resource_group_name, api_name, custom_api, api_version, custom_headers:nil)
  fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'api_name is nil' if api_name.nil?
  fail ArgumentError, 'custom_api is nil' if custom_api.nil?
  fail ArgumentError, 'api_version is nil' if 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::Web::Mgmt::V2016_06_01::Models::CustomApiDefinition.mapper()
  request_content = @client.serialize(request_mapper,  custom_api)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/customApis/{apiName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => subscription_id,'resourceGroupName' => resource_group_name,'apiName' => api_name},
      query_params: {'api-version' => 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
      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::Web::Mgmt::V2016_06_01::Models::CustomApiDefinition.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_or_update_with_http_info(subscription_id, resource_group_name, api_name, custom_api, api_version, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Replaces an existing custom API

Creates or updates an existing custom API

will be added to the HTTP request.

Parameters:

  • subscription_id (String)

    Subscription Id

  • resource_group_name (String)

    The resource group

  • api_name (String)

    API name

  • custom_api (CustomApiDefinition)

    The custom API

  • api_version (String)

    API Version

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



380
381
382
# File 'lib/2016-06-01/generated/azure_mgmt_web/custom_apis.rb', line 380

def create_or_update_with_http_info(subscription_id, resource_group_name, api_name, custom_api, api_version, custom_headers:nil)
  create_or_update_async(subscription_id, resource_group_name, api_name, custom_api, api_version, custom_headers:custom_headers).value!
end

#delete(subscription_id, resource_group_name, api_name, api_version, custom_headers: nil) ⇒ Object

Delete a custom API

Deletes a custom API from the resource group

will be added to the HTTP request.

Parameters:

  • subscription_id (String)

    Subscription Id

  • resource_group_name (String)

    The resource group

  • api_name (String)

    API name

  • api_version (String)

    API Version

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

    A hash of custom headers that



592
593
594
595
# File 'lib/2016-06-01/generated/azure_mgmt_web/custom_apis.rb', line 592

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

#delete_async(subscription_id, resource_group_name, api_name, api_version, custom_headers: nil) ⇒ Concurrent::Promise

Delete a custom API

Deletes a custom API from the resource group

to the HTTP request.

Parameters:

  • subscription_id (String)

    Subscription Id

  • resource_group_name (String)

    The resource group

  • api_name (String)

    API name

  • api_version (String)

    API Version

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
# File 'lib/2016-06-01/generated/azure_mgmt_web/custom_apis.rb', line 629

def delete_async(subscription_id, resource_group_name, api_name, api_version, custom_headers:nil)
  fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'api_name is nil' if api_name.nil?
  fail ArgumentError, 'api_version is nil' if 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.Web/customApis/{apiName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => subscription_id,'resourceGroupName' => resource_group_name,'apiName' => api_name},
      query_params: {'api-version' => 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 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?

    result
  end

  promise.execute
end

#delete_with_http_info(subscription_id, resource_group_name, api_name, api_version, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Delete a custom API

Deletes a custom API from the resource group

will be added to the HTTP request.

Parameters:

  • subscription_id (String)

    Subscription Id

  • resource_group_name (String)

    The resource group

  • api_name (String)

    API name

  • api_version (String)

    API Version

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



611
612
613
# File 'lib/2016-06-01/generated/azure_mgmt_web/custom_apis.rb', line 611

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

#extract_api_definition_from_wsdl(subscription_id, location, wsdl_definition, api_version, custom_headers: nil) ⇒ Object

Returns API definition from WSDL

Parses the specified WSDL and extracts the API definition

will be added to the HTTP request.

Parameters:

  • subscription_id (String)

    Subscription Id

  • location (String)

    The location

  • wsdl_definition (WsdlDefinition)

    WSDL definition

  • api_version (String)

    API Version

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

    A hash of custom headers that

Returns:

  • (Object)

    operation results.



907
908
909
910
# File 'lib/2016-06-01/generated/azure_mgmt_web/custom_apis.rb', line 907

def extract_api_definition_from_wsdl(subscription_id, location, wsdl_definition, api_version, custom_headers:nil)
  response = extract_api_definition_from_wsdl_async(subscription_id, location, wsdl_definition, api_version, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#extract_api_definition_from_wsdl_async(subscription_id, location, wsdl_definition, api_version, custom_headers: nil) ⇒ Concurrent::Promise

Returns API definition from WSDL

Parses the specified WSDL and extracts the API definition

to the HTTP request.

Parameters:

  • subscription_id (String)

    Subscription Id

  • location (String)

    The location

  • wsdl_definition (WsdlDefinition)

    WSDL definition

  • api_version (String)

    API Version

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
# File 'lib/2016-06-01/generated/azure_mgmt_web/custom_apis.rb', line 944

def extract_api_definition_from_wsdl_async(subscription_id, location, wsdl_definition, api_version, custom_headers:nil)
  fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
  fail ArgumentError, 'location is nil' if location.nil?
  fail ArgumentError, 'wsdl_definition is nil' if wsdl_definition.nil?
  fail ArgumentError, 'api_version is nil' if 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::Web::Mgmt::V2016_06_01::Models::WsdlDefinition.mapper()
  request_content = @client.serialize(request_mapper,  wsdl_definition)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Web/locations/{location}/extractApiDefinitionFromWsdl'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => subscription_id,'location' => location},
      query_params: {'api-version' => 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 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?

    result
  end

  promise.execute
end

#extract_api_definition_from_wsdl_with_http_info(subscription_id, location, wsdl_definition, api_version, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Returns API definition from WSDL

Parses the specified WSDL and extracts the API definition

will be added to the HTTP request.

Parameters:

  • subscription_id (String)

    Subscription Id

  • location (String)

    The location

  • wsdl_definition (WsdlDefinition)

    WSDL definition

  • api_version (String)

    API Version

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



926
927
928
# File 'lib/2016-06-01/generated/azure_mgmt_web/custom_apis.rb', line 926

def extract_api_definition_from_wsdl_with_http_info(subscription_id, location, wsdl_definition, api_version, custom_headers:nil)
  extract_api_definition_from_wsdl_async(subscription_id, location, wsdl_definition, api_version, custom_headers:custom_headers).value!
end

#get(subscription_id, resource_group_name, api_name, api_version, custom_headers: nil) ⇒ CustomApiDefinition

Get a custom API

Gets a custom API by name for a specific subscription and resource group

will be added to the HTTP request.

Parameters:

  • subscription_id (String)

    Subscription Id

  • resource_group_name (String)

    The resource group

  • api_name (String)

    API name

  • api_version (String)

    API Version

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

    A hash of custom headers that

Returns:

  • (CustomApiDefinition)

    operation results.



253
254
255
256
# File 'lib/2016-06-01/generated/azure_mgmt_web/custom_apis.rb', line 253

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

#get_async(subscription_id, resource_group_name, api_name, api_version, custom_headers: nil) ⇒ Concurrent::Promise

Get a custom API

Gets a custom API by name for a specific subscription and resource group

to the HTTP request.

Parameters:

  • subscription_id (String)

    Subscription Id

  • resource_group_name (String)

    The resource group

  • api_name (String)

    API name

  • api_version (String)

    API Version

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
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
# File 'lib/2016-06-01/generated/azure_mgmt_web/custom_apis.rb', line 290

def get_async(subscription_id, resource_group_name, api_name, api_version, custom_headers:nil)
  fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'api_name is nil' if api_name.nil?
  fail ArgumentError, 'api_version is nil' if 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.Web/customApis/{apiName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => subscription_id,'resourceGroupName' => resource_group_name,'apiName' => api_name},
      query_params: {'api-version' => 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::Web::Mgmt::V2016_06_01::Models::CustomApiDefinition.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_with_http_info(subscription_id, resource_group_name, api_name, api_version, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Get a custom API

Gets a custom API by name for a specific subscription and resource group

will be added to the HTTP request.

Parameters:

  • subscription_id (String)

    Subscription Id

  • resource_group_name (String)

    The resource group

  • api_name (String)

    API name

  • api_version (String)

    API Version

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



272
273
274
# File 'lib/2016-06-01/generated/azure_mgmt_web/custom_apis.rb', line 272

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

#list(subscription_id, api_version, top: nil, skiptoken: nil, custom_headers: nil) ⇒ CustomApiDefinitionCollection

List of custom APIs

Gets a list of all custom APIs for a subscription id

will be added to the HTTP request.

Parameters:

  • subscription_id (String)

    Subscription Id

  • api_version (String)

    API Version

  • top (Integer) (defaults to: nil)

    The number of items to be included in the result

  • skiptoken (String) (defaults to: nil)

    Skip Token

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

    A hash of custom headers that

Returns:

  • (CustomApiDefinitionCollection)

    operation results.



38
39
40
41
# File 'lib/2016-06-01/generated/azure_mgmt_web/custom_apis.rb', line 38

def list(subscription_id, api_version, top:nil, skiptoken:nil, custom_headers:nil)
  response = list_async(subscription_id, api_version, top:top, skiptoken:skiptoken, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_async(subscription_id, api_version, top: nil, skiptoken: nil, custom_headers: nil) ⇒ Concurrent::Promise

List of custom APIs

Gets a list of all custom APIs for a subscription id

to the HTTP request.

Parameters:

  • subscription_id (String)

    Subscription Id

  • api_version (String)

    API Version

  • top (Integer) (defaults to: nil)

    The number of items to be included in the result

  • skiptoken (String) (defaults to: nil)

    Skip Token

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/2016-06-01/generated/azure_mgmt_web/custom_apis.rb', line 75

def list_async(subscription_id, api_version, top:nil, skiptoken:nil, custom_headers:nil)
  fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
  fail ArgumentError, 'api_version is nil' if 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.Web/customApis'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => subscription_id},
      query_params: {'api-version' => api_version,'$top' => top,'skiptoken' => skiptoken},
      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::Web::Mgmt::V2016_06_01::Models::CustomApiDefinitionCollection.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(subscription_id, resource_group_name, api_version, top: nil, skiptoken: nil, custom_headers: nil) ⇒ CustomApiDefinitionCollection

List of custom APIs

Gets a list of all custom APIs in a subscription for a specific resource group

will be added to the HTTP request.

Parameters:

  • subscription_id (String)

    Subscription Id

  • resource_group_name (String)

    The resource group

  • api_version (String)

    API Version

  • top (Integer) (defaults to: nil)

    The number of items to be included in the result

  • skiptoken (String) (defaults to: nil)

    Skip Token

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

    A hash of custom headers that

Returns:

  • (CustomApiDefinitionCollection)

    operation results.



144
145
146
147
# File 'lib/2016-06-01/generated/azure_mgmt_web/custom_apis.rb', line 144

def list_by_resource_group(subscription_id, resource_group_name, api_version, top:nil, skiptoken:nil, custom_headers:nil)
  response = list_by_resource_group_async(subscription_id, resource_group_name, api_version, top:top, skiptoken:skiptoken, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_by_resource_group_async(subscription_id, resource_group_name, api_version, top: nil, skiptoken: nil, custom_headers: nil) ⇒ Concurrent::Promise

List of custom APIs

Gets a list of all custom APIs in a subscription for a specific resource group

to the HTTP request.

Parameters:

  • subscription_id (String)

    Subscription Id

  • resource_group_name (String)

    The resource group

  • api_version (String)

    API Version

  • top (Integer) (defaults to: nil)

    The number of items to be included in the result

  • skiptoken (String) (defaults to: nil)

    Skip Token

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
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
# File 'lib/2016-06-01/generated/azure_mgmt_web/custom_apis.rb', line 185

def list_by_resource_group_async(subscription_id, resource_group_name, api_version, top:nil, skiptoken:nil, custom_headers:nil)
  fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'api_version is nil' if 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.Web/customApis'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => subscription_id,'resourceGroupName' => resource_group_name},
      query_params: {'api-version' => api_version,'$top' => top,'skiptoken' => skiptoken},
      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::Web::Mgmt::V2016_06_01::Models::CustomApiDefinitionCollection.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_with_http_info(subscription_id, resource_group_name, api_version, top: nil, skiptoken: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

List of custom APIs

Gets a list of all custom APIs in a subscription for a specific resource group

will be added to the HTTP request.

Parameters:

  • subscription_id (String)

    Subscription Id

  • resource_group_name (String)

    The resource group

  • api_version (String)

    API Version

  • top (Integer) (defaults to: nil)

    The number of items to be included in the result

  • skiptoken (String) (defaults to: nil)

    Skip Token

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



165
166
167
# File 'lib/2016-06-01/generated/azure_mgmt_web/custom_apis.rb', line 165

def list_by_resource_group_with_http_info(subscription_id, resource_group_name, api_version, top:nil, skiptoken:nil, custom_headers:nil)
  list_by_resource_group_async(subscription_id, resource_group_name, api_version, top:top, skiptoken:skiptoken, custom_headers:custom_headers).value!
end

#list_with_http_info(subscription_id, api_version, top: nil, skiptoken: nil, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

List of custom APIs

Gets a list of all custom APIs for a subscription id

will be added to the HTTP request.

Parameters:

  • subscription_id (String)

    Subscription Id

  • api_version (String)

    API Version

  • top (Integer) (defaults to: nil)

    The number of items to be included in the result

  • skiptoken (String) (defaults to: nil)

    Skip Token

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



57
58
59
# File 'lib/2016-06-01/generated/azure_mgmt_web/custom_apis.rb', line 57

def list_with_http_info(subscription_id, api_version, top:nil, skiptoken:nil, custom_headers:nil)
  list_async(subscription_id, api_version, top:top, skiptoken:skiptoken, custom_headers:custom_headers).value!
end

#list_wsdl_interfaces(subscription_id, location, wsdl_definition, api_version, custom_headers: nil) ⇒ WsdlServiceCollection

Lists WSDL interfaces

This returns the list of interfaces in the WSDL

will be added to the HTTP request.

Parameters:

  • subscription_id (String)

    Subscription Id

  • location (String)

    The location

  • wsdl_definition (WsdlDefinition)

    WSDL definition

  • api_version (String)

    API Version

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

    A hash of custom headers that

Returns:

  • (WsdlServiceCollection)

    operation results.



794
795
796
797
# File 'lib/2016-06-01/generated/azure_mgmt_web/custom_apis.rb', line 794

def list_wsdl_interfaces(subscription_id, location, wsdl_definition, api_version, custom_headers:nil)
  response = list_wsdl_interfaces_async(subscription_id, location, wsdl_definition, api_version, custom_headers:custom_headers).value!
  response.body unless response.nil?
end

#list_wsdl_interfaces_async(subscription_id, location, wsdl_definition, api_version, custom_headers: nil) ⇒ Concurrent::Promise

Lists WSDL interfaces

This returns the list of interfaces in the WSDL

to the HTTP request.

Parameters:

  • subscription_id (String)

    Subscription Id

  • location (String)

    The location

  • wsdl_definition (WsdlDefinition)

    WSDL definition

  • api_version (String)

    API Version

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



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
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
# File 'lib/2016-06-01/generated/azure_mgmt_web/custom_apis.rb', line 831

def list_wsdl_interfaces_async(subscription_id, location, wsdl_definition, api_version, custom_headers:nil)
  fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
  fail ArgumentError, 'location is nil' if location.nil?
  fail ArgumentError, 'wsdl_definition is nil' if wsdl_definition.nil?
  fail ArgumentError, 'api_version is nil' if 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::Web::Mgmt::V2016_06_01::Models::WsdlDefinition.mapper()
  request_content = @client.serialize(request_mapper,  wsdl_definition)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Web/locations/{location}/listWsdlInterfaces'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => subscription_id,'location' => location},
      query_params: {'api-version' => 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 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::Web::Mgmt::V2016_06_01::Models::WsdlServiceCollection.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_wsdl_interfaces_with_http_info(subscription_id, location, wsdl_definition, api_version, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Lists WSDL interfaces

This returns the list of interfaces in the WSDL

will be added to the HTTP request.

Parameters:

  • subscription_id (String)

    Subscription Id

  • location (String)

    The location

  • wsdl_definition (WsdlDefinition)

    WSDL definition

  • api_version (String)

    API Version

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



813
814
815
# File 'lib/2016-06-01/generated/azure_mgmt_web/custom_apis.rb', line 813

def list_wsdl_interfaces_with_http_info(subscription_id, location, wsdl_definition, api_version, custom_headers:nil)
  list_wsdl_interfaces_async(subscription_id, location, wsdl_definition, api_version, custom_headers:custom_headers).value!
end

#move(subscription_id, resource_group_name, api_name, custom_api_reference, api_version, custom_headers: nil) ⇒ Object

Moves the custom API

Moves a specific custom API

will be added to the HTTP request.

Parameters:

  • subscription_id (String)

    Subscription Id

  • resource_group_name (String)

    The resource group

  • api_name (String)

    API name

  • custom_api_reference (CustomApiReference)

    The custom API reference

  • api_version (String)

    API Version

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

    A hash of custom headers that



688
689
690
691
# File 'lib/2016-06-01/generated/azure_mgmt_web/custom_apis.rb', line 688

def move(subscription_id, resource_group_name, api_name, custom_api_reference, api_version, custom_headers:nil)
  response = move_async(subscription_id, resource_group_name, api_name, custom_api_reference, api_version, custom_headers:custom_headers).value!
  nil
end

#move_async(subscription_id, resource_group_name, api_name, custom_api_reference, api_version, custom_headers: nil) ⇒ Concurrent::Promise

Moves the custom API

Moves a specific custom API

to the HTTP request.

Parameters:

  • subscription_id (String)

    Subscription Id

  • resource_group_name (String)

    The resource group

  • api_name (String)

    API name

  • custom_api_reference (CustomApiReference)

    The custom API reference

  • api_version (String)

    API Version

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
# File 'lib/2016-06-01/generated/azure_mgmt_web/custom_apis.rb', line 727

def move_async(subscription_id, resource_group_name, api_name, custom_api_reference, api_version, custom_headers:nil)
  fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'api_name is nil' if api_name.nil?
  fail ArgumentError, 'custom_api_reference is nil' if custom_api_reference.nil?
  fail ArgumentError, 'api_version is nil' if 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::Web::Mgmt::V2016_06_01::Models::CustomApiReference.mapper()
  request_content = @client.serialize(request_mapper,  custom_api_reference)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/customApis/{apiName}/move'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => subscription_id,'resourceGroupName' => resource_group_name,'apiName' => api_name},
      query_params: {'api-version' => 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 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?

    result
  end

  promise.execute
end

#move_with_http_info(subscription_id, resource_group_name, api_name, custom_api_reference, api_version, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Moves the custom API

Moves a specific custom API

will be added to the HTTP request.

Parameters:

  • subscription_id (String)

    Subscription Id

  • resource_group_name (String)

    The resource group

  • api_name (String)

    API name

  • custom_api_reference (CustomApiReference)

    The custom API reference

  • api_version (String)

    API Version

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



708
709
710
# File 'lib/2016-06-01/generated/azure_mgmt_web/custom_apis.rb', line 708

def move_with_http_info(subscription_id, resource_group_name, api_name, custom_api_reference, api_version, custom_headers:nil)
  move_async(subscription_id, resource_group_name, api_name, custom_api_reference, api_version, custom_headers:custom_headers).value!
end

#update(subscription_id, resource_group_name, api_name, custom_api, api_version, custom_headers: nil) ⇒ CustomApiDefinition

Update an existing custom API

Updates an existing custom API’s tags

will be added to the HTTP request.

Parameters:

  • subscription_id (String)

    Subscription Id

  • resource_group_name (String)

    The resource group

  • api_name (String)

    API name

  • custom_api (CustomApiDefinition)

    The custom API

  • api_version (String)

    API Version

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

    A hash of custom headers that

Returns:

  • (CustomApiDefinition)

    operation results.



477
478
479
480
# File 'lib/2016-06-01/generated/azure_mgmt_web/custom_apis.rb', line 477

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

#update_async(subscription_id, resource_group_name, api_name, custom_api, api_version, custom_headers: nil) ⇒ Concurrent::Promise

Update an existing custom API

Updates an existing custom API’s tags

to the HTTP request.

Parameters:

  • subscription_id (String)

    Subscription Id

  • resource_group_name (String)

    The resource group

  • api_name (String)

    API name

  • custom_api (CustomApiDefinition)

    The custom API

  • api_version (String)

    API Version

  • A (Hash{String => String})

    hash of custom headers that will be added

Returns:

  • (Concurrent::Promise)

    Promise object which holds the HTTP response.



516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
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
# File 'lib/2016-06-01/generated/azure_mgmt_web/custom_apis.rb', line 516

def update_async(subscription_id, resource_group_name, api_name, custom_api, api_version, custom_headers:nil)
  fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'api_name is nil' if api_name.nil?
  fail ArgumentError, 'custom_api is nil' if custom_api.nil?
  fail ArgumentError, 'api_version is nil' if 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::Web::Mgmt::V2016_06_01::Models::CustomApiDefinition.mapper()
  request_content = @client.serialize(request_mapper,  custom_api)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/customApis/{apiName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => subscription_id,'resourceGroupName' => resource_group_name,'apiName' => api_name},
      query_params: {'api-version' => 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 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::Web::Mgmt::V2016_06_01::Models::CustomApiDefinition.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(subscription_id, resource_group_name, api_name, custom_api, api_version, custom_headers: nil) ⇒ MsRestAzure::AzureOperationResponse

Update an existing custom API

Updates an existing custom API’s tags

will be added to the HTTP request.

Parameters:

  • subscription_id (String)

    Subscription Id

  • resource_group_name (String)

    The resource group

  • api_name (String)

    API name

  • custom_api (CustomApiDefinition)

    The custom API

  • api_version (String)

    API Version

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

    A hash of custom headers that

Returns:

  • (MsRestAzure::AzureOperationResponse)

    HTTP response information.



497
498
499
# File 'lib/2016-06-01/generated/azure_mgmt_web/custom_apis.rb', line 497

def update_with_http_info(subscription_id, resource_group_name, api_name, custom_api, api_version, custom_headers:nil)
  update_async(subscription_id, resource_group_name, api_name, custom_api, api_version, custom_headers:custom_headers).value!
end