class Azure::Web::Mgmt::V2020_09_01::AppServiceCertificateOrders

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 AppServiceCertificateOrders class. @param client service class for accessing basic functionality.

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 17
def initialize(client)
  @client = client
end

Private Instance Methods

begin_create_or_update(resource_group_name, certificate_order_name, certificate_distinguished_name, custom_headers:nil) click to toggle source

Create or update a certificate purchase order.

Description for Create or update a certificate purchase order.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param certificate_order_name [String] Name of the certificate order. @param certificate_distinguished_name [AppServiceCertificateOrder] Distinguished name to use for the certificate order. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [AppServiceCertificateOrder] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 2092
def begin_create_or_update(resource_group_name, certificate_order_name, certificate_distinguished_name, custom_headers:nil)
  response = begin_create_or_update_async(resource_group_name, certificate_order_name, certificate_distinguished_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
begin_create_or_update_async(resource_group_name, certificate_order_name, certificate_distinguished_name, custom_headers:nil) click to toggle source

Create or update a certificate purchase order.

Description for Create or update a certificate purchase order.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param certificate_order_name [String] Name of the certificate order. @param certificate_distinguished_name [AppServiceCertificateOrder] Distinguished name to use for the certificate order. @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/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 2131
def begin_create_or_update_async(resource_group_name, certificate_order_name, certificate_distinguished_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, 'certificate_order_name is nil' if certificate_order_name.nil?
  fail ArgumentError, 'certificate_distinguished_name is nil' if certificate_distinguished_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?

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

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'certificateOrderName' => certificate_order_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 || status_code == 201
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

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

Creates or updates a certificate and associates with key vault secret.

Description for Creates or updates a certificate and associates with key vault secret.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param certificate_order_name [String] Name of the certificate order. @param name [String] Name of the certificate. @param key_vault_certificate [AppServiceCertificateResource] Key vault certificate resource Id. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [AppServiceCertificateResource] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 2224
def begin_create_or_update_certificate(resource_group_name, certificate_order_name, name, key_vault_certificate, custom_headers:nil)
  response = begin_create_or_update_certificate_async(resource_group_name, certificate_order_name, name, key_vault_certificate, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
begin_create_or_update_certificate_async(resource_group_name, certificate_order_name, name, key_vault_certificate, custom_headers:nil) click to toggle source

Creates or updates a certificate and associates with key vault secret.

Description for Creates or updates a certificate and associates with key vault secret.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param certificate_order_name [String] Name of the certificate order. @param name [String] Name of the certificate. @param key_vault_certificate [AppServiceCertificateResource] Key vault certificate resource Id. @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/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 2267
def begin_create_or_update_certificate_async(resource_group_name, certificate_order_name, name, key_vault_certificate, 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, 'certificate_order_name is nil' if certificate_order_name.nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, 'key_vault_certificate is nil' if key_vault_certificate.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::V2020_09_01::Models::AppServiceCertificateResource.mapper()
  request_content = @client.serialize(request_mapper,  key_vault_certificate)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{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,'certificateOrderName' => certificate_order_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 || status_code == 201
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

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

Creates or updates a certificate and associates with key vault secret.

Description for Creates or updates a certificate and associates with key vault secret.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param certificate_order_name [String] Name of the certificate order. @param name [String] Name of the certificate. @param key_vault_certificate [AppServiceCertificateResource] Key vault certificate resource Id. @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/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 2246
def begin_create_or_update_certificate_with_http_info(resource_group_name, certificate_order_name, name, key_vault_certificate, custom_headers:nil)
  begin_create_or_update_certificate_async(resource_group_name, certificate_order_name, name, key_vault_certificate, custom_headers:custom_headers).value!
end
begin_create_or_update_with_http_info(resource_group_name, certificate_order_name, certificate_distinguished_name, custom_headers:nil) click to toggle source

Create or update a certificate purchase order.

Description for Create or update a certificate purchase order.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param certificate_order_name [String] Name of the certificate order. @param certificate_distinguished_name [AppServiceCertificateOrder] Distinguished name to use for the certificate order. @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/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 2112
def begin_create_or_update_with_http_info(resource_group_name, certificate_order_name, certificate_distinguished_name, custom_headers:nil)
  begin_create_or_update_async(resource_group_name, certificate_order_name, certificate_distinguished_name, custom_headers:custom_headers).value!
end
create_or_update(resource_group_name, certificate_order_name, certificate_distinguished_name, custom_headers:nil) click to toggle source

Create or update a certificate purchase order.

Description for Create or update a certificate purchase order.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param certificate_order_name [String] Name of the certificate order. @param certificate_distinguished_name [AppServiceCertificateOrder] Distinguished name to use for the certificate order. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [AppServiceCertificateOrder] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 434
def create_or_update(resource_group_name, certificate_order_name, certificate_distinguished_name, custom_headers:nil)
  response = create_or_update_async(resource_group_name, certificate_order_name, certificate_distinguished_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
create_or_update_async(resource_group_name, certificate_order_name, certificate_distinguished_name, custom_headers:nil) click to toggle source

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param certificate_order_name [String] Name of the certificate order. @param certificate_distinguished_name [AppServiceCertificateOrder] Distinguished name to use for the certificate order. @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/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 451
def create_or_update_async(resource_group_name, certificate_order_name, certificate_distinguished_name, custom_headers:nil)
  # Send request
  promise = begin_create_or_update_async(resource_group_name, certificate_order_name, certificate_distinguished_name, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Web::Mgmt::V2020_09_01::Models::AppServiceCertificateOrder.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_certificate(resource_group_name, certificate_order_name, name, key_vault_certificate, custom_headers:nil) click to toggle source

Creates or updates a certificate and associates with key vault secret.

Description for Creates or updates a certificate and associates with key vault secret.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param certificate_order_name [String] Name of the certificate order. @param name [String] Name of the certificate. @param key_vault_certificate [AppServiceCertificateResource] Key vault certificate resource Id. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [AppServiceCertificateResource] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 930
def create_or_update_certificate(resource_group_name, certificate_order_name, name, key_vault_certificate, custom_headers:nil)
  response = create_or_update_certificate_async(resource_group_name, certificate_order_name, name, key_vault_certificate, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
create_or_update_certificate_async(resource_group_name, certificate_order_name, name, key_vault_certificate, custom_headers:nil) click to toggle source

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param certificate_order_name [String] Name of the certificate order. @param name [String] Name of the certificate. @param key_vault_certificate [AppServiceCertificateResource] Key vault certificate resource Id. @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/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 948
def create_or_update_certificate_async(resource_group_name, certificate_order_name, name, key_vault_certificate, custom_headers:nil)
  # Send request
  promise = begin_create_or_update_certificate_async(resource_group_name, certificate_order_name, name, key_vault_certificate, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Web::Mgmt::V2020_09_01::Models::AppServiceCertificateResource.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
delete(resource_group_name, certificate_order_name, custom_headers:nil) click to toggle source

Delete an existing certificate order.

Description for Delete an existing certificate order.

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

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 481
def delete(resource_group_name, certificate_order_name, custom_headers:nil)
  response = delete_async(resource_group_name, certificate_order_name, custom_headers:custom_headers).value!
  nil
end
delete_async(resource_group_name, certificate_order_name, custom_headers:nil) click to toggle source

Delete an existing certificate order.

Description for Delete an existing certificate order.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param certificate_order_name [String] Name of the certificate order. @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/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 516
def delete_async(resource_group_name, certificate_order_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, 'certificate_order_name is nil' if certificate_order_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.CertificateRegistration/certificateOrders/{certificateOrderName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'certificateOrderName' => certificate_order_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 MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

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

    result
  end

  promise.execute
end
delete_certificate(resource_group_name, certificate_order_name, name, custom_headers:nil) click to toggle source

Delete the certificate associated with a certificate order.

Description for Delete the certificate associated with a certificate order.

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

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 979
def delete_certificate(resource_group_name, certificate_order_name, name, custom_headers:nil)
  response = delete_certificate_async(resource_group_name, certificate_order_name, name, custom_headers:custom_headers).value!
  nil
end
delete_certificate_async(resource_group_name, certificate_order_name, name, custom_headers:nil) click to toggle source

Delete the certificate associated with a certificate order.

Description for Delete the certificate associated with a certificate order.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param certificate_order_name [String] Name of the certificate order. @param name [String] Name of the certificate. @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/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 1016
def delete_certificate_async(resource_group_name, certificate_order_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, 'certificate_order_name is nil' if certificate_order_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.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{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,'certificateOrderName' => certificate_order_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 MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

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

    result
  end

  promise.execute
end
delete_certificate_with_http_info(resource_group_name, certificate_order_name, name, custom_headers:nil) click to toggle source

Delete the certificate associated with a certificate order.

Description for Delete the certificate associated with a certificate order.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param certificate_order_name [String] Name of the certificate order. @param name [String] Name of the certificate. @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/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 998
def delete_certificate_with_http_info(resource_group_name, certificate_order_name, name, custom_headers:nil)
  delete_certificate_async(resource_group_name, certificate_order_name, name, custom_headers:custom_headers).value!
end
delete_with_http_info(resource_group_name, certificate_order_name, custom_headers:nil) click to toggle source

Delete an existing certificate order.

Description for Delete an existing certificate order.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param certificate_order_name [String] Name of the certificate order. @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/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 499
def delete_with_http_info(resource_group_name, certificate_order_name, custom_headers:nil)
  delete_async(resource_group_name, certificate_order_name, custom_headers:custom_headers).value!
end
get(resource_group_name, certificate_order_name, custom_headers:nil) click to toggle source

Get a certificate order.

Description for Get a certificate order.

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

@return [AppServiceCertificateOrder] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 326
def get(resource_group_name, certificate_order_name, custom_headers:nil)
  response = get_async(resource_group_name, certificate_order_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
get_async(resource_group_name, certificate_order_name, custom_headers:nil) click to toggle source

Get a certificate order.

Description for Get a certificate order.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param certificate_order_name [String] Name of the certificate order.. @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/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 361
def get_async(resource_group_name, certificate_order_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, 'certificate_order_name is nil' if certificate_order_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.CertificateRegistration/certificateOrders/{certificateOrderName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'certificateOrderName' => certificate_order_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::V2020_09_01::Models::AppServiceCertificateOrder.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_certificate(resource_group_name, certificate_order_name, name, custom_headers:nil) click to toggle source

Get the certificate associated with a certificate order.

Description for Get the certificate associated with a certificate order.

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

@return [AppServiceCertificateResource] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 817
def get_certificate(resource_group_name, certificate_order_name, name, custom_headers:nil)
  response = get_certificate_async(resource_group_name, certificate_order_name, name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
get_certificate_async(resource_group_name, certificate_order_name, name, custom_headers:nil) click to toggle source

Get the certificate associated with a certificate order.

Description for Get the certificate associated with a certificate order.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param certificate_order_name [String] Name of the certificate order. @param name [String] Name of the certificate. @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/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 854
def get_certificate_async(resource_group_name, certificate_order_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, 'certificate_order_name is nil' if certificate_order_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.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{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,'certificateOrderName' => certificate_order_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::V2020_09_01::Models::AppServiceCertificateResource.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_certificate_with_http_info(resource_group_name, certificate_order_name, name, custom_headers:nil) click to toggle source

Get the certificate associated with a certificate order.

Description for Get the certificate associated with a certificate order.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param certificate_order_name [String] Name of the certificate order. @param name [String] Name of the certificate. @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/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 836
def get_certificate_with_http_info(resource_group_name, certificate_order_name, name, custom_headers:nil)
  get_certificate_async(resource_group_name, certificate_order_name, name, custom_headers:custom_headers).value!
end
get_with_http_info(resource_group_name, certificate_order_name, custom_headers:nil) click to toggle source

Get a certificate order.

Description for Get a certificate order.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param certificate_order_name [String] Name of the certificate order.. @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/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 344
def get_with_http_info(resource_group_name, certificate_order_name, custom_headers:nil)
  get_async(resource_group_name, certificate_order_name, custom_headers:custom_headers).value!
end
list(custom_headers:nil) click to toggle source

List all certificate orders in a subscription.

Description for List all certificate orders in a subscription.

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

@return [Array<AppServiceCertificateOrder>] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 34
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

List all certificate orders in a subscription.

Description for List all certificate orders in a subscription.

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

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

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 2643
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

List all certificate orders in a subscription.

Description for List all certificate orders 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/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 63
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.CertificateRegistration/certificateOrders'

  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::V2020_09_01::Models::AppServiceCertificateOrderCollection.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 certificate orders in a resource group.

Description for Get certificate orders 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<AppServiceCertificateOrder>] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 223
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 certificate orders in a resource group.

Description for Get certificate orders 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 [AppServiceCertificateOrderCollection] which provide lazy access to pages of the response.

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 2667
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 certificate orders in a resource group.

Description for Get certificate orders 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/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 256
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.CertificateRegistration/certificateOrders'

  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::V2020_09_01::Models::AppServiceCertificateOrderCollection.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 certificate orders in a resource group.

Description for Get certificate orders 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 [AppServiceCertificateOrderCollection] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 2452
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 certificate orders in a resource group.

Description for Get certificate orders 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/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 2485
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::V2020_09_01::Models::AppServiceCertificateOrderCollection.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 certificate orders in a resource group.

Description for Get certificate orders 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/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 2469
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 certificate orders in a resource group.

Description for Get certificate orders 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/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 240
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_certificates(resource_group_name, certificate_order_name, custom_headers:nil) click to toggle source

List all certificates associated with a certificate order.

Description for List all certificates associated with a certificate order.

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

@return [Array<AppServiceCertificateResource>] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 710
def list_certificates(resource_group_name, certificate_order_name, custom_headers:nil)
  first_page = list_certificates_as_lazy(resource_group_name, certificate_order_name, custom_headers:custom_headers)
  first_page.get_all_items
end
list_certificates_as_lazy(resource_group_name, certificate_order_name, custom_headers:nil) click to toggle source

List all certificates associated with a certificate order.

Description for List all certificates associated with a certificate order.

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

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

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 2692
def list_certificates_as_lazy(resource_group_name, certificate_order_name, custom_headers:nil)
  response = list_certificates_async(resource_group_name, certificate_order_name, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_certificates_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end
list_certificates_async(resource_group_name, certificate_order_name, custom_headers:nil) click to toggle source

List all certificates associated with a certificate order.

Description for List all certificates associated with a certificate order.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param certificate_order_name [String] Name of the certificate order. @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/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 745
def list_certificates_async(resource_group_name, certificate_order_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, 'certificate_order_name is nil' if certificate_order_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.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'certificateOrderName' => certificate_order_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::V2020_09_01::Models::AppServiceCertificateCollection.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_certificates_next(next_page_link, custom_headers:nil) click to toggle source

List all certificates associated with a certificate order.

Description for List all certificates associated with a certificate order.

@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 [AppServiceCertificateCollection] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 2548
def list_certificates_next(next_page_link, custom_headers:nil)
  response = list_certificates_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_certificates_next_async(next_page_link, custom_headers:nil) click to toggle source

List all certificates associated with a certificate order.

Description for List all certificates associated with a certificate order.

@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/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 2581
def list_certificates_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::V2020_09_01::Models::AppServiceCertificateCollection.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_certificates_next_with_http_info(next_page_link, custom_headers:nil) click to toggle source

List all certificates associated with a certificate order.

Description for List all certificates associated with a certificate order.

@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/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 2565
def list_certificates_next_with_http_info(next_page_link, custom_headers:nil)
  list_certificates_next_async(next_page_link, custom_headers:custom_headers).value!
end
list_certificates_with_http_info(resource_group_name, certificate_order_name, custom_headers:nil) click to toggle source

List all certificates associated with a certificate order.

Description for List all certificates associated with a certificate order.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param certificate_order_name [String] Name of the certificate order. @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/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 728
def list_certificates_with_http_info(resource_group_name, certificate_order_name, custom_headers:nil)
  list_certificates_async(resource_group_name, certificate_order_name, custom_headers:custom_headers).value!
end
list_next(next_page_link, custom_headers:nil) click to toggle source

List all certificate orders in a subscription.

Description for List all certificate orders 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 [AppServiceCertificateOrderCollection] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 2356
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

List all certificate orders in a subscription.

Description for List all certificate orders 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/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 2389
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::V2020_09_01::Models::AppServiceCertificateOrderCollection.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

List all certificate orders in a subscription.

Description for List all certificate orders 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/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 2373
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_with_http_info(custom_headers:nil) click to toggle source

List all certificate orders in a subscription.

Description for List all certificate orders 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/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 49
def list_with_http_info(custom_headers:nil)
  list_async(custom_headers:custom_headers).value!
end
reissue(resource_group_name, certificate_order_name, reissue_certificate_order_request, custom_headers:nil) click to toggle source

Reissue an existing certificate order.

Description for Reissue an existing certificate order.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param certificate_order_name [String] Name of the certificate order. @param reissue_certificate_order_request [ReissueCertificateOrderRequest] Parameters for the reissue. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 1216
def reissue(resource_group_name, certificate_order_name, reissue_certificate_order_request, custom_headers:nil)
  response = reissue_async(resource_group_name, certificate_order_name, reissue_certificate_order_request, custom_headers:custom_headers).value!
  nil
end
reissue_async(resource_group_name, certificate_order_name, reissue_certificate_order_request, custom_headers:nil) click to toggle source

Reissue an existing certificate order.

Description for Reissue an existing certificate order.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param certificate_order_name [String] Name of the certificate order. @param reissue_certificate_order_request [ReissueCertificateOrderRequest] Parameters for the reissue. @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/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 1255
def reissue_async(resource_group_name, certificate_order_name, reissue_certificate_order_request, 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, 'certificate_order_name is nil' if certificate_order_name.nil?
  fail ArgumentError, 'reissue_certificate_order_request is nil' if reissue_certificate_order_request.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::V2020_09_01::Models::ReissueCertificateOrderRequest.mapper()
  request_content = @client.serialize(request_mapper,  reissue_certificate_order_request)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/reissue'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'certificateOrderName' => certificate_order_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(: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 == 204
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

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

    result
  end

  promise.execute
end
reissue_with_http_info(resource_group_name, certificate_order_name, reissue_certificate_order_request, custom_headers:nil) click to toggle source

Reissue an existing certificate order.

Description for Reissue an existing certificate order.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param certificate_order_name [String] Name of the certificate order. @param reissue_certificate_order_request [ReissueCertificateOrderRequest] Parameters for the reissue. @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/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 1236
def reissue_with_http_info(resource_group_name, certificate_order_name, reissue_certificate_order_request, custom_headers:nil)
  reissue_async(resource_group_name, certificate_order_name, reissue_certificate_order_request, custom_headers:custom_headers).value!
end
renew(resource_group_name, certificate_order_name, renew_certificate_order_request, custom_headers:nil) click to toggle source

Renew an existing certificate order.

Description for Renew an existing certificate order.

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

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 1325
def renew(resource_group_name, certificate_order_name, renew_certificate_order_request, custom_headers:nil)
  response = renew_async(resource_group_name, certificate_order_name, renew_certificate_order_request, custom_headers:custom_headers).value!
  nil
end
renew_async(resource_group_name, certificate_order_name, renew_certificate_order_request, custom_headers:nil) click to toggle source

Renew an existing certificate order.

Description for Renew an existing certificate order.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param certificate_order_name [String] Name of the certificate order. @param renew_certificate_order_request [RenewCertificateOrderRequest] Renew parameters @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/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 1364
def renew_async(resource_group_name, certificate_order_name, renew_certificate_order_request, 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, 'certificate_order_name is nil' if certificate_order_name.nil?
  fail ArgumentError, 'renew_certificate_order_request is nil' if renew_certificate_order_request.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::V2020_09_01::Models::RenewCertificateOrderRequest.mapper()
  request_content = @client.serialize(request_mapper,  renew_certificate_order_request)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/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,'certificateOrderName' => certificate_order_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(: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 == 204
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

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

    result
  end

  promise.execute
end
renew_with_http_info(resource_group_name, certificate_order_name, renew_certificate_order_request, custom_headers:nil) click to toggle source

Renew an existing certificate order.

Description for Renew an existing certificate order.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param certificate_order_name [String] Name of the certificate order. @param renew_certificate_order_request [RenewCertificateOrderRequest] Renew parameters @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/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 1345
def renew_with_http_info(resource_group_name, certificate_order_name, renew_certificate_order_request, custom_headers:nil)
  renew_async(resource_group_name, certificate_order_name, renew_certificate_order_request, custom_headers:custom_headers).value!
end
resend_email(resource_group_name, certificate_order_name, custom_headers:nil) click to toggle source

Resend certificate email.

Description for Resend certificate email.

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

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 1432
def resend_email(resource_group_name, certificate_order_name, custom_headers:nil)
  response = resend_email_async(resource_group_name, certificate_order_name, custom_headers:custom_headers).value!
  nil
end
resend_email_async(resource_group_name, certificate_order_name, custom_headers:nil) click to toggle source

Resend certificate email.

Description for Resend certificate email.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param certificate_order_name [String] Name of the certificate order. @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/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 1467
def resend_email_async(resource_group_name, certificate_order_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, 'certificate_order_name is nil' if certificate_order_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.CertificateRegistration/certificateOrders/{certificateOrderName}/resendEmail'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'certificateOrderName' => certificate_order_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 == 204
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

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

    result
  end

  promise.execute
end
resend_email_with_http_info(resource_group_name, certificate_order_name, custom_headers:nil) click to toggle source

Resend certificate email.

Description for Resend certificate email.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param certificate_order_name [String] Name of the certificate order. @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/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 1450
def resend_email_with_http_info(resource_group_name, certificate_order_name, custom_headers:nil)
  resend_email_async(resource_group_name, certificate_order_name, custom_headers:custom_headers).value!
end
resend_request_emails(resource_group_name, certificate_order_name, name_identifier, custom_headers:nil) click to toggle source

Verify domain ownership for this certificate order.

Description for Verify domain ownership for this certificate order.

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

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 1528
def resend_request_emails(resource_group_name, certificate_order_name, name_identifier, custom_headers:nil)
  response = resend_request_emails_async(resource_group_name, certificate_order_name, name_identifier, custom_headers:custom_headers).value!
  nil
end
resend_request_emails_async(resource_group_name, certificate_order_name, name_identifier, custom_headers:nil) click to toggle source

Verify domain ownership for this certificate order.

Description for Verify domain ownership for this certificate order.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param certificate_order_name [String] Name of the certificate order. @param name_identifier [NameIdentifier] Email address @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/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 1565
def resend_request_emails_async(resource_group_name, certificate_order_name, name_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, 'certificate_order_name is nil' if certificate_order_name.nil?
  fail ArgumentError, 'name_identifier is nil' if name_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::V2020_09_01::Models::NameIdentifier.mapper()
  request_content = @client.serialize(request_mapper,  name_identifier)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/resendRequestEmails'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'certificateOrderName' => certificate_order_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(: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 == 204
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

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

    result
  end

  promise.execute
end
resend_request_emails_with_http_info(resource_group_name, certificate_order_name, name_identifier, custom_headers:nil) click to toggle source

Verify domain ownership for this certificate order.

Description for Verify domain ownership for this certificate order.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param certificate_order_name [String] Name of the certificate order. @param name_identifier [NameIdentifier] Email address @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/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 1547
def resend_request_emails_with_http_info(resource_group_name, certificate_order_name, name_identifier, custom_headers:nil)
  resend_request_emails_async(resource_group_name, certificate_order_name, name_identifier, custom_headers:custom_headers).value!
end
retrieve_certificate_actions(resource_group_name, name, custom_headers:nil) click to toggle source

Retrieve the list of certificate actions.

Description for Retrieve the list of certificate actions.

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

@return [Array] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 1846
def retrieve_certificate_actions(resource_group_name, name, custom_headers:nil)
  response = retrieve_certificate_actions_async(resource_group_name, name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
retrieve_certificate_actions_async(resource_group_name, name, custom_headers:nil) click to toggle source

Retrieve the list of certificate actions.

Description for Retrieve the list of certificate actions.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the certificate order. @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/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 1881
def retrieve_certificate_actions_async(resource_group_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, '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.CertificateRegistration/certificateOrders/{name}/retrieveCertificateActions'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_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(: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 = {
          client_side_validation: true,
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'Sequence',
            element: {
                client_side_validation: true,
                required: false,
                serialized_name: 'CertificateOrderActionElementType',
                type: {
                  name: 'Composite',
                  class_name: 'CertificateOrderAction'
                }
            }
          }
        }
        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
retrieve_certificate_actions_with_http_info(resource_group_name, name, custom_headers:nil) click to toggle source

Retrieve the list of certificate actions.

Description for Retrieve the list of certificate actions.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the certificate order. @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/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 1864
def retrieve_certificate_actions_with_http_info(resource_group_name, name, custom_headers:nil)
  retrieve_certificate_actions_async(resource_group_name, name, custom_headers:custom_headers).value!
end
retrieve_certificate_email_history(resource_group_name, name, custom_headers:nil) click to toggle source

Retrieve email history.

Description for Retrieve email history.

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

@return [Array] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 1968
def retrieve_certificate_email_history(resource_group_name, name, custom_headers:nil)
  response = retrieve_certificate_email_history_async(resource_group_name, name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
retrieve_certificate_email_history_async(resource_group_name, name, custom_headers:nil) click to toggle source

Retrieve email history.

Description for Retrieve email history.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the certificate order. @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/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 2003
def retrieve_certificate_email_history_async(resource_group_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, '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.CertificateRegistration/certificateOrders/{name}/retrieveEmailHistory'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_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(: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 = {
          client_side_validation: true,
          required: false,
          serialized_name: 'parsed_response',
          type: {
            name: 'Sequence',
            element: {
                client_side_validation: true,
                required: false,
                serialized_name: 'CertificateEmailElementType',
                type: {
                  name: 'Composite',
                  class_name: 'CertificateEmail'
                }
            }
          }
        }
        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
retrieve_certificate_email_history_with_http_info(resource_group_name, name, custom_headers:nil) click to toggle source

Retrieve email history.

Description for Retrieve email history.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param name [String] Name of the certificate order. @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/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 1986
def retrieve_certificate_email_history_with_http_info(resource_group_name, name, custom_headers:nil)
  retrieve_certificate_email_history_async(resource_group_name, name, custom_headers:custom_headers).value!
end
retrieve_site_seal(resource_group_name, certificate_order_name, site_seal_request, custom_headers:nil) click to toggle source

Verify domain ownership for this certificate order.

Description for Verify domain ownership for this certificate order.

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

@return [SiteSeal] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 1635
def retrieve_site_seal(resource_group_name, certificate_order_name, site_seal_request, custom_headers:nil)
  response = retrieve_site_seal_async(resource_group_name, certificate_order_name, site_seal_request, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
retrieve_site_seal_async(resource_group_name, certificate_order_name, site_seal_request, custom_headers:nil) click to toggle source

Verify domain ownership for this certificate order.

Description for Verify domain ownership for this certificate order.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param certificate_order_name [String] Name of the certificate order. @param site_seal_request [SiteSealRequest] Site seal request. @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/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 1672
def retrieve_site_seal_async(resource_group_name, certificate_order_name, site_seal_request, 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, 'certificate_order_name is nil' if certificate_order_name.nil?
  fail ArgumentError, 'site_seal_request is nil' if site_seal_request.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::V2020_09_01::Models::SiteSealRequest.mapper()
  request_content = @client.serialize(request_mapper,  site_seal_request)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/retrieveSiteSeal'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'certificateOrderName' => certificate_order_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(: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::V2020_09_01::Models::SiteSeal.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
retrieve_site_seal_with_http_info(resource_group_name, certificate_order_name, site_seal_request, custom_headers:nil) click to toggle source

Verify domain ownership for this certificate order.

Description for Verify domain ownership for this certificate order.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param certificate_order_name [String] Name of the certificate order. @param site_seal_request [SiteSealRequest] Site seal request. @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/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 1654
def retrieve_site_seal_with_http_info(resource_group_name, certificate_order_name, site_seal_request, custom_headers:nil)
  retrieve_site_seal_async(resource_group_name, certificate_order_name, site_seal_request, custom_headers:custom_headers).value!
end
update(resource_group_name, certificate_order_name, certificate_distinguished_name, custom_headers:nil) click to toggle source

Create or update a certificate purchase order.

Description for Create or update a certificate purchase order.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param certificate_order_name [String] Name of the certificate order. @param certificate_distinguished_name

AppServiceCertificateOrderPatchResource

Distinguished name to use for the

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

@return [AppServiceCertificateOrder] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 580
def update(resource_group_name, certificate_order_name, certificate_distinguished_name, custom_headers:nil)
  response = update_async(resource_group_name, certificate_order_name, certificate_distinguished_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
update_async(resource_group_name, certificate_order_name, certificate_distinguished_name, custom_headers:nil) click to toggle source

Create or update a certificate purchase order.

Description for Create or update a certificate purchase order.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param certificate_order_name [String] Name of the certificate order. @param certificate_distinguished_name

AppServiceCertificateOrderPatchResource

Distinguished name to use for the

certificate order. @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/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 621
def update_async(resource_group_name, certificate_order_name, certificate_distinguished_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, 'certificate_order_name is nil' if certificate_order_name.nil?
  fail ArgumentError, 'certificate_distinguished_name is nil' if certificate_distinguished_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?

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

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'certificateOrderName' => certificate_order_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 || status_code == 201
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

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

Creates or updates a certificate and associates with key vault secret.

Description for Creates or updates a certificate and associates with key vault secret.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param certificate_order_name [String] Name of the certificate order. @param name [String] Name of the certificate. @param key_vault_certificate [AppServiceCertificatePatchResource] Key vault certificate resource Id. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [AppServiceCertificateResource] operation results.

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 1082
def update_certificate(resource_group_name, certificate_order_name, name, key_vault_certificate, custom_headers:nil)
  response = update_certificate_async(resource_group_name, certificate_order_name, name, key_vault_certificate, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
update_certificate_async(resource_group_name, certificate_order_name, name, key_vault_certificate, custom_headers:nil) click to toggle source

Creates or updates a certificate and associates with key vault secret.

Description for Creates or updates a certificate and associates with key vault secret.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param certificate_order_name [String] Name of the certificate order. @param name [String] Name of the certificate. @param key_vault_certificate [AppServiceCertificatePatchResource] Key vault certificate resource Id. @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/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 1125
def update_certificate_async(resource_group_name, certificate_order_name, name, key_vault_certificate, 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, 'certificate_order_name is nil' if certificate_order_name.nil?
  fail ArgumentError, 'name is nil' if name.nil?
  fail ArgumentError, 'key_vault_certificate is nil' if key_vault_certificate.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::V2020_09_01::Models::AppServiceCertificatePatchResource.mapper()
  request_content = @client.serialize(request_mapper,  key_vault_certificate)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{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,'certificateOrderName' => certificate_order_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 || status_code == 201
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

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

Creates or updates a certificate and associates with key vault secret.

Description for Creates or updates a certificate and associates with key vault secret.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param certificate_order_name [String] Name of the certificate order. @param name [String] Name of the certificate. @param key_vault_certificate [AppServiceCertificatePatchResource] Key vault certificate resource Id. @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/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 1104
def update_certificate_with_http_info(resource_group_name, certificate_order_name, name, key_vault_certificate, custom_headers:nil)
  update_certificate_async(resource_group_name, certificate_order_name, name, key_vault_certificate, custom_headers:custom_headers).value!
end
update_with_http_info(resource_group_name, certificate_order_name, certificate_distinguished_name, custom_headers:nil) click to toggle source

Create or update a certificate purchase order.

Description for Create or update a certificate purchase order.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param certificate_order_name [String] Name of the certificate order. @param certificate_distinguished_name

AppServiceCertificateOrderPatchResource

Distinguished name to use for the

certificate order. @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/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 601
def update_with_http_info(resource_group_name, certificate_order_name, certificate_distinguished_name, custom_headers:nil)
  update_async(resource_group_name, certificate_order_name, certificate_distinguished_name, custom_headers:custom_headers).value!
end
validate_purchase_information(app_service_certificate_order, custom_headers:nil) click to toggle source

Validate information for a certificate order.

Description for Validate information for a certificate order.

@param app_service_certificate_order [AppServiceCertificateOrder] Information for a certificate order. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 127
def validate_purchase_information(app_service_certificate_order, custom_headers:nil)
  response = validate_purchase_information_async(app_service_certificate_order, custom_headers:custom_headers).value!
  nil
end
validate_purchase_information_async(app_service_certificate_order, custom_headers:nil) click to toggle source

Validate information for a certificate order.

Description for Validate information for a certificate order.

@param app_service_certificate_order [AppServiceCertificateOrder] Information for a certificate order. @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/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 160
def validate_purchase_information_async(app_service_certificate_order, custom_headers:nil)
  fail ArgumentError, 'app_service_certificate_order is nil' if app_service_certificate_order.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::V2020_09_01::Models::AppServiceCertificateOrder.mapper()
  request_content = @client.serialize(request_mapper,  app_service_certificate_order)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.CertificateRegistration/validateCertificateRegistrationInformation'

  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 == 204
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

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

    result
  end

  promise.execute
end
validate_purchase_information_with_http_info(app_service_certificate_order, custom_headers:nil) click to toggle source

Validate information for a certificate order.

Description for Validate information for a certificate order.

@param app_service_certificate_order [AppServiceCertificateOrder] Information for a certificate order. @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/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 144
def validate_purchase_information_with_http_info(app_service_certificate_order, custom_headers:nil)
  validate_purchase_information_async(app_service_certificate_order, custom_headers:custom_headers).value!
end
verify_domain_ownership(resource_group_name, certificate_order_name, custom_headers:nil) click to toggle source

Verify domain ownership for this certificate order.

Description for Verify domain ownership for this certificate order.

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

# File lib/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 1750
def verify_domain_ownership(resource_group_name, certificate_order_name, custom_headers:nil)
  response = verify_domain_ownership_async(resource_group_name, certificate_order_name, custom_headers:custom_headers).value!
  nil
end
verify_domain_ownership_async(resource_group_name, certificate_order_name, custom_headers:nil) click to toggle source

Verify domain ownership for this certificate order.

Description for Verify domain ownership for this certificate order.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param certificate_order_name [String] Name of the certificate order. @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/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 1785
def verify_domain_ownership_async(resource_group_name, certificate_order_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, 'certificate_order_name is nil' if certificate_order_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.CertificateRegistration/certificateOrders/{certificateOrderName}/verifyDomainOwnership'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'resourceGroupName' => resource_group_name,'certificateOrderName' => certificate_order_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 == 204
      error_model = JSON.load(response_content)
      fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
    end

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

    result
  end

  promise.execute
end
verify_domain_ownership_with_http_info(resource_group_name, certificate_order_name, custom_headers:nil) click to toggle source

Verify domain ownership for this certificate order.

Description for Verify domain ownership for this certificate order.

@param resource_group_name [String] Name of the resource group to which the resource belongs. @param certificate_order_name [String] Name of the certificate order. @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/2020-09-01/generated/azure_mgmt_web/app_service_certificate_orders.rb, line 1768
def verify_domain_ownership_with_http_info(resource_group_name, certificate_order_name, custom_headers:nil)
  verify_domain_ownership_async(resource_group_name, certificate_order_name, custom_headers:custom_headers).value!
end