class Azure::Web::Mgmt::V2016_06_01::CustomApis

CustomApis

Attributes

client[R]

@return [LogicAppsManagementClient] reference to the LogicAppsManagementClient

Public Class Methods

new(client) click to toggle source

Creates and initializes a new instance of the CustomApis class. @param client service class for accessing basic functionality.

# File lib/2016-06-01/generated/azure_mgmt_web/custom_apis.rb, line 17
def initialize(client)
  @client = client
end

Public Instance Methods

create_or_update(subscription_id, resource_group_name, api_name, custom_api, api_version, custom_headers:nil) click to toggle source

Replaces an existing custom API

Creates or updates an existing custom API

@param subscription_id [String] Subscription Id @param resource_group_name [String] The resource group @param api_name [String] API name @param custom_api [CustomApiDefinition] The custom API @param api_version [String] API Version @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [CustomApiDefinition] operation results.

# 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) click to toggle source

Replaces an existing custom API

Creates or updates an existing custom API

@param subscription_id [String] Subscription Id @param resource_group_name [String] The resource group @param api_name [String] API name @param custom_api [CustomApiDefinition] The custom API @param api_version [String] API Version @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# 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) click to toggle source

Replaces an existing custom API

Creates or updates an existing custom API

@param subscription_id [String] Subscription Id @param resource_group_name [String] The resource group @param api_name [String] API name @param custom_api [CustomApiDefinition] The custom API @param api_version [String] API Version @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# 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) click to toggle source

Delete a custom API

Deletes a custom API from the resource group

@param subscription_id [String] Subscription Id @param resource_group_name [String] The resource group @param api_name [String] API name @param api_version [String] API Version @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

# 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) click to toggle source

Delete a custom API

Deletes a custom API from the resource group

@param subscription_id [String] Subscription Id @param resource_group_name [String] The resource group @param api_name [String] API name @param api_version [String] API Version @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# 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) click to toggle source

Delete a custom API

Deletes a custom API from the resource group

@param subscription_id [String] Subscription Id @param resource_group_name [String] The resource group @param api_name [String] API name @param api_version [String] API Version @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# 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) click to toggle source

Returns API definition from WSDL

Parses the specified WSDL and extracts the API definition

@param subscription_id [String] Subscription Id @param location [String] The location @param wsdl_definition [WsdlDefinition] WSDL definition @param api_version [String] API Version @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Object] operation results.

# 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) click to toggle source

Returns API definition from WSDL

Parses the specified WSDL and extracts the API definition

@param subscription_id [String] Subscription Id @param location [String] The location @param wsdl_definition [WsdlDefinition] WSDL definition @param api_version [String] API Version @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# 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) click to toggle source

Returns API definition from WSDL

Parses the specified WSDL and extracts the API definition

@param subscription_id [String] Subscription Id @param location [String] The location @param wsdl_definition [WsdlDefinition] WSDL definition @param api_version [String] API Version @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# 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) click to toggle source

Get a custom API

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

@param subscription_id [String] Subscription Id @param resource_group_name [String] The resource group @param api_name [String] API name @param api_version [String] API Version @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [CustomApiDefinition] operation results.

# 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) click to toggle source

Get a custom API

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

@param subscription_id [String] Subscription Id @param resource_group_name [String] The resource group @param api_name [String] API name @param api_version [String] API Version @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# 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) click to toggle source

Get a custom API

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

@param subscription_id [String] Subscription Id @param resource_group_name [String] The resource group @param api_name [String] API name @param api_version [String] API Version @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# 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) click to toggle source

List of custom APIs

Gets a list of all custom APIs for a subscription id

@param subscription_id [String] Subscription Id @param api_version [String] API Version @param top [Integer] The number of items to be included in the result @param skiptoken [String] Skip Token @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [CustomApiDefinitionCollection] operation results.

# 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) click to toggle source

List of custom APIs

Gets a list of all custom APIs for a subscription id

@param subscription_id [String] Subscription Id @param api_version [String] API Version @param top [Integer] The number of items to be included in the result @param skiptoken [String] Skip Token @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# 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) click to toggle source

List of custom APIs

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

@param subscription_id [String] Subscription Id @param resource_group_name [String] The resource group @param api_version [String] API Version @param top [Integer] The number of items to be included in the result @param skiptoken [String] Skip Token @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [CustomApiDefinitionCollection] operation results.

# 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) click to toggle source

List of custom APIs

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

@param subscription_id [String] Subscription Id @param resource_group_name [String] The resource group @param api_version [String] API Version @param top [Integer] The number of items to be included in the result @param skiptoken [String] Skip Token @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# 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) click to toggle source

List of custom APIs

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

@param subscription_id [String] Subscription Id @param resource_group_name [String] The resource group @param api_version [String] API Version @param top [Integer] The number of items to be included in the result @param skiptoken [String] Skip Token @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# 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) click to toggle source

List of custom APIs

Gets a list of all custom APIs for a subscription id

@param subscription_id [String] Subscription Id @param api_version [String] API Version @param top [Integer] The number of items to be included in the result @param skiptoken [String] Skip Token @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# 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) click to toggle source

Lists WSDL interfaces

This returns the list of interfaces in the WSDL

@param subscription_id [String] Subscription Id @param location [String] The location @param wsdl_definition [WsdlDefinition] WSDL definition @param api_version [String] API Version @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [WsdlServiceCollection] operation results.

# 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) click to toggle source

Lists WSDL interfaces

This returns the list of interfaces in the WSDL

@param subscription_id [String] Subscription Id @param location [String] The location @param wsdl_definition [WsdlDefinition] WSDL definition @param api_version [String] API Version @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# 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) click to toggle source

Lists WSDL interfaces

This returns the list of interfaces in the WSDL

@param subscription_id [String] Subscription Id @param location [String] The location @param wsdl_definition [WsdlDefinition] WSDL definition @param api_version [String] API Version @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# 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) click to toggle source

Moves the custom API

Moves a specific custom API

@param subscription_id [String] Subscription Id @param resource_group_name [String] The resource group @param api_name [String] API name @param custom_api_reference [CustomApiReference] The custom API reference @param api_version [String] API Version @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

# 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) click to toggle source

Moves the custom API

Moves a specific custom API

@param subscription_id [String] Subscription Id @param resource_group_name [String] The resource group @param api_name [String] API name @param custom_api_reference [CustomApiReference] The custom API reference @param api_version [String] API Version @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# 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) click to toggle source

Moves the custom API

Moves a specific custom API

@param subscription_id [String] Subscription Id @param resource_group_name [String] The resource group @param api_name [String] API name @param custom_api_reference [CustomApiReference] The custom API reference @param api_version [String] API Version @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# 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) click to toggle source

Update an existing custom API

Updates an existing custom API's tags

@param subscription_id [String] Subscription Id @param resource_group_name [String] The resource group @param api_name [String] API name @param custom_api [CustomApiDefinition] The custom API @param api_version [String] API Version @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [CustomApiDefinition] operation results.

# 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) click to toggle source

Update an existing custom API

Updates an existing custom API's tags

@param subscription_id [String] Subscription Id @param resource_group_name [String] The resource group @param api_name [String] API name @param custom_api [CustomApiDefinition] The custom API @param api_version [String] API Version @param [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] Promise object which holds the HTTP response.

# 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) click to toggle source

Update an existing custom API

Updates an existing custom API's tags

@param subscription_id [String] Subscription Id @param resource_group_name [String] The resource group @param api_name [String] API name @param custom_api [CustomApiDefinition] The custom API @param api_version [String] API Version @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [MsRestAzure::AzureOperationResponse] HTTP response information.

# 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