class Azure::Web::Mgmt::V2018_02_01::Domains

WebSite Management Client

Attributes

client[R]

@return [WebSiteManagementClient] reference to the WebSiteManagementClient

Private Class Methods

new(client) click to toggle source

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

# File lib/2018-02-01/generated/azure_mgmt_web/domains.rb, line 17
def initialize(client)
  @client = client
end

Private Instance Methods

begin_create_or_update(resource_group_name, domain_name, domain, custom_headers:nil) click to toggle source

Creates or updates a domain.

Creates or updates a domain.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of the domain. @param domain [Domain] Domain registration information. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Domain] operation results.

# File lib/2018-02-01/generated/azure_mgmt_web/domains.rb, line 1589
def begin_create_or_update(resource_group_name, domain_name, domain, custom_headers:nil)
  response = begin_create_or_update_async(resource_group_name, domain_name, domain, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
begin_create_or_update_async(resource_group_name, domain_name, domain, custom_headers:nil) click to toggle source

Creates or updates a domain.

Creates or updates a domain.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of the domain. @param domain [Domain] Domain registration information. @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/2018-02-01/generated/azure_mgmt_web/domains.rb, line 1626
def begin_create_or_update_async(resource_group_name, domain_name, domain, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'domain_name is nil' if domain_name.nil?
  fail ArgumentError, "'domain_name' should satisfy the constraint - 'Pattern': '[a-zA-Z0-9][a-zA-Z0-9\.-]+'" if !domain_name.nil? && domain_name.match(Regexp.new('^[a-zA-Z0-9][a-zA-Z0-9\.-]+$')).nil?
  fail ArgumentError, 'domain is nil' if domain.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

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

  # Serialize Request
  request_mapper = Azure::Web::Mgmt::V2018_02_01::Models::Domain.mapper()
  request_content = @client.serialize(request_mapper,  domain)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}'

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end
begin_create_or_update_with_http_info(resource_group_name, domain_name, domain, custom_headers:nil) click to toggle source

Creates or updates a domain.

Creates or updates a domain.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of the domain. @param domain [Domain] Domain registration information. @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/2018-02-01/generated/azure_mgmt_web/domains.rb, line 1608
def begin_create_or_update_with_http_info(resource_group_name, domain_name, domain, custom_headers:nil)
  begin_create_or_update_async(resource_group_name, domain_name, domain, custom_headers:custom_headers).value!
end
check_availability(identifier, custom_headers:nil) click to toggle source

Check if a domain is available for registration.

Check if a domain is available for registration.

@param identifier [NameIdentifier] Name of the domain. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [DomainAvailablilityCheckResult] operation results.

# File lib/2018-02-01/generated/azure_mgmt_web/domains.rb, line 35
def check_availability(identifier, custom_headers:nil)
  response = check_availability_async(identifier, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
check_availability_async(identifier, custom_headers:nil) click to toggle source

Check if a domain is available for registration.

Check if a domain is available for registration.

@param identifier [NameIdentifier] Name of the domain. @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/2018-02-01/generated/azure_mgmt_web/domains.rb, line 66
def check_availability_async(identifier, custom_headers:nil)
  fail ArgumentError, 'identifier is nil' if identifier.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

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

  # Serialize Request
  request_mapper = Azure::Web::Mgmt::V2018_02_01::Models::NameIdentifier.mapper()
  request_content = @client.serialize(request_mapper,  identifier)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/checkDomainAvailability'

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::DomainAvailablilityCheckResult.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
check_availability_with_http_info(identifier, custom_headers:nil) click to toggle source

Check if a domain is available for registration.

Check if a domain is available for registration.

@param identifier [NameIdentifier] Name of the domain. @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/2018-02-01/generated/azure_mgmt_web/domains.rb, line 51
def check_availability_with_http_info(identifier, custom_headers:nil)
  check_availability_async(identifier, custom_headers:custom_headers).value!
end
create_or_update(resource_group_name, domain_name, domain, custom_headers:nil) click to toggle source

Creates or updates a domain.

Creates or updates a domain.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of the domain. @param domain [Domain] Domain registration information. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Domain] operation results.

# File lib/2018-02-01/generated/azure_mgmt_web/domains.rb, line 639
def create_or_update(resource_group_name, domain_name, domain, custom_headers:nil)
  response = create_or_update_async(resource_group_name, domain_name, domain, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
create_or_update_async(resource_group_name, domain_name, domain, custom_headers:nil) click to toggle source

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of the domain. @param domain [Domain] Domain registration information. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Concurrent::Promise] promise which provides async access to http response.

# File lib/2018-02-01/generated/azure_mgmt_web/domains.rb, line 655
def create_or_update_async(resource_group_name, domain_name, domain, custom_headers:nil)
  # Send request
  promise = begin_create_or_update_async(resource_group_name, domain_name, domain, custom_headers:custom_headers)

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

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

  promise
end
create_or_update_ownership_identifier(resource_group_name, domain_name, name, domain_ownership_identifier, custom_headers:nil) click to toggle source

Creates an ownership identifier for a domain or updates identifier details for an existing identifer

Creates an ownership identifier for a domain or updates identifier details for an existing identifer

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of domain. @param name [String] Name of identifier. @param domain_ownership_identifier [DomainOwnershipIdentifier] A JSON representation of the domain ownership properties. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [DomainOwnershipIdentifier] operation results.

# File lib/2018-02-01/generated/azure_mgmt_web/domains.rb, line 1139
def create_or_update_ownership_identifier(resource_group_name, domain_name, name, domain_ownership_identifier, custom_headers:nil)
  response = create_or_update_ownership_identifier_async(resource_group_name, domain_name, name, domain_ownership_identifier, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
create_or_update_ownership_identifier_async(resource_group_name, domain_name, name, domain_ownership_identifier, custom_headers:nil) click to toggle source

Creates an ownership identifier for a domain or updates identifier details for an existing identifer

Creates an ownership identifier for a domain or updates identifier details for an existing identifer

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of domain. @param name [String] Name of identifier. @param domain_ownership_identifier [DomainOwnershipIdentifier] A JSON representation of the domain ownership properties. @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/2018-02-01/generated/azure_mgmt_web/domains.rb, line 1184
def create_or_update_ownership_identifier_async(resource_group_name, domain_name, name, domain_ownership_identifier, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'domain_name is nil' if domain_name.nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, 'domain_ownership_identifier is nil' if domain_ownership_identifier.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

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

  # Serialize Request
  request_mapper = Azure::Web::Mgmt::V2018_02_01::Models::DomainOwnershipIdentifier.mapper()
  request_content = @client.serialize(request_mapper,  domain_ownership_identifier)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}'

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::DomainOwnershipIdentifier.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_ownership_identifier_with_http_info(resource_group_name, domain_name, name, domain_ownership_identifier, custom_headers:nil) click to toggle source

Creates an ownership identifier for a domain or updates identifier details for an existing identifer

Creates an ownership identifier for a domain or updates identifier details for an existing identifer

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of domain. @param name [String] Name of identifier. @param domain_ownership_identifier [DomainOwnershipIdentifier] A JSON representation of the domain ownership properties. @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/2018-02-01/generated/azure_mgmt_web/domains.rb, line 1162
def create_or_update_ownership_identifier_with_http_info(resource_group_name, domain_name, name, domain_ownership_identifier, custom_headers:nil)
  create_or_update_ownership_identifier_async(resource_group_name, domain_name, name, domain_ownership_identifier, custom_headers:custom_headers).value!
end
delete(resource_group_name, domain_name, force_hard_delete_domain:nil, custom_headers:nil) click to toggle source

Delete a domain.

Delete a domain.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of the domain. @param force_hard_delete_domain [Boolean] Specify true to delete the domain immediately. The default is false which deletes the domain after 24 hours. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

# File lib/2018-02-01/generated/azure_mgmt_web/domains.rb, line 688
def delete(resource_group_name, domain_name, force_hard_delete_domain:nil, custom_headers:nil)
  response = delete_async(resource_group_name, domain_name, force_hard_delete_domain:force_hard_delete_domain, custom_headers:custom_headers).value!
  nil
end
delete_async(resource_group_name, domain_name, force_hard_delete_domain:nil, custom_headers:nil) click to toggle source

Delete a domain.

Delete a domain.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of the domain. @param force_hard_delete_domain [Boolean] Specify true to delete the domain immediately. The default is false which deletes the domain after 24 hours. @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/2018-02-01/generated/azure_mgmt_web/domains.rb, line 729
def delete_async(resource_group_name, domain_name, force_hard_delete_domain:nil, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'domain_name is nil' if domain_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

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

  request_url = @base_url || @client.base_url

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

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200 || status_code == 204
      error_model = JSON.load(response_content)
      fail 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_ownership_identifier(resource_group_name, domain_name, name, custom_headers:nil) click to toggle source

Delete ownership identifier for domain

Delete ownership identifier for domain

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of domain. @param name [String] Name of identifier. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

# File lib/2018-02-01/generated/azure_mgmt_web/domains.rb, line 1264
def delete_ownership_identifier(resource_group_name, domain_name, name, custom_headers:nil)
  response = delete_ownership_identifier_async(resource_group_name, domain_name, name, custom_headers:custom_headers).value!
  nil
end
delete_ownership_identifier_async(resource_group_name, domain_name, name, custom_headers:nil) click to toggle source

Delete ownership identifier for domain

Delete ownership identifier for domain

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of domain. @param name [String] Name of identifier. @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/2018-02-01/generated/azure_mgmt_web/domains.rb, line 1301
def delete_ownership_identifier_async(resource_group_name, domain_name, name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'domain_name is nil' if domain_name.nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

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

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'domainName' => domain_name,'name' => name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(: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_ownership_identifier_with_http_info(resource_group_name, domain_name, name, custom_headers:nil) click to toggle source

Delete ownership identifier for domain

Delete ownership identifier for domain

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of domain. @param name [String] Name of identifier. @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/2018-02-01/generated/azure_mgmt_web/domains.rb, line 1283
def delete_ownership_identifier_with_http_info(resource_group_name, domain_name, name, custom_headers:nil)
  delete_ownership_identifier_async(resource_group_name, domain_name, name, custom_headers:custom_headers).value!
end
delete_with_http_info(resource_group_name, domain_name, force_hard_delete_domain:nil, custom_headers:nil) click to toggle source

Delete a domain.

Delete a domain.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of the domain. @param force_hard_delete_domain [Boolean] Specify true to delete the domain immediately. The default is false which deletes the domain after 24 hours. @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/2018-02-01/generated/azure_mgmt_web/domains.rb, line 709
def delete_with_http_info(resource_group_name, domain_name, force_hard_delete_domain:nil, custom_headers:nil)
  delete_async(resource_group_name, domain_name, force_hard_delete_domain:force_hard_delete_domain, custom_headers:custom_headers).value!
end
get(resource_group_name, domain_name, custom_headers:nil) click to toggle source

Get a domain.

Get a domain.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of the domain. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Domain] operation results.

# File lib/2018-02-01/generated/azure_mgmt_web/domains.rb, line 532
def get(resource_group_name, domain_name, custom_headers:nil)
  response = get_async(resource_group_name, domain_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
get_async(resource_group_name, domain_name, custom_headers:nil) click to toggle source

Get a domain.

Get a domain.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of the domain. @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/2018-02-01/generated/azure_mgmt_web/domains.rb, line 567
def get_async(resource_group_name, domain_name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'domain_name is nil' if domain_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

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

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::Domain.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_control_center_sso_request(custom_headers:nil) click to toggle source

Generate a single sign-on request for the domain management portal.

Generate a single sign-on request for the domain management portal.

@param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [DomainControlCenterSsoRequest] operation results.

# File lib/2018-02-01/generated/azure_mgmt_web/domains.rb, line 229
def get_control_center_sso_request(custom_headers:nil)
  response = get_control_center_sso_request_async(custom_headers:custom_headers).value!
  response.body unless response.nil?
end
get_control_center_sso_request_async(custom_headers:nil) click to toggle source

Generate a single sign-on request for the domain management portal.

Generate a single sign-on request for the domain management portal.

@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/2018-02-01/generated/azure_mgmt_web/domains.rb, line 258
def get_control_center_sso_request_async(custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

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

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::DomainControlCenterSsoRequest.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_control_center_sso_request_with_http_info(custom_headers:nil) click to toggle source

Generate a single sign-on request for the domain management portal.

Generate a single sign-on request for the domain management portal.

@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/2018-02-01/generated/azure_mgmt_web/domains.rb, line 244
def get_control_center_sso_request_with_http_info(custom_headers:nil)
  get_control_center_sso_request_async(custom_headers:custom_headers).value!
end
get_ownership_identifier(resource_group_name, domain_name, name, custom_headers:nil) click to toggle source

Get ownership identifier for domain

Get ownership identifier for domain

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of domain. @param name [String] Name of identifier. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [DomainOwnershipIdentifier] operation results.

# File lib/2018-02-01/generated/azure_mgmt_web/domains.rb, line 1025
def get_ownership_identifier(resource_group_name, domain_name, name, custom_headers:nil)
  response = get_ownership_identifier_async(resource_group_name, domain_name, name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
get_ownership_identifier_async(resource_group_name, domain_name, name, custom_headers:nil) click to toggle source

Get ownership identifier for domain

Get ownership identifier for domain

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of domain. @param name [String] Name of identifier. @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/2018-02-01/generated/azure_mgmt_web/domains.rb, line 1062
def get_ownership_identifier_async(resource_group_name, domain_name, name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'domain_name is nil' if domain_name.nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

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

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::DomainOwnershipIdentifier.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_ownership_identifier_with_http_info(resource_group_name, domain_name, name, custom_headers:nil) click to toggle source

Get ownership identifier for domain

Get ownership identifier for domain

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of domain. @param name [String] Name of identifier. @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/2018-02-01/generated/azure_mgmt_web/domains.rb, line 1044
def get_ownership_identifier_with_http_info(resource_group_name, domain_name, name, custom_headers:nil)
  get_ownership_identifier_async(resource_group_name, domain_name, name, custom_headers:custom_headers).value!
end
get_with_http_info(resource_group_name, domain_name, custom_headers:nil) click to toggle source

Get a domain.

Get a domain.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of the domain. @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/2018-02-01/generated/azure_mgmt_web/domains.rb, line 550
def get_with_http_info(resource_group_name, domain_name, custom_headers:nil)
  get_async(resource_group_name, domain_name, custom_headers:custom_headers).value!
end
list(custom_headers:nil) click to toggle source

Get all domains in a subscription.

Get all domains in a subscription.

@param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array<Domain>] operation results.

# File lib/2018-02-01/generated/azure_mgmt_web/domains.rb, line 137
def list(custom_headers:nil)
  first_page = list_as_lazy(custom_headers:custom_headers)
  first_page.get_all_items
end
list_as_lazy(custom_headers:nil) click to toggle source

Get all domains in a subscription.

Get all domains in a subscription.

@param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [DomainCollection] which provide lazy access to pages of the response.

# File lib/2018-02-01/generated/azure_mgmt_web/domains.rb, line 2098
def list_as_lazy(custom_headers:nil)
  response = list_async(custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end
list_async(custom_headers:nil) click to toggle source

Get all domains in a subscription.

Get all domains in a subscription.

@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/2018-02-01/generated/azure_mgmt_web/domains.rb, line 166
def list_async(custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

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

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::DomainCollection.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(resource_group_name, custom_headers:nil) click to toggle source

Get all domains in a resource group.

Get all domains in a resource group.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array<Domain>] operation results.

# File lib/2018-02-01/generated/azure_mgmt_web/domains.rb, line 429
def list_by_resource_group(resource_group_name, custom_headers:nil)
  first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers:custom_headers)
  first_page.get_all_items
end
list_by_resource_group_as_lazy(resource_group_name, custom_headers:nil) click to toggle source

Get all domains in a resource group.

Get all domains in a resource group.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [DomainCollection] which provide lazy access to pages of the response.

# File lib/2018-02-01/generated/azure_mgmt_web/domains.rb, line 2146
def list_by_resource_group_as_lazy(resource_group_name, custom_headers:nil)
  response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end
list_by_resource_group_async(resource_group_name, custom_headers:nil) click to toggle source

Get all domains in a resource group.

Get all domains in a resource group.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @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/2018-02-01/generated/azure_mgmt_web/domains.rb, line 462
def list_by_resource_group_async(resource_group_name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end
list_by_resource_group_next(next_page_link, custom_headers:nil) click to toggle source

Get all domains in a resource group.

Get all domains in a resource group.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [DomainCollection] operation results.

# File lib/2018-02-01/generated/azure_mgmt_web/domains.rb, line 1907
def list_by_resource_group_next(next_page_link, custom_headers:nil)
  response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_by_resource_group_next_async(next_page_link, custom_headers:nil) click to toggle source

Get all domains in a resource group.

Get all domains in a resource group.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @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/2018-02-01/generated/azure_mgmt_web/domains.rb, line 1940
def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


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

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

  request_url = @base_url || @client.base_url

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

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

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

    result
  end

  promise.execute
end
list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil) click to toggle source

Get all domains in a resource group.

Get all domains in a resource group.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @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/2018-02-01/generated/azure_mgmt_web/domains.rb, line 1924
def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
  list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
end
list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil) click to toggle source

Get all domains in a resource group.

Get all domains in a resource group.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @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/2018-02-01/generated/azure_mgmt_web/domains.rb, line 446
def list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil)
  list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
end
list_next(next_page_link, custom_headers:nil) click to toggle source

Get all domains in a subscription.

Get all domains in a subscription.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [DomainCollection] operation results.

# File lib/2018-02-01/generated/azure_mgmt_web/domains.rb, line 1715
def list_next(next_page_link, custom_headers:nil)
  response = list_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_next_async(next_page_link, custom_headers:nil) click to toggle source

Get all domains in a subscription.

Get all domains in a subscription.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @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/2018-02-01/generated/azure_mgmt_web/domains.rb, line 1748
def list_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


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

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

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::DomainCollection.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_next_with_http_info(next_page_link, custom_headers:nil) click to toggle source

Get all domains in a subscription.

Get all domains in a subscription.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @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/2018-02-01/generated/azure_mgmt_web/domains.rb, line 1732
def list_next_with_http_info(next_page_link, custom_headers:nil)
  list_next_async(next_page_link, custom_headers:custom_headers).value!
end
list_ownership_identifiers(resource_group_name, domain_name, custom_headers:nil) click to toggle source

Lists domain ownership identifiers.

Lists domain ownership identifiers.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of domain. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array<DomainOwnershipIdentifier>] operation results.

# File lib/2018-02-01/generated/azure_mgmt_web/domains.rb, line 918
def list_ownership_identifiers(resource_group_name, domain_name, custom_headers:nil)
  first_page = list_ownership_identifiers_as_lazy(resource_group_name, domain_name, custom_headers:custom_headers)
  first_page.get_all_items
end
list_ownership_identifiers_as_lazy(resource_group_name, domain_name, custom_headers:nil) click to toggle source

Lists domain ownership identifiers.

Lists domain ownership identifiers.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of domain. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [DomainOwnershipIdentifierCollection] which provide lazy access to pages of the response.

# File lib/2018-02-01/generated/azure_mgmt_web/domains.rb, line 2171
def list_ownership_identifiers_as_lazy(resource_group_name, domain_name, custom_headers:nil)
  response = list_ownership_identifiers_async(resource_group_name, domain_name, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_ownership_identifiers_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end
list_ownership_identifiers_async(resource_group_name, domain_name, custom_headers:nil) click to toggle source

Lists domain ownership identifiers.

Lists domain ownership identifiers.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of domain. @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/2018-02-01/generated/azure_mgmt_web/domains.rb, line 953
def list_ownership_identifiers_async(resource_group_name, domain_name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'domain_name is nil' if domain_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

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

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::DomainOwnershipIdentifierCollection.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_ownership_identifiers_next(next_page_link, custom_headers:nil) click to toggle source

Lists domain ownership identifiers.

Lists domain ownership identifiers.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [DomainOwnershipIdentifierCollection] operation results.

# File lib/2018-02-01/generated/azure_mgmt_web/domains.rb, line 2003
def list_ownership_identifiers_next(next_page_link, custom_headers:nil)
  response = list_ownership_identifiers_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_ownership_identifiers_next_async(next_page_link, custom_headers:nil) click to toggle source

Lists domain ownership identifiers.

Lists domain ownership identifiers.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @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/2018-02-01/generated/azure_mgmt_web/domains.rb, line 2036
def list_ownership_identifiers_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


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

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

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::DomainOwnershipIdentifierCollection.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_ownership_identifiers_next_with_http_info(next_page_link, custom_headers:nil) click to toggle source

Lists domain ownership identifiers.

Lists domain ownership identifiers.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @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/2018-02-01/generated/azure_mgmt_web/domains.rb, line 2020
def list_ownership_identifiers_next_with_http_info(next_page_link, custom_headers:nil)
  list_ownership_identifiers_next_async(next_page_link, custom_headers:custom_headers).value!
end
list_ownership_identifiers_with_http_info(resource_group_name, domain_name, custom_headers:nil) click to toggle source

Lists domain ownership identifiers.

Lists domain ownership identifiers.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of domain. @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/2018-02-01/generated/azure_mgmt_web/domains.rb, line 936
def list_ownership_identifiers_with_http_info(resource_group_name, domain_name, custom_headers:nil)
  list_ownership_identifiers_async(resource_group_name, domain_name, custom_headers:custom_headers).value!
end
list_recommendations(parameters, custom_headers:nil) click to toggle source

Get domain name recommendations based on keywords.

Get domain name recommendations based on keywords.

@param parameters [DomainRecommendationSearchParameters] Search parameters for domain name recommendations. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array<NameIdentifier>] operation results.

# File lib/2018-02-01/generated/azure_mgmt_web/domains.rb, line 323
def list_recommendations(parameters, custom_headers:nil)
  first_page = list_recommendations_as_lazy(parameters, custom_headers:custom_headers)
  first_page.get_all_items
end
list_recommendations_as_lazy(parameters, custom_headers:nil) click to toggle source

Get domain name recommendations based on keywords.

Get domain name recommendations based on keywords.

@param parameters [DomainRecommendationSearchParameters] Search parameters for domain name recommendations. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [NameIdentifierCollection] which provide lazy access to pages of the response.

# File lib/2018-02-01/generated/azure_mgmt_web/domains.rb, line 2122
def list_recommendations_as_lazy(parameters, custom_headers:nil)
  response = list_recommendations_async(parameters, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_recommendations_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end
list_recommendations_async(parameters, custom_headers:nil) click to toggle source

Get domain name recommendations based on keywords.

Get domain name recommendations based on keywords.

@param parameters [DomainRecommendationSearchParameters] Search parameters for domain name recommendations. @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/2018-02-01/generated/azure_mgmt_web/domains.rb, line 356
def list_recommendations_async(parameters, custom_headers:nil)
  fail ArgumentError, 'parameters is nil' if parameters.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

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

  # Serialize Request
  request_mapper = Azure::Web::Mgmt::V2018_02_01::Models::DomainRecommendationSearchParameters.mapper()
  request_content = @client.serialize(request_mapper,  parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/listDomainRecommendations'

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::NameIdentifierCollection.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_recommendations_next(next_page_link, custom_headers:nil) click to toggle source

Get domain name recommendations based on keywords.

Get domain name recommendations based on keywords.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [NameIdentifierCollection] operation results.

# File lib/2018-02-01/generated/azure_mgmt_web/domains.rb, line 1811
def list_recommendations_next(next_page_link, custom_headers:nil)
  response = list_recommendations_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_recommendations_next_async(next_page_link, custom_headers:nil) click to toggle source

Get domain name recommendations based on keywords.

Get domain name recommendations based on keywords.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @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/2018-02-01/generated/azure_mgmt_web/domains.rb, line 1844
def list_recommendations_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


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

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

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::NameIdentifierCollection.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_recommendations_next_with_http_info(next_page_link, custom_headers:nil) click to toggle source

Get domain name recommendations based on keywords.

Get domain name recommendations based on keywords.

@param next_page_link [String] The NextLink from the previous successful call to List operation. @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/2018-02-01/generated/azure_mgmt_web/domains.rb, line 1828
def list_recommendations_next_with_http_info(next_page_link, custom_headers:nil)
  list_recommendations_next_async(next_page_link, custom_headers:custom_headers).value!
end
list_recommendations_with_http_info(parameters, custom_headers:nil) click to toggle source

Get domain name recommendations based on keywords.

Get domain name recommendations based on keywords.

@param parameters [DomainRecommendationSearchParameters] Search parameters for domain name recommendations. @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/2018-02-01/generated/azure_mgmt_web/domains.rb, line 340
def list_recommendations_with_http_info(parameters, custom_headers:nil)
  list_recommendations_async(parameters, custom_headers:custom_headers).value!
end
list_with_http_info(custom_headers:nil) click to toggle source

Get all domains in a subscription.

Get all domains in a subscription.

@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/2018-02-01/generated/azure_mgmt_web/domains.rb, line 152
def list_with_http_info(custom_headers:nil)
  list_async(custom_headers:custom_headers).value!
end
renew(resource_group_name, domain_name, custom_headers:nil) click to toggle source

Renew a domain.

Renew a domain.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of the domain. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

# File lib/2018-02-01/generated/azure_mgmt_web/domains.rb, line 1492
def renew(resource_group_name, domain_name, custom_headers:nil)
  response = renew_async(resource_group_name, domain_name, custom_headers:custom_headers).value!
  nil
end
renew_async(resource_group_name, domain_name, custom_headers:nil) click to toggle source

Renew a domain.

Renew a domain.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of the domain. @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/2018-02-01/generated/azure_mgmt_web/domains.rb, line 1527
def renew_async(resource_group_name, domain_name, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'domain_name is nil' if domain_name.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

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

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'domainName' => domain_name,'subscriptionId' => @client.subscription_id},
      query_params: {'api-version' => @client.api_version},
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(: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 || status_code == 202 || status_code == 204 || status_code == 400 || status_code == 500
      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
renew_with_http_info(resource_group_name, domain_name, custom_headers:nil) click to toggle source

Renew a domain.

Renew a domain.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of the domain. @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/2018-02-01/generated/azure_mgmt_web/domains.rb, line 1510
def renew_with_http_info(resource_group_name, domain_name, custom_headers:nil)
  renew_async(resource_group_name, domain_name, custom_headers:custom_headers).value!
end
update(resource_group_name, domain_name, domain, custom_headers:nil) click to toggle source

Creates or updates a domain.

Creates or updates a domain.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of the domain. @param domain [DomainPatchResource] Domain registration information. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Domain] operation results.

# File lib/2018-02-01/generated/azure_mgmt_web/domains.rb, line 791
def update(resource_group_name, domain_name, domain, custom_headers:nil)
  response = update_async(resource_group_name, domain_name, domain, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
update_async(resource_group_name, domain_name, domain, custom_headers:nil) click to toggle source

Creates or updates a domain.

Creates or updates a domain.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of the domain. @param domain [DomainPatchResource] Domain registration information. @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/2018-02-01/generated/azure_mgmt_web/domains.rb, line 828
def update_async(resource_group_name, domain_name, domain, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'domain_name is nil' if domain_name.nil?
  fail ArgumentError, "'domain_name' should satisfy the constraint - 'Pattern': '[a-zA-Z0-9][a-zA-Z0-9\.-]+'" if !domain_name.nil? && domain_name.match(Regexp.new('^[a-zA-Z0-9][a-zA-Z0-9\.-]+$')).nil?
  fail ArgumentError, 'domain is nil' if domain.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

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

  # Serialize Request
  request_mapper = Azure::Web::Mgmt::V2018_02_01::Models::DomainPatchResource.mapper()
  request_content = @client.serialize(request_mapper,  domain)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}'

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 202
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::Domain.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::Domain.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_ownership_identifier(resource_group_name, domain_name, name, domain_ownership_identifier, custom_headers:nil) click to toggle source

Creates an ownership identifier for a domain or updates identifier details for an existing identifer

Creates an ownership identifier for a domain or updates identifier details for an existing identifer

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of domain. @param name [String] Name of identifier. @param domain_ownership_identifier [DomainOwnershipIdentifier] A JSON representation of the domain ownership properties. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [DomainOwnershipIdentifier] operation results.

# File lib/2018-02-01/generated/azure_mgmt_web/domains.rb, line 1368
def update_ownership_identifier(resource_group_name, domain_name, name, domain_ownership_identifier, custom_headers:nil)
  response = update_ownership_identifier_async(resource_group_name, domain_name, name, domain_ownership_identifier, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
update_ownership_identifier_async(resource_group_name, domain_name, name, domain_ownership_identifier, custom_headers:nil) click to toggle source

Creates an ownership identifier for a domain or updates identifier details for an existing identifer

Creates an ownership identifier for a domain or updates identifier details for an existing identifer

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of domain. @param name [String] Name of identifier. @param domain_ownership_identifier [DomainOwnershipIdentifier] A JSON representation of the domain ownership properties. @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/2018-02-01/generated/azure_mgmt_web/domains.rb, line 1413
def update_ownership_identifier_async(resource_group_name, domain_name, name, domain_ownership_identifier, custom_headers:nil)
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
  fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
  fail ArgumentError, 'domain_name is nil' if domain_name.nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, 'domain_ownership_identifier is nil' if domain_ownership_identifier.nil?
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?


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

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

  # Serialize Request
  request_mapper = Azure::Web::Mgmt::V2018_02_01::Models::DomainOwnershipIdentifier.mapper()
  request_content = @client.serialize(request_mapper,  domain_ownership_identifier)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}'

  request_url = @base_url || @client.base_url

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

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

    result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
    result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
    result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
    # Deserialize Response
    if status_code == 200
      begin
        parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
        result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::DomainOwnershipIdentifier.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_ownership_identifier_with_http_info(resource_group_name, domain_name, name, domain_ownership_identifier, custom_headers:nil) click to toggle source

Creates an ownership identifier for a domain or updates identifier details for an existing identifer

Creates an ownership identifier for a domain or updates identifier details for an existing identifer

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of domain. @param name [String] Name of identifier. @param domain_ownership_identifier [DomainOwnershipIdentifier] A JSON representation of the domain ownership properties. @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/2018-02-01/generated/azure_mgmt_web/domains.rb, line 1391
def update_ownership_identifier_with_http_info(resource_group_name, domain_name, name, domain_ownership_identifier, custom_headers:nil)
  update_ownership_identifier_async(resource_group_name, domain_name, name, domain_ownership_identifier, custom_headers:custom_headers).value!
end
update_with_http_info(resource_group_name, domain_name, domain, custom_headers:nil) click to toggle source

Creates or updates a domain.

Creates or updates a domain.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param domain_name [String] Name of the domain. @param domain [DomainPatchResource] Domain registration information. @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/2018-02-01/generated/azure_mgmt_web/domains.rb, line 810
def update_with_http_info(resource_group_name, domain_name, domain, custom_headers:nil)
  update_async(resource_group_name, domain_name, domain, custom_headers:custom_headers).value!
end