class Azure::Appconfiguration::Mgmt::V2019_11_01_preview::ConfigurationStores

ConfigurationStores

Attributes

client[R]

@return [AppConfigurationManagementClient] reference to the AppConfigurationManagementClient

Public Class Methods

new(client) click to toggle source

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

# File lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/configuration_stores.rb, line 17
def initialize(client)
  @client = client
end

Public Instance Methods

begin_create(resource_group_name, config_store_name, config_store_creation_parameters, custom_headers:nil) click to toggle source

Creates a configuration store with the specified parameters.

@param resource_group_name [String] The name of the resource group to which the container registry belongs. @param config_store_name [String] The name of the configuration store. @param config_store_creation_parameters [ConfigurationStore] The parameters for creating a configuration store. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [ConfigurationStore] operation results.

# File lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/configuration_stores.rb, line 825
def begin_create(resource_group_name, config_store_name, config_store_creation_parameters, custom_headers:nil)
  response = begin_create_async(resource_group_name, config_store_name, config_store_creation_parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
begin_create_async(resource_group_name, config_store_name, config_store_creation_parameters, custom_headers:nil) click to toggle source

Creates a configuration store with the specified parameters.

@param resource_group_name [String] The name of the resource group to which the container registry belongs. @param config_store_name [String] The name of the configuration store. @param config_store_creation_parameters [ConfigurationStore] The parameters for creating a configuration store. @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/2019-11-01-preview/generated/azure_mgmt_appconfiguration/configuration_stores.rb, line 860
def begin_create_async(resource_group_name, config_store_name, config_store_creation_parameters, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'config_store_name is nil' if config_store_name.nil?
  fail ArgumentError, "'config_store_name' should satisfy the constraint - 'MaxLength': '50'" if !config_store_name.nil? && config_store_name.length > 50
  fail ArgumentError, "'config_store_name' should satisfy the constraint - 'MinLength': '5'" if !config_store_name.nil? && config_store_name.length < 5
  fail ArgumentError, "'config_store_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9_-]*$'" if !config_store_name.nil? && config_store_name.match(Regexp.new('^^[a-zA-Z0-9_-]*$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, 'config_store_creation_parameters is nil' if config_store_creation_parameters.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::Appconfiguration::Mgmt::V2019_11_01_preview::Models::ConfigurationStore.mapper()
  request_content = @client.serialize(request_mapper,  config_store_creation_parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'configStoreName' => config_store_name},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(: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::Appconfiguration::Mgmt::V2019_11_01_preview::Models::ConfigurationStore.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::Appconfiguration::Mgmt::V2019_11_01_preview::Models::ConfigurationStore.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_with_http_info(resource_group_name, config_store_name, config_store_creation_parameters, custom_headers:nil) click to toggle source

Creates a configuration store with the specified parameters.

@param resource_group_name [String] The name of the resource group to which the container registry belongs. @param config_store_name [String] The name of the configuration store. @param config_store_creation_parameters [ConfigurationStore] The parameters for creating a configuration store. @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/2019-11-01-preview/generated/azure_mgmt_appconfiguration/configuration_stores.rb, line 843
def begin_create_with_http_info(resource_group_name, config_store_name, config_store_creation_parameters, custom_headers:nil)
  begin_create_async(resource_group_name, config_store_name, config_store_creation_parameters, custom_headers:custom_headers).value!
end
begin_delete(resource_group_name, config_store_name, custom_headers:nil) click to toggle source

Deletes a configuration store.

@param resource_group_name [String] The name of the resource group to which the container registry belongs. @param config_store_name [String] The name of the configuration store. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

# File lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/configuration_stores.rb, line 946
def begin_delete(resource_group_name, config_store_name, custom_headers:nil)
  response = begin_delete_async(resource_group_name, config_store_name, custom_headers:custom_headers).value!
  nil
end
begin_delete_async(resource_group_name, config_store_name, custom_headers:nil) click to toggle source

Deletes a configuration store.

@param resource_group_name [String] The name of the resource group to which the container registry belongs. @param config_store_name [String] The name of the configuration store. @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/2019-11-01-preview/generated/azure_mgmt_appconfiguration/configuration_stores.rb, line 977
def begin_delete_async(resource_group_name, config_store_name, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'config_store_name is nil' if config_store_name.nil?
  fail ArgumentError, "'config_store_name' should satisfy the constraint - 'MaxLength': '50'" if !config_store_name.nil? && config_store_name.length > 50
  fail ArgumentError, "'config_store_name' should satisfy the constraint - 'MinLength': '5'" if !config_store_name.nil? && config_store_name.length < 5
  fail ArgumentError, "'config_store_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9_-]*$'" if !config_store_name.nil? && config_store_name.match(Regexp.new('^^[a-zA-Z0-9_-]*$$')).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.AppConfiguration/configurationStores/{configStoreName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'configStoreName' => config_store_name},
      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 == 202 || 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
begin_delete_with_http_info(resource_group_name, config_store_name, custom_headers:nil) click to toggle source

Deletes a configuration store.

@param resource_group_name [String] The name of the resource group to which the container registry belongs. @param config_store_name [String] The name of the configuration store. @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/2019-11-01-preview/generated/azure_mgmt_appconfiguration/configuration_stores.rb, line 962
def begin_delete_with_http_info(resource_group_name, config_store_name, custom_headers:nil)
  begin_delete_async(resource_group_name, config_store_name, custom_headers:custom_headers).value!
end
begin_update(resource_group_name, config_store_name, config_store_update_parameters, custom_headers:nil) click to toggle source

Updates a configuration store with the specified parameters.

@param resource_group_name [String] The name of the resource group to which the container registry belongs. @param config_store_name [String] The name of the configuration store. @param config_store_update_parameters [ConfigurationStoreUpdateParameters] The parameters for updating a configuration store. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [ConfigurationStore] operation results.

# File lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/configuration_stores.rb, line 1038
def begin_update(resource_group_name, config_store_name, config_store_update_parameters, custom_headers:nil)
  response = begin_update_async(resource_group_name, config_store_name, config_store_update_parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
begin_update_async(resource_group_name, config_store_name, config_store_update_parameters, custom_headers:nil) click to toggle source

Updates a configuration store with the specified parameters.

@param resource_group_name [String] The name of the resource group to which the container registry belongs. @param config_store_name [String] The name of the configuration store. @param config_store_update_parameters [ConfigurationStoreUpdateParameters] The parameters for updating a configuration store. @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/2019-11-01-preview/generated/azure_mgmt_appconfiguration/configuration_stores.rb, line 1073
def begin_update_async(resource_group_name, config_store_name, config_store_update_parameters, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'config_store_name is nil' if config_store_name.nil?
  fail ArgumentError, "'config_store_name' should satisfy the constraint - 'MaxLength': '50'" if !config_store_name.nil? && config_store_name.length > 50
  fail ArgumentError, "'config_store_name' should satisfy the constraint - 'MinLength': '5'" if !config_store_name.nil? && config_store_name.length < 5
  fail ArgumentError, "'config_store_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9_-]*$'" if !config_store_name.nil? && config_store_name.match(Regexp.new('^^[a-zA-Z0-9_-]*$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, 'config_store_update_parameters is nil' if config_store_update_parameters.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::Appconfiguration::Mgmt::V2019_11_01_preview::Models::ConfigurationStoreUpdateParameters.mapper()
  request_content = @client.serialize(request_mapper,  config_store_update_parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'configStoreName' => config_store_name},
      query_params: {'api-version' => @client.api_version},
      body: request_content,
      headers: request_headers.merge(custom_headers || {}),
      base_url: request_url
  }
  promise = @client.make_request_async(: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::Appconfiguration::Mgmt::V2019_11_01_preview::Models::ConfigurationStore.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::Appconfiguration::Mgmt::V2019_11_01_preview::Models::ConfigurationStore.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_update_with_http_info(resource_group_name, config_store_name, config_store_update_parameters, custom_headers:nil) click to toggle source

Updates a configuration store with the specified parameters.

@param resource_group_name [String] The name of the resource group to which the container registry belongs. @param config_store_name [String] The name of the configuration store. @param config_store_update_parameters [ConfigurationStoreUpdateParameters] The parameters for updating a configuration store. @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/2019-11-01-preview/generated/azure_mgmt_appconfiguration/configuration_stores.rb, line 1056
def begin_update_with_http_info(resource_group_name, config_store_name, config_store_update_parameters, custom_headers:nil)
  begin_update_async(resource_group_name, config_store_name, config_store_update_parameters, custom_headers:custom_headers).value!
end
create(resource_group_name, config_store_name, config_store_creation_parameters, custom_headers:nil) click to toggle source

Creates a configuration store with the specified parameters.

@param resource_group_name [String] The name of the resource group to which the container registry belongs. @param config_store_name [String] The name of the configuration store. @param config_store_creation_parameters [ConfigurationStore] The parameters for creating a configuration store. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [ConfigurationStore] operation results.

# File lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/configuration_stores.rb, line 346
def create(resource_group_name, config_store_name, config_store_creation_parameters, custom_headers:nil)
  response = create_async(resource_group_name, config_store_name, config_store_creation_parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
create_async(resource_group_name, config_store_name, config_store_creation_parameters, custom_headers:nil) click to toggle source

@param resource_group_name [String] The name of the resource group to which the container registry belongs. @param config_store_name [String] The name of the configuration store. @param config_store_creation_parameters [ConfigurationStore] The parameters for creating a configuration store. @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/2019-11-01-preview/generated/azure_mgmt_appconfiguration/configuration_stores.rb, line 363
def create_async(resource_group_name, config_store_name, config_store_creation_parameters, custom_headers:nil)
  # Send request
  promise = begin_create_async(resource_group_name, config_store_name, config_store_creation_parameters, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Appconfiguration::Mgmt::V2019_11_01_preview::Models::ConfigurationStore.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, config_store_name, custom_headers:nil) click to toggle source

Deletes a configuration store.

@param resource_group_name [String] The name of the resource group to which the container registry belongs. @param config_store_name [String] The name of the configuration store. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

# File lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/configuration_stores.rb, line 390
def delete(resource_group_name, config_store_name, custom_headers:nil)
  response = delete_async(resource_group_name, config_store_name, custom_headers:custom_headers).value!
  nil
end
delete_async(resource_group_name, config_store_name, custom_headers:nil) click to toggle source

@param resource_group_name [String] The name of the resource group to which the container registry belongs. @param config_store_name [String] The name of the configuration store. @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/2019-11-01-preview/generated/azure_mgmt_appconfiguration/configuration_stores.rb, line 405
def delete_async(resource_group_name, config_store_name, custom_headers:nil)
  # Send request
  promise = begin_delete_async(resource_group_name, config_store_name, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
    end

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

  promise
end
get(resource_group_name, config_store_name, custom_headers:nil) click to toggle source

Gets the properties of the specified configuration store.

@param resource_group_name [String] The name of the resource group to which the container registry belongs. @param config_store_name [String] The name of the configuration store. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [ConfigurationStore] operation results.

# File lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/configuration_stores.rb, line 244
def get(resource_group_name, config_store_name, custom_headers:nil)
  response = get_async(resource_group_name, config_store_name, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
get_async(resource_group_name, config_store_name, custom_headers:nil) click to toggle source

Gets the properties of the specified configuration store.

@param resource_group_name [String] The name of the resource group to which the container registry belongs. @param config_store_name [String] The name of the configuration store. @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/2019-11-01-preview/generated/azure_mgmt_appconfiguration/configuration_stores.rb, line 275
def get_async(resource_group_name, config_store_name, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'config_store_name is nil' if config_store_name.nil?
  fail ArgumentError, "'config_store_name' should satisfy the constraint - 'MaxLength': '50'" if !config_store_name.nil? && config_store_name.length > 50
  fail ArgumentError, "'config_store_name' should satisfy the constraint - 'MinLength': '5'" if !config_store_name.nil? && config_store_name.length < 5
  fail ArgumentError, "'config_store_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9_-]*$'" if !config_store_name.nil? && config_store_name.match(Regexp.new('^^[a-zA-Z0-9_-]*$$')).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.AppConfiguration/configurationStores/{configStoreName}'

  request_url = @base_url || @client.base_url

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

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 200
      error_model = JSON.load(response_content)
      fail 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::Appconfiguration::Mgmt::V2019_11_01_preview::Models::ConfigurationStore.mapper()
        result.body = @client.deserialize(result_mapper, parsed_response)
      rescue Exception => e
        fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
      end
    end

    result
  end

  promise.execute
end
get_with_http_info(resource_group_name, config_store_name, custom_headers:nil) click to toggle source

Gets the properties of the specified configuration store.

@param resource_group_name [String] The name of the resource group to which the container registry belongs. @param config_store_name [String] The name of the configuration store. @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/2019-11-01-preview/generated/azure_mgmt_appconfiguration/configuration_stores.rb, line 260
def get_with_http_info(resource_group_name, config_store_name, custom_headers:nil)
  get_async(resource_group_name, config_store_name, custom_headers:custom_headers).value!
end
list(skip_token:nil, custom_headers:nil) click to toggle source

Lists the configuration stores for a given subscription.

@param skip_token [String] A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array<ConfigurationStore>] operation results.

# File lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/configuration_stores.rb, line 37
def list(skip_token:nil, custom_headers:nil)
  first_page = list_as_lazy(skip_token:skip_token, custom_headers:custom_headers)
  first_page.get_all_items
end
list_as_lazy(skip_token:nil, custom_headers:nil) click to toggle source

Lists the configuration stores for a given subscription.

@param skip_token [String] A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

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

# File lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/configuration_stores.rb, line 1433
def list_as_lazy(skip_token:nil, custom_headers:nil)
  response = list_async(skip_token:skip_token, 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(skip_token:nil, custom_headers:nil) click to toggle source

Lists the configuration stores for a given subscription.

@param skip_token [String] A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. @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/2019-11-01-preview/generated/azure_mgmt_appconfiguration/configuration_stores.rb, line 72
def list_async(skip_token:nil, 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.AppConfiguration/configurationStores'

  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,'$skipToken' => skip_token},
      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::Appconfiguration::Mgmt::V2019_11_01_preview::Models::ConfigurationStoreListResult.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, skip_token:nil, custom_headers:nil) click to toggle source

Lists the configuration stores for a given resource group.

@param resource_group_name [String] The name of the resource group to which the container registry belongs. @param skip_token [String] A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array<ConfigurationStore>] operation results.

# File lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/configuration_stores.rb, line 140
def list_by_resource_group(resource_group_name, skip_token:nil, custom_headers:nil)
  first_page = list_by_resource_group_as_lazy(resource_group_name, skip_token:skip_token, custom_headers:custom_headers)
  first_page.get_all_items
end
list_by_resource_group_as_lazy(resource_group_name, skip_token:nil, custom_headers:nil) click to toggle source

Lists the configuration stores for a given resource group.

@param resource_group_name [String] The name of the resource group to which the container registry belongs. @param skip_token [String] A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

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

# File lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/configuration_stores.rb, line 1460
def list_by_resource_group_as_lazy(resource_group_name, skip_token:nil, custom_headers:nil)
  response = list_by_resource_group_async(resource_group_name, skip_token:skip_token, 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, skip_token:nil, custom_headers:nil) click to toggle source

Lists the configuration stores for a given resource group.

@param resource_group_name [String] The name of the resource group to which the container registry belongs. @param skip_token [String] A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. @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/2019-11-01-preview/generated/azure_mgmt_appconfiguration/configuration_stores.rb, line 179
def list_by_resource_group_async(resource_group_name, skip_token:nil, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.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.AppConfiguration/configurationStores'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name},
      query_params: {'api-version' => @client.api_version,'$skipToken' => skip_token},
      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::Appconfiguration::Mgmt::V2019_11_01_preview::Models::ConfigurationStoreListResult.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

Lists the configuration stores for a given 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 [ConfigurationStoreListResult] operation results.

# File lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/configuration_stores.rb, line 1249
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

Lists the configuration stores for a given 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/2019-11-01-preview/generated/azure_mgmt_appconfiguration/configuration_stores.rb, line 1278
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::Appconfiguration::Mgmt::V2019_11_01_preview::Models::ConfigurationStoreListResult.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

Lists the configuration stores for a given 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/2019-11-01-preview/generated/azure_mgmt_appconfiguration/configuration_stores.rb, line 1264
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, skip_token:nil, custom_headers:nil) click to toggle source

Lists the configuration stores for a given resource group.

@param resource_group_name [String] The name of the resource group to which the container registry belongs. @param skip_token [String] A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. @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/2019-11-01-preview/generated/azure_mgmt_appconfiguration/configuration_stores.rb, line 160
def list_by_resource_group_with_http_info(resource_group_name, skip_token:nil, custom_headers:nil)
  list_by_resource_group_async(resource_group_name, skip_token:skip_token, custom_headers:custom_headers).value!
end
list_key_value(resource_group_name, config_store_name, list_key_value_parameters, custom_headers:nil) click to toggle source

Lists a configuration store key-value.

@param resource_group_name [String] The name of the resource group to which the container registry belongs. @param config_store_name [String] The name of the configuration store. @param list_key_value_parameters [ListKeyValueParameters] The parameters for retrieving a key-value. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [KeyValue] operation results.

# File lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/configuration_stores.rb, line 711
def list_key_value(resource_group_name, config_store_name, list_key_value_parameters, custom_headers:nil)
  response = list_key_value_async(resource_group_name, config_store_name, list_key_value_parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_key_value_async(resource_group_name, config_store_name, list_key_value_parameters, custom_headers:nil) click to toggle source

Lists a configuration store key-value.

@param resource_group_name [String] The name of the resource group to which the container registry belongs. @param config_store_name [String] The name of the configuration store. @param list_key_value_parameters [ListKeyValueParameters] The parameters for retrieving a key-value. @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/2019-11-01-preview/generated/azure_mgmt_appconfiguration/configuration_stores.rb, line 746
def list_key_value_async(resource_group_name, config_store_name, list_key_value_parameters, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'config_store_name is nil' if config_store_name.nil?
  fail ArgumentError, "'config_store_name' should satisfy the constraint - 'MaxLength': '50'" if !config_store_name.nil? && config_store_name.length > 50
  fail ArgumentError, "'config_store_name' should satisfy the constraint - 'MinLength': '5'" if !config_store_name.nil? && config_store_name.length < 5
  fail ArgumentError, "'config_store_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9_-]*$'" if !config_store_name.nil? && config_store_name.match(Regexp.new('^^[a-zA-Z0-9_-]*$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, 'list_key_value_parameters is nil' if list_key_value_parameters.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::Appconfiguration::Mgmt::V2019_11_01_preview::Models::ListKeyValueParameters.mapper()
  request_content = @client.serialize(request_mapper,  list_key_value_parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/listKeyValue'

  request_url = @base_url || @client.base_url

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

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 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::Appconfiguration::Mgmt::V2019_11_01_preview::Models::KeyValue.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_key_value_with_http_info(resource_group_name, config_store_name, list_key_value_parameters, custom_headers:nil) click to toggle source

Lists a configuration store key-value.

@param resource_group_name [String] The name of the resource group to which the container registry belongs. @param config_store_name [String] The name of the configuration store. @param list_key_value_parameters [ListKeyValueParameters] The parameters for retrieving a key-value. @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/2019-11-01-preview/generated/azure_mgmt_appconfiguration/configuration_stores.rb, line 729
def list_key_value_with_http_info(resource_group_name, config_store_name, list_key_value_parameters, custom_headers:nil)
  list_key_value_async(resource_group_name, config_store_name, list_key_value_parameters, custom_headers:custom_headers).value!
end
list_keys(resource_group_name, config_store_name, skip_token:nil, custom_headers:nil) click to toggle source

Lists the access key for the specified configuration store.

@param resource_group_name [String] The name of the resource group to which the container registry belongs. @param config_store_name [String] The name of the configuration store. @param skip_token [String] A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [Array<ApiKey>] operation results.

# File lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/configuration_stores.rb, line 485
def list_keys(resource_group_name, config_store_name, skip_token:nil, custom_headers:nil)
  first_page = list_keys_as_lazy(resource_group_name, config_store_name, skip_token:skip_token, custom_headers:custom_headers)
  first_page.get_all_items
end
list_keys_as_lazy(resource_group_name, config_store_name, skip_token:nil, custom_headers:nil) click to toggle source

Lists the access key for the specified configuration store.

@param resource_group_name [String] The name of the resource group to which the container registry belongs. @param config_store_name [String] The name of the configuration store. @param skip_token [String] A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

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

# File lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/configuration_stores.rb, line 1488
def list_keys_as_lazy(resource_group_name, config_store_name, skip_token:nil, custom_headers:nil)
  response = list_keys_async(resource_group_name, config_store_name, skip_token:skip_token, custom_headers:custom_headers).value!
  unless response.nil?
    page = response.body
    page.next_method = Proc.new do |next_page_link|
      list_keys_next_async(next_page_link, custom_headers:custom_headers)
    end
    page
  end
end
list_keys_async(resource_group_name, config_store_name, skip_token:nil, custom_headers:nil) click to toggle source

Lists the access key for the specified configuration store.

@param resource_group_name [String] The name of the resource group to which the container registry belongs. @param config_store_name [String] The name of the configuration store. @param skip_token [String] A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. @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/2019-11-01-preview/generated/azure_mgmt_appconfiguration/configuration_stores.rb, line 526
def list_keys_async(resource_group_name, config_store_name, skip_token:nil, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'config_store_name is nil' if config_store_name.nil?
  fail ArgumentError, "'config_store_name' should satisfy the constraint - 'MaxLength': '50'" if !config_store_name.nil? && config_store_name.length > 50
  fail ArgumentError, "'config_store_name' should satisfy the constraint - 'MinLength': '5'" if !config_store_name.nil? && config_store_name.length < 5
  fail ArgumentError, "'config_store_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9_-]*$'" if !config_store_name.nil? && config_store_name.match(Regexp.new('^^[a-zA-Z0-9_-]*$$')).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.AppConfiguration/configurationStores/{configStoreName}/ListKeys'

  request_url = @base_url || @client.base_url

  options = {
      middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
      path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'configStoreName' => config_store_name},
      query_params: {'api-version' => @client.api_version,'$skipToken' => skip_token},
      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::Appconfiguration::Mgmt::V2019_11_01_preview::Models::ApiKeyListResult.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_keys_next(next_page_link, custom_headers:nil) click to toggle source

Lists the access key for the specified configuration store.

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

# File lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/configuration_stores.rb, line 1339
def list_keys_next(next_page_link, custom_headers:nil)
  response = list_keys_next_async(next_page_link, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
list_keys_next_async(next_page_link, custom_headers:nil) click to toggle source

Lists the access key for the specified configuration store.

@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/2019-11-01-preview/generated/azure_mgmt_appconfiguration/configuration_stores.rb, line 1368
def list_keys_next_async(next_page_link, custom_headers:nil)
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?


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

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

  request_url = @base_url || @client.base_url

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

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

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

Lists the access key for the specified configuration store.

@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/2019-11-01-preview/generated/azure_mgmt_appconfiguration/configuration_stores.rb, line 1354
def list_keys_next_with_http_info(next_page_link, custom_headers:nil)
  list_keys_next_async(next_page_link, custom_headers:custom_headers).value!
end
list_keys_with_http_info(resource_group_name, config_store_name, skip_token:nil, custom_headers:nil) click to toggle source

Lists the access key for the specified configuration store.

@param resource_group_name [String] The name of the resource group to which the container registry belongs. @param config_store_name [String] The name of the configuration store. @param skip_token [String] A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. @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/2019-11-01-preview/generated/azure_mgmt_appconfiguration/configuration_stores.rb, line 506
def list_keys_with_http_info(resource_group_name, config_store_name, skip_token:nil, custom_headers:nil)
  list_keys_async(resource_group_name, config_store_name, skip_token:skip_token, custom_headers:custom_headers).value!
end
list_next(next_page_link, custom_headers:nil) click to toggle source

Lists the configuration stores for a given 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 [ConfigurationStoreListResult] operation results.

# File lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/configuration_stores.rb, line 1159
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

Lists the configuration stores for a given 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/2019-11-01-preview/generated/azure_mgmt_appconfiguration/configuration_stores.rb, line 1188
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::Appconfiguration::Mgmt::V2019_11_01_preview::Models::ConfigurationStoreListResult.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

Lists the configuration stores for a given 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/2019-11-01-preview/generated/azure_mgmt_appconfiguration/configuration_stores.rb, line 1174
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(skip_token:nil, custom_headers:nil) click to toggle source

Lists the configuration stores for a given subscription.

@param skip_token [String] A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. @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/2019-11-01-preview/generated/azure_mgmt_appconfiguration/configuration_stores.rb, line 55
def list_with_http_info(skip_token:nil, custom_headers:nil)
  list_async(skip_token:skip_token, custom_headers:custom_headers).value!
end
regenerate_key(resource_group_name, config_store_name, regenerate_key_parameters, custom_headers:nil) click to toggle source

Regenerates an access key for the specified configuration store.

@param resource_group_name [String] The name of the resource group to which the container registry belongs. @param config_store_name [String] The name of the configuration store. @param regenerate_key_parameters [RegenerateKeyParameters] The parameters for regenerating an access key. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [ApiKey] operation results.

# File lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/configuration_stores.rb, line 597
def regenerate_key(resource_group_name, config_store_name, regenerate_key_parameters, custom_headers:nil)
  response = regenerate_key_async(resource_group_name, config_store_name, regenerate_key_parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
regenerate_key_async(resource_group_name, config_store_name, regenerate_key_parameters, custom_headers:nil) click to toggle source

Regenerates an access key for the specified configuration store.

@param resource_group_name [String] The name of the resource group to which the container registry belongs. @param config_store_name [String] The name of the configuration store. @param regenerate_key_parameters [RegenerateKeyParameters] The parameters for regenerating an access key. @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/2019-11-01-preview/generated/azure_mgmt_appconfiguration/configuration_stores.rb, line 632
def regenerate_key_async(resource_group_name, config_store_name, regenerate_key_parameters, custom_headers:nil)
  fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
  fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
  fail ArgumentError, 'config_store_name is nil' if config_store_name.nil?
  fail ArgumentError, "'config_store_name' should satisfy the constraint - 'MaxLength': '50'" if !config_store_name.nil? && config_store_name.length > 50
  fail ArgumentError, "'config_store_name' should satisfy the constraint - 'MinLength': '5'" if !config_store_name.nil? && config_store_name.length < 5
  fail ArgumentError, "'config_store_name' should satisfy the constraint - 'Pattern': '^[a-zA-Z0-9_-]*$'" if !config_store_name.nil? && config_store_name.match(Regexp.new('^^[a-zA-Z0-9_-]*$$')).nil?
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
  fail ArgumentError, 'regenerate_key_parameters is nil' if regenerate_key_parameters.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::Appconfiguration::Mgmt::V2019_11_01_preview::Models::RegenerateKeyParameters.mapper()
  request_content = @client.serialize(request_mapper,  regenerate_key_parameters)
  request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

  path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AppConfiguration/configurationStores/{configStoreName}/RegenerateKey'

  request_url = @base_url || @client.base_url

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

  promise = promise.then do |result|
    http_response = result.response
    status_code = http_response.status
    response_content = http_response.body
    unless status_code == 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::Appconfiguration::Mgmt::V2019_11_01_preview::Models::ApiKey.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
regenerate_key_with_http_info(resource_group_name, config_store_name, regenerate_key_parameters, custom_headers:nil) click to toggle source

Regenerates an access key for the specified configuration store.

@param resource_group_name [String] The name of the resource group to which the container registry belongs. @param config_store_name [String] The name of the configuration store. @param regenerate_key_parameters [RegenerateKeyParameters] The parameters for regenerating an access key. @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/2019-11-01-preview/generated/azure_mgmt_appconfiguration/configuration_stores.rb, line 615
def regenerate_key_with_http_info(resource_group_name, config_store_name, regenerate_key_parameters, custom_headers:nil)
  regenerate_key_async(resource_group_name, config_store_name, regenerate_key_parameters, custom_headers:custom_headers).value!
end
update(resource_group_name, config_store_name, config_store_update_parameters, custom_headers:nil) click to toggle source

Updates a configuration store with the specified parameters.

@param resource_group_name [String] The name of the resource group to which the container registry belongs. @param config_store_name [String] The name of the configuration store. @param config_store_update_parameters [ConfigurationStoreUpdateParameters] The parameters for updating a configuration store. @param custom_headers [Hash{String => String}] A hash of custom headers that will be added to the HTTP request.

@return [ConfigurationStore] operation results.

# File lib/2019-11-01-preview/generated/azure_mgmt_appconfiguration/configuration_stores.rb, line 434
def update(resource_group_name, config_store_name, config_store_update_parameters, custom_headers:nil)
  response = update_async(resource_group_name, config_store_name, config_store_update_parameters, custom_headers:custom_headers).value!
  response.body unless response.nil?
end
update_async(resource_group_name, config_store_name, config_store_update_parameters, custom_headers:nil) click to toggle source

@param resource_group_name [String] The name of the resource group to which the container registry belongs. @param config_store_name [String] The name of the configuration store. @param config_store_update_parameters [ConfigurationStoreUpdateParameters] The parameters for updating a configuration store. @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/2019-11-01-preview/generated/azure_mgmt_appconfiguration/configuration_stores.rb, line 451
def update_async(resource_group_name, config_store_name, config_store_update_parameters, custom_headers:nil)
  # Send request
  promise = begin_update_async(resource_group_name, config_store_name, config_store_update_parameters, custom_headers:custom_headers)

  promise = promise.then do |response|
    # Defining deserialization method.
    deserialize_method = lambda do |parsed_response|
      result_mapper = Azure::Appconfiguration::Mgmt::V2019_11_01_preview::Models::ConfigurationStore.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